Skip to content

Calling break doesn't exit from the block passed to Listen.to #90

Description

@kyoma-takahashi

Dear all,

I'm not sure whether it is an expected behavior or an issue, but I'd like to report.

When listening as the followings, it does not break from the block even when something changed on the directory.

require 'listen'
Listen.to('.') do |m,a,r|
  p m,a,r
  break
end

Instead, the followings stop listening when something changed on the directory.

require 'listen'
l = Listen.to('.')
l.change do |m,a,r|
  p m,a,r
  l.stop
end
l.start

My environment is the followings.

$ ruby -v
ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-linux]
$ gem list --local listen
listen (0.7.3)
$ gem list --local rb-inotify
rb-inotify (0.9.0)

I had posted this to Google Group https://groups.google.com/forum/#!topic/guard-dev/kyLxIosT6IQ as instructed by https://github.com/guard/listen/blob/master/CONTRIBUTING.md and I was asked to open an issue here.

Cheers,

Kyoma

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions