Friday 11 July 2014

Re-structuring privly-applications

Privly-Applications repo has different applications in it. Like ZeroBin, PlainPost etc.

All the apps have new.html and a show.html files that do app specific tasks.

These new.html and show.html files are generated by a script 'build.py' that takes a template file "new.html.template" and "show.html.template" from the templates directory and "new.html.subtemplate" and "show.html.subtemplate" from the app directory to finally build the new.html and show.html file.

So change the structure of privly-applications I had to makes changes to the .template and .subtemplate files so that they don't use the meta_loader.js to load the spec files from the <meta> tags. The new structure instead requires all the app specific specs to be already included in the html as javascript files.

So I made changes to the .template file wherein I removed the use of meta_loader.js and added shared javascript files that are common to all the privly-applications. The jasmine library and the console-runner are also included in the .template file only. Then I made changes to specific .subtemplate files of each app wherein I added app specific spec files.

Then I ran the `build.py` script (make sure all the dependencies are installed) which generated the new.html and show.html files for all the apps depending upon the new .template and .subtemplate files.

No comments:

Post a Comment