diff --git a/CHANGELOG.markdown b/CHANGELOG.md similarity index 57% rename from CHANGELOG.markdown rename to CHANGELOG.md index c87d1a2..6a3744b 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.md @@ -1,6 +1,23 @@ +## 0.4.0.rc - May 28, 2011 + +### Bugs fixes: + +- Pull request [#69](https://github.com/guard/guard/pull/69): Fixed typo in README: Ctr-/ => Ctr-\\. ([@tinogomes](https://github.com/tinogomes)) +- Pull request [#66](https://github.com/guard/guard/pull/66): Support for dashes in guard names. ([@johnbintz](https://github.com/johnbintz)) +- Require `guard/ui` because Guard::Notifier can be required without full Guard. ([@yannlugrin](https://github.com/yannlugrin)) +- Handled quick file (<1s) modification. Avoid to catch modified files without content modification (sha1 checksum). ([@thibaudgg](https://github.com/thibaudgg) and [@netzpirat](https://github.com/netzpirat)) +- Fixed Guard::Notifier (when growl/libnotify not present). ([@thibaudgg](https://github.com/thibaudgg)) +- Fixed Rubygems deprecation messages. ([@thibaudgg](https://github.com/thibaudgg)) + ### New features: -- Pull request [#55](https://github.com/guard/guard/issues/55): It is now possible to pass `:guardfile` (a Guardfile path) or `:guardfile_contents` (the content of a Guardfile). Hence this allows to use Guard::Dsl.evaluate_guardfile in a programmatic manner. ([@anithri](https://github.com/anithri), improved by ([@rymai](https://github.com/rymai)) +- Pull request [#67](https://github.com/guard/guard/pull/67): Allow Guardfile in $HOME folder. ([@hashrocketeer](https://github.com/hashrocketeer)) +- Pull request [#64](https://github.com/guard/guard/pull/64): Windows notifications support. ([@stereobooster](https://github.com/stereobooster)) +- Use ENV['GUARD_NOTIFY"] to disable notifications. ([@thibaudgg](https://github.com/thibaudgg)) +- Cleaning up all specs. ([@netzpirat](https://github.com/netzpirat)) +- Pull request [#60](https://github.com/guard/guard/pull/60): Added Windows support. ([@stereobooster](https://github.com/stereobooster)) +- Pull request [#58](https://github.com/guard/guard/pull/58): Extract code from signal handlers into methods. ([@nicksieger](https://github.com/nicksieger)) +- Pull request [#55](https://github.com/guard/guard/pull/55): It is now possible to pass `:guardfile` (a Guardfile path) or `:guardfile_contents` (the content of a Guardfile) to `Guard::Dsl.evaluate_guardfile`. Hence this allows the use of `Guard::Dsl.evaluate_guardfile` in a programmatic manner. ([@anithri](https://github.com/anithri), improved by ([@rymai](https://github.com/rymai)) ## 0.3.4 - April 24, 2011 @@ -27,7 +44,7 @@ ### Bugs fixes: -- Pull request [#43](https://github.com/guard/guard/issues/43): Fixed `guard init` command. ([@brainopia](https://github.com/brainopia)) +- Pull request [#43](https://github.com/guard/guard/pull/43): Fixed `guard init` command. ([@brainopia](https://github.com/brainopia)) ## 0.3.1 - April 14, 2011 @@ -53,8 +70,7 @@ ### New features: - The whole directory is now watched during `run_on_change` to detect new files modifications. ([@thibaudgg](https://github.com/thibaudgg)) -- Pull request [#26](https://github.com/guard/guard/issues/26): New DSL method: `group` allows you to group several guards. ([@netzpirat](https://github.com/netzpirat)) -- Pull request [#26](https://github.com/guard/guard/issues/26): New CLI option: `--group group_name` to specify certain groups of guards to start. ([@netzpirat](https://github.com/netzpirat)) +- Pull request [#26](https://github.com/guard/guard/pull/26): New DSL method: `group` allows you to group several guards. New CLI option: `--group group_name` to specify certain groups of guards to start. ([@netzpirat](https://github.com/netzpirat)) - `watch` patterns are now more strict: strings are matched with `String#==`, `Regexp` are matched with `Regexp#match`. ([@rymai](https://github.com/rymai)) - A deprecation warning is displayed if your `Guardfile` contains `String` that look like `Regexp` (bad!). ([@rymai](https://github.com/rymai)) - It's now possible to return an `Enumerable` in the `watch` optional blocks in the `Guardfile`. ([@rymai](https://github.com/rymai)) @@ -62,7 +78,7 @@ ### New specs: - Guard::Watcher. ([@rymai](https://github.com/rymai)) -- Pull request [#13](https://github.com/guard/guard/issues/13): Guard::Dsl. ([@oliamb](https://github.com/oliamb)) +- Pull request [#13](https://github.com/guard/guard/pull/13): Guard::Dsl. ([@oliamb](https://github.com/oliamb)) ## 0.2.2 - October 25, 2010 @@ -76,8 +92,8 @@ ### Bugs fixes: -- Pull request [#7](https://github.com/guard/guard/issues/7): Fixes for Linux support. ([@yannlugrin](https://github.com/yannlugrin))) -- Pull request [#6](https://github.com/guard/guard/issues/6): Locate guard now chomp newline in result path. ([@yannlugrin](https://github.com/yannlugrin))) +- Pull request [#7](https://github.com/guard/guard/pull/7): Fixes for Linux support. ([@yannlugrin](https://github.com/yannlugrin))) +- Pull request [#6](https://github.com/guard/guard/pull/6): Locate guard now chomp newline in result path. ([@yannlugrin](https://github.com/yannlugrin))) ## 0.2.0 - October 21, 2010 diff --git a/README.markdown b/README.md similarity index 89% rename from README.markdown rename to README.md index 2e16e34..99e7657 100644 --- a/README.markdown +++ b/README.md @@ -103,7 +103,7 @@ or if you use Bundler, to run the Guard executable specific to your bundle: $ bundle exec guard ``` -Guard will look for a Guardfile in your current directory. If it does not find one, it will look in your home directory for one. +Guard will look for a Guardfile in your current directory. If it does not find one, it will look in your `$HOME` directory for one. Command line options -------------------- @@ -212,6 +212,30 @@ group 'frontend' do end ``` +The Guardfile DSL can also be used in a programmatic fashion by calling directly `Guard::Dsl.evaluate_guardfile`. +Available options are as follow: + +* `:guardfile` - The path to a valid Guardfile. +* `:guardfile_contents` - A string representing the content of a valid Guardfile + +Without any options given, Guard will look for a Guardfile in your current directory and if it does not find one, it will look in your `$HOME` directory for one. + +For instance, you could use it as follow: + +``` ruby +require 'guard' + +Guard.setup + +Guard::Dsl.evaluate_guardfile(:guardfile => '/Your/Custom/Path/To/A/Valid/Guardfile') +# or +Guard::Dsl.evaluate_guardfile(:guardfile_contents => " + guard 'rspec' do + watch(%r{^spec/.+_spec\.rb}) + end +") +``` + Create a new guard ------------------ @@ -304,7 +328,7 @@ Development * Report Issues/Questions/Feature requests on [GitHub Issues](https://github.com/guard/guard/issues). Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change -you make. +you make. Please do not change the version in your pull-request. Author ------ diff --git a/lib/guard/dsl.rb b/lib/guard/dsl.rb index e2c6d62..454729d 100644 --- a/lib/guard/dsl.rb +++ b/lib/guard/dsl.rb @@ -3,9 +3,6 @@ module Guard class << self @@options = nil - # TODO: Add documentation to explain that it is possible to pass `:guardfile` (a Guardfile path) - # or `:guardfile_contents` (the content of a Guardfile). Hence this allows to use Guard::Dsl.evaluate_guardfile - # in a programmatic manner def evaluate_guardfile(options = {}) options.is_a?(Hash) or raise ArgumentError.new("evaluate_guardfile not passed a Hash!")