Commit Graph

133 Commits

Author SHA1 Message Date
Aaron Kalin and Veezus Kreist
add80d2831 Conform to project standards 2011-05-25 13:23:02 -05:00
Joshua Davey and Veezus Kreist
debdecbbd7 Allow user-based Guardfiles 2011-05-24 16:44:24 -05:00
John Bintz
310bc5b644 support for dashes in guard names 2011-05-23 19:07:12 -04:00
slavic
ad3def39e2 Changes connected with new version of rb-notifu 2011-05-22 11:38:54 +03:00
slavic
18d2db9ff1 windows notifiaction works (tested with guard-bundler) 2011-05-22 00:47:02 +03:00
slavic
02448b8575 windows notifiaction 2011-05-21 02:19:42 +03:00
Niklas Hofer
b12769d2bf can give path and options to Listener.select_and_init 2011-05-15 21:45:30 +02:00
Niklas Hofer
a3cf121111 can disable relativation of paths 2011-05-15 21:45:30 +02:00
Niklas Hofer
2f0870abfc refactor Polling Listener to catch deleted and moved files 2011-05-15 21:45:30 +02:00
Niklas Hofer
7b95eeb275 must not use touch on Linux 2011-05-15 21:45:30 +02:00
Niklas Hofer
bc740d725f create shared examples all listeners should behave like 2011-05-15 21:45:30 +02:00
Michael Kessler
30e4611342 Update the last event time after the rest period. 2011-05-13 12:33:56 +02:00
Michael Kessler
5f0c815256 Cleaning up all specs.
I basically went through all specs and applied the following rules:

* Use `describe` for methods and `context` for contexts.
* All class methods starts with `.` and instance methods with `#`.
* Removed all `it should`, because the specs _have to_.
* Applied a consistant naming on all listener specs.
* Make fixture usage more fail save by giving generous sleep times.
* Make all behaviour description non-technical and easy to understand.

The goal of this excercise was to have a documentation that is easy
readable and describes the behaviour and not the implementation.

Try it out by using the RSpec documentation format!
2011-05-13 11:26:05 +02:00
Michael Kessler
1db2456a45 Avoid result sorting by using =~ for array matching. 2011-05-13 09:01:12 +02:00
Michael Kessler
4e47e3e652 Wait 1 second before continue, so the fixture modifications won't influence the subsequent specs.
This is merely a guess, because all specs pass fine on the local machine but on Travis CI the next
spec that uses the fixtures fails. This might be a problem related to the rounding of the timestamps
in #file_modified?.
2011-05-12 20:27:07 +02:00
Michael Kessler
beb9f92409 Don't rely on the (almost random) order of an Array. 2011-05-12 18:16:32 +02:00
Michael Kessler
d3dab8b962 Remove unnecessary File creation. Specs are now passing on 1.8.7. 2011-05-12 17:01:48 +02:00
Michael Kessler
a1606b511f Fix sleep typo 2011-05-12 15:03:55 +02:00
Michael Kessler
d36f4c332f Add missing specs for file modification detection (See SHA: 0dcf13d77c) 2011-05-12 15:01:21 +02:00
Scott Parrish
3f15bbc1f0 Merge remote-tracking branch 'upstream/master'
Conflicts:
	lib/guard/notifier.rb
	spec/guard/notifier_spec.rb
2011-05-11 13:19:15 -06:00
Thibaud Guillaume-Gentil
f424854e61 Refactorized notifier enabling/disabling 2011-05-10 21:22:25 +02:00
Thibaud Guillaume-Gentil
0dcf13d77c - Handled quick file (<1s) modification
- Avoid to catch modified files without content modification (sha1 checksum)
(Specs needed)
2011-05-09 09:39:11 +02:00
Thibaud Guillaume-Gentil
aabf0583b3 Merge branch 'master' of github.com:guard/guard
Conflicts:
	lib/guard.rb
	spec/guard_spec.rb
2011-05-08 22:01:35 +02:00
Thibaud Guillaume-Gentil
1e5ab84b3a Fixed Guard::Notifier (when growl/libnotify not present) 2011-05-08 21:56:46 +02:00
Rémy Coutable
df98c4ff4c Merge branch 'master' of github.com:guard/guard 2011-05-07 18:48:13 +02:00
Rémy Coutable
9cfe8d3635 Don't modify a frozen hash. 2011-05-07 18:40:13 +02:00
slavic
92f81d383a Merge with current guard (commit '5352528530f29d3db523261560ee6920063c85b5') 2011-05-07 15:17:41 +03:00
Scott Parrish
562c367383 Made slight alteration to Guard::Notifier. pulled out logic into #should_send? to allow for stubbing in tests and added #turn_on to allow more flexibility for when things are or are not sent.
Notifier Specs changed to make pass, expanded and to use new notify strategies.  NOTE mac tests not tested.

i like the @enable as opposed to @disable, should be easy to reverse if necessary though
2011-05-07 00:43:21 -06:00
Scott Parrish
c749a311c3 slight changes to specs 2011-05-06 21:38:53 -06:00
Scott Parrish
526d769e22 update to current upstream 2011-05-06 21:18:42 -06:00
Scott Parrish
8ea296bf8f Guard::Dsl changed massively. overall strategy was to decouple to evaluate_guardfile into "getting the data" and "using the data" parts. this provides the ability to pass a string that contains the contents of a guardfile, or to pass a filename for a guardfile as well as reading the default loc for a guardfile.
Dsl specs changed massivly to support new style of Dsl
2011-05-06 20:53:34 -06:00
Thibaud Guillaume-Gentil
2f94f9e22f Fixed notification option
Only print notification "Install message" once
Added GUARD_NOTIFY=false env variable support
Fixes #28
2011-05-06 23:19:31 +02:00
Thibaud Guillaume-Gentil
5740548a51 Kept support of Rubygems < 1.8.0 (for now!) 2011-05-06 21:51:50 +02:00
Thibaud Guillaume-Gentil
a84e46ab48 Oups! 2011-05-06 21:29:22 +02:00
Thibaud Guillaume-Gentil
296837895a Skipped Guard::Notifier spec if growl/libnotify not installed 2011-05-06 21:27:28 +02:00
Thibaud Guillaume-Gentil
2da724f5e9 Fixed Rubygems deprecation messages 2011-05-06 21:23:30 +02:00
Thibaud Guillaume-Gentil
f7e9e42dce Skipped Darwin/Linux listener specs if rb-fsevent/rb-inotify not available 2011-05-06 21:15:33 +02:00
Thibaud Guillaume-Gentil
869ed2fa28 Fixed Interactor spec 2011-05-06 21:14:39 +02:00
Thibaud Guillaume-Gentil
d6d9dd9e75 Merge pull request #58 from nicksieger/interactor-module-methods
Extract code from signal handlers into methods
2011-05-06 12:08:45 -07:00
Nick Sieger
70c15a7c94 Extract code from signal handlers into methods
This will allow building other mechanisms to interact with Guard, for
example on JRuby, where signal handling tends to be unreliable.
2011-05-06 12:45:47 -05:00
Nick Sieger
5c1e264c39 Fix spec on JRuby that was failing due to different execution order 2011-05-06 12:09:00 -05:00
Scott Parrish
f3d49ee81e Made slight alteration to Guard::Notifier. pulled out logic into #should_send? to allow for stubbing in tests and added #turn_on to allow more flexibility for when things are or are not sent.
Notifier Specs changed to make pass, expanded and to use new notify strategies.  NOTE mac tests not tested.
Guard::Dsl changed massively.  overall strategy was to decouple to evaluate_guardfile into "getting the data" and "using the data" parts.  this provides the ability to pass a string that contains the contents of a guardfile, or to pass a filename for a guardfile as well as reading the default loc for a guardfile.
Dsl specs changed massivly to support new style of Dsl
listener/linux_spec changed to add a few :long_running tags and to alter some paths to correct values
listener/polling_spec changed to add a few :long_running tags and to alter some paths to correct values
2011-05-05 03:05:58 -06:00
slavic
0f7bca7bbd now all specs work 2011-05-01 21:49:16 +03:00
slavic
94e04ec7e0 add support for Windows using rb-fchange. Specs fail because of k32WaitForMultipleObjects blocks all threads 2011-04-30 13:38:57 +03:00
Jeff Sacks
38c371272d fixing require bug; updating documentation and version 2011-04-25 09:18:59 -05:00
Jeff Sacks
a0b6ecacdb adding support for inline classes 2011-04-21 16:39:46 -05:00
Rémy Coutable
9b981f5459 Run guards for new modified files only if any guard match any file (preventing from clearing the screen when no guard will run!).
Signed-off-by: Rémy Coutable <remy@jilion.com>
2011-04-16 23:13:29 +02:00
Thibaud Guillaume-Gentil
42c27242e1 Added a command line option (-n false) to disable notifications (growl/libnotify). closed #28 2011-04-10 22:32:29 +02:00
Thibaud Guillaume-Gentil
59f555e086 Switched to gem which command to locate gem path rather than open-gem 2011-02-22 15:15:09 +01:00
koshigoe
36e11c3820 fixed problem: Guard.get_guard_class return wrong class when loaded nested class.
The problem cause when using guard-ego with guard-spork.
2011-02-19 03:53:05 +09:00
Thibaud Guillaume-Gentil
9772e9d9c8 Replaced Thread (incompatible with inotify) by a whole dir scan after each run_on_changes 2011-01-19 23:05:45 +01:00
Rémy Coutable
a0f1ac4053 Renamed Guard::Dsl.guardfile_included? to Guard::Dsl.guardfile_include? (private API) and fix a bug where Guard::Dsl.guardfile_include? was not detecting guard specified with a symbol, double quotes or parenthesis in Guardfile.
e.g.:
guard :rspec
guard ('rspec')
guard("rspec")
...
2010-12-17 18:37:44 +01:00
Rémy Coutable
f90823ae90 Shortened implementation of the new group DSL method and made it (+ specs) clearer 2010-12-17 18:13:31 +01:00
Michael Kessler
63af219490 Enhance the DSL to allow grouping of guard definitions and run them selectively 2010-12-17 16:31:39 +01:00
Rémy Coutable
c788c00099 Fix bug that occurred when pattern was a string and no action was associated. 2010-12-16 15:09:36 +01:00
Rémy Coutable
ebe94d213b Improved deprecation warning message 2010-12-16 09:15:14 +01:00
Rémy Coutable
1831bf752f Guard no more automatically convert String into Regexp in "watch" method patterns.
It allows to define:

watch("foo_bar.rb") without meaning /foo_bar.rb/ (where "foo_bar_rb.rb" would have been matched)

However, during the deprecation phase, strings that look like a regexes (e.g. "^foo_bar.rb", "foo_bar.rb$", "foo_.*bar.rb" or "foo_(bar|baz).rb" are converted automatically to Regexp and a *very annoying* deprecation message is displayed.
2010-12-16 01:22:42 +01:00
Thibaud Guillaume-Gentil
2fc6745837 Merge branch 'master' of github.com:guard/guard
Conflicts:
	lib/guard.rb
	lib/guard/interactor.rb
	spec/guard_spec.rb
2010-11-30 21:23:53 +01:00
Thibaud Guillaume-Gentil
53a79691a5 Kept listener running in thread even when guards plugin are also running. 2010-11-30 21:15:03 +01:00
Rémy Coutable
3116b13f1b Optimized spec_helper, remove useless code and add the "bypass when test env" for UI.error 2010-11-26 00:57:08 +01:00
Rémy Coutable
47d1e11743 Added specs for Guard::Watcher, allow enumerables in 'watch' blocks. 2010-11-26 00:55:21 +01:00
Rémy Coutable
e2247ea732 Improving, cleaning & making clear Guard class' specs 2010-11-03 23:31:00 +01:00
Rémy Coutable
7a83f726d5 "Speed up" polling specs a bit 2010-10-30 22:42:33 +02:00
Rémy Coutable
39ea8441c0 Avoid using actual fixture files, instead mock Guardfile content (this way we can directly see tested Guardfile content in the specs. 2010-10-30 22:42:17 +02:00
Olivier Amblet
dd1100b4ae Added DSL specs and improved error message.
DSL now have basics specs that confirm it works
I splitted file not found and invalid Guardfile
error message because it was confusing to know
in which case you are when it occurs :)
2010-10-30 18:26:09 +02:00
Thibaud Guillaume-Gentil
9c15536eda Little "refactoring" 2010-10-28 08:47:26 +02:00
Olivier Amblet
cb8b845eb6 A bad guard do not threaten the whole process.
Every guard task are now executed through
supervised_task method.

If a guard failed to achieve its task(raise error)
a message is logged and the guard is fired.

The stop method now always quit the application
at the end.

Specs added. The documentation specify that if a
throw an exception, it will be dismissed.
2010-10-27 15:18:00 +02:00
Yann Lugrin
7bae189eba more specs on linux listener 2010-10-25 11:16:56 +02:00
Yann Lugrin
dd04914657 Linux support work fine now, don't loop more one time on same test. 2010-10-24 04:30:10 +08:00
Yann Lugrin
4daae46444 ensure don't have inotify event from past example in following example 2010-10-24 04:30:09 +08:00
Yann Lugrin
e19a9304ec Change inotify watch options to not fire event when file is juste read 2010-10-24 04:30:08 +08:00
Yann Lugrin
3cdcea3dfd locate_guard chomp newline at end of path 2010-10-24 04:30:07 +08:00
Yann Lugrin
59f9a9dafb guard notification work when guard guard 2010-10-22 02:24:03 +08:00
Yann Lugrin
eb8decd9ee linux and other system don't sort files in same order in polling listener, fix spec to work on linux 2010-10-22 02:24:01 +08:00
Yann Lugrin
31cfcc23d4 linux listener (and spec) work 2010-10-22 02:24:01 +08:00
Yann Lugrin
69245d9674 listener spec work on every systems 2010-10-22 02:24:00 +08:00
Yann Lugrin
9118f35a8d notifier spec work on linux 2010-10-22 02:23:59 +08:00
Thibaud Guillaume-Gentil
2191bc1088 Rescue Interrupt on run yield 2010-10-20 22:40:44 +02:00
Thibaud Guillaume-Gentil
ec87585472 guard init <guard-name> command no more need Gemfile presence but open_gem is required now
Closes #3.
2010-10-20 22:34:32 +02:00
Thibaud Guillaume-Gentil
6db69c1b6a Removed growl & libnotify dependencies from gemspec 2010-10-19 21:49:17 +02:00
Thibaud Guillaume-Gentil
c347c2c7e0 Added 1.8.6 compatibility
Closes #2.
2010-10-18 21:45:31 +02:00
Thibaud Guillaume-Gentil
3f922a0667 Refactorized listeners support
Added polling fallback
Removed sys-uname dependency
2010-10-17 21:42:40 +02:00
Thibaud Guillaume-Gentil
4d3744ff43 Initial commit 2010-10-03 23:00:33 +02:00