Lets you set up a Guard that will run Steering whenever a Handlebars.js template is added / updated.
The reason this Gem was born is developing a HTML5 based desktop application which relies on static compilation. Still wanting to get the benefit of having fast Handlebars templating, precompilation is now done development time instead of loading the templates and letting the full runtime JS do the work.
For some comprehensive examples and explanation see Guard-Steering-examples or in case you're familiar with Handlebars and Guard just read on.
Point the Guard watcher to your Handlebars template folder, set up the output folder in the options part and you're all set! Note: at the moment Guard::Steering won't rebuild your folder structure.
guard 'steering', {
:output_folder => "build/handlebars",
:run_at_start => true,
:register_partials => true,
:quiet => false
} do
watch(%r{^source/handlebars/.*\.handlebars$})
end
source "https://rubygems.org"
gem "guard"
gem "steering"
gem "guard-steering"
$ bundle install
$ bundle exec guard init steering
$ bundle exec guard
- Finish test suite
- Fix bug with empty template being generated for deleted file
- Add an example - WIP at https://github.com/daaain/guard-steering-sample
- Investigate supporting rebuilding of folder tree in output folder from inside source folder
- Adds silent option
- Refactored target folder creation (it's now recursive and handles nil) and moved it to :start method to play nicer with the way Guard >1.6 works
- Got Travis working
- Set tests up (still need to cover actual functionality)
- Cleaned up documentation
- Now compatible with Guard 1.1+ APIs
- Added 'register_partials' option, which automatically registers templates as partials too
- Made it work with static Guard compilation, so can be used from Rake or even a simple Ruby script
- Fixed bug with 'run_at_start' option
- Added versions to Gem dependencies.
- Removed 'handlebars' extension requirement, this is now left to Guard watch pattern to filter.
- Updated documentation with links to other Gems / Github repos.
- Extended copyright license to ustwo™
Initial version.
ustwo™ design studios
(The MIT License)
Copyright (c) 2012 Daniel Demmel, ustwo™
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.