Commit Graph

5 Commits

Author SHA1 Message Date
Ryan Shaw 25725a198e parallelize build tasks
a faster rake js:generate, js:build, canvas:compile_assets, and guard

will use 'coffee' binary if installed

even if it doesn't use 'coffee' binary it will be
a lot faster

`time rake js:generate`
before               => real	0m29.960s
with 'coffee' binary => real	0m4.342s
without              => real	0m8.202s

test plan:
 * run bundle exec guard; ensure coffeescripts are compiled to the
   correct directories
 * run rake js:generate; ditto

Change-Id: I8fc4d4a415e5c77d1efa910c0922588d3095446b
Reviewed-on: https://gerrit.instructure.com/9989
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-04-16 16:38:23 -06:00
JT Olds 1bca3581c2 getting coffeescript and handlebars to work with plugins
test plan:
  * checkout patchset 1 from https://gerrit.instructure.com/7469
  * symlink the canvalytics repo into vendor/plugins/
  * symlink public/plugins/canvalytics to vendor/plugins/canvalytics/public/
  * run guard, regenerate all files
  * make sure the route /analytics/course/<id>/user/<id> renders handlebars

unit tests not provided for this scaffolding stuff

Change-Id: Ibf626555cbb79a5a97d67286ef4a7d8f28f53de8
Reviewed-on: https://gerrit.instructure.com/7470
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-12-30 15:50:16 -07:00
Ryan Shaw aa96b021e9 delete compiled js file if you delete a handlebars fie
couldn't actually get the run_on_deletion method working
but if you start guard and hit enter in that terminal window
it will delete the entire public/javascripts/jst directory
and re compile all

Change-Id: I25df0bc2cc0031c61e32c0141cef7d3f688a1056
Reviewed-on: https://gerrit.instructure.com/6171
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2011-10-18 17:17:54 -06:00
Ryan Shaw 84c3f3641a dont let JST guard die and don't have leading slash
Change-Id: I280bc6014b4779b81cab049064229323b6f77480
Reviewed-on: https://gerrit.instructure.com/6008
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2011-10-06 09:20:53 -06:00
Ryan Florence 0f9d86d0d8 Added JavaScript Specs and Client-side Templates
- New rake task `rake jst:compile` to precompile
  JavaScript templates into functions.

  Add handlebars templates to app/views/jst and
  they'll get compiled to public/javascripts/jst

- New rake task `rake jasmine` and `jasmine:ci` to
  run JavaScript specs.

  Add specs to spec/coffeescripts and they'll get
  compiled into spec/javascripts

- Added Guard gem `$ guard` that watches
  coffeescript and handlebars files and compiles
  them when changes are made.

- Created Handlebars Ruby class that precompiles
  the templates into JavaScript functions

- Added JS Template constructor to abstract
  our tempting API



Change-Id: Ie993d0fc50d49b161ed94dbc066c4475cefdc427
Reviewed-on: https://gerrit.instructure.com/5813
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2011-09-26 16:49:18 -06:00