Skip to content

Guard::Listener.select_and_init requires hash #233

Closed
sunaku opened this Issue Jan 29, 2012 · 6 comments

3 participants

@sunaku
sunaku commented Jan 29, 2012

The options=nil parameter suggests that the options hash is optional, but Guard fails without it:

!?notify ~/src/tork> irb -r guard/listener                                                                    10:12AM
## ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
>> Guard::Listener.select_and_init
NoMethodError: undefined method `inject' for nil:NilClass
    from /home/sunny/app/rubygems/gems/guard-1.0.0/lib/guard/listener.rb:68:in `initialize'
    from /home/sunny/app/rubygems/gems/guard-1.0.0/lib/guard/listeners/linux.rb:10:in `initialize'
    from /home/sunny/app/rubygems/gems/guard-1.0.0/lib/guard/listener.rb:44:in `new'
    from /home/sunny/app/rubygems/gems/guard-1.0.0/lib/guard/listener.rb:44:in `select_and_init'
    from (irb):1
    from /usr/bin/irb:12:in `<main>'

This problem has existed since Guard v0.9.0. I have updated the wiki accordingly. :gift:

@thibaudgg thibaudgg pushed a commit that closed this issue Jan 30, 2012
Thibaud Guillaume-Gentil Set options default to {} for Listener#select_and_init
Fix #233
0965d61
@thibaudgg thibaudgg closed this in 0965d61 Jan 30, 2012
@thibaudgg
Guard member

Thanks to report it, it's fixed now! :)

@netzpirat

If you're interested in the FS listener, have a look at the upcoming Listener. Any feedback is appreciated.

@sunaku
sunaku commented Jan 30, 2012

@netzpirat The API looks good. My first reaction was to reject the ignore and filter option passed into Listen.to: I say, just give the user the raw events as they come and let them do their own processing. But later, when I saw the (ARel style) chainable query creation, the ignore() and filter() modifiers seemed more reasonable.

Definitely looking forward to this being released, but first, perhaps a more memorable, non-generic project name would be in order? How about "filling" for file system listening? :)

@thibaudgg
Guard member

@sunaku not sure about filling being more memorable, Listen sound great to me and I already released version 0.1.0. :)

@sunaku
sunaku commented Jan 30, 2012

Ooh nice! I'm going to use it instead of Guard::Listener.

@thibaudgg
Guard member

@sunaku at the moment only polling adapter is implemented and the README isn't in sync with the code, but it'll be updated soon. That' a work in progress.. ;)

Pease feel free to give your feedback on open issues, like this one. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.