Rake::Tilde
Run rake tasks when files change. No changes necessary to your Rakefile.
Installation
Add this line to your application's Gemfile:
gem 'rake-tilde'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rake-tilde
Usage
This gem monkeypatch's Rake to intercept any task that begins with ~. In that case thet task is run whenever any files in the project change. This is a basic wrapper around the listen gem.
More interesting things can be done by specifying folders, ignores, etc for tasks:
task :woo do
puts "woo"
end
listen to: :woo, path: "/somewhere-else", ignore: /\.rb$/ do |modified, added, removed|
puts "woooooo"
end
Then run it like this:
$ rake ~woo
Contributing
- Fork it ( https://github.com/[my-github-username]/rake-tilde/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request