Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelbartlett committed Sep 8, 2013
2 parents 42c6627 + 6d5dd72 commit 5a26bcd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
14 changes: 2 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
## 1.3.0 - Aug 14, 2013

### Change

- Defaults `Listener#relative_paths` to `false` when listening to a single directory (see [#131][]). ([@rehevkor5][])

## 1.2.3 - Aug 9, 2013

### Improvement

- Rescue changes callback and warms if something bad happens. (reported by [@21croissants][], added by [@thibaudgg][])
# !!! Moved to Github [releases](https://github.com/guard/listen/releases) page !!!

## 1.2.2 - Jun 17, 2013

Expand Down Expand Up @@ -374,4 +364,4 @@
[@textgoeshere]: https://github.com/textgoeshere
[@thibaudgg]: https://github.com/thibaudgg
[@vongruenigen]: https://github.com/vongruenigen
[@zanker]: https://github.com/zanker
[@zanker]: https://github.com/zanker
3 changes: 2 additions & 1 deletion lib/listen/listener.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ def on_change(directories, options = {})
block.call(changes[:modified], changes[:added], changes[:removed])
end
rescue => ex
Kernel.warn "[Listen warning]: Change block raise an execption: #{ex.inspect}"
Kernel.warn "[Listen warning]: Change block raise an execption: #{$!}"
Kernel.warn "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/listen/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Listen
VERSION = '1.3.0'
VERSION = '1.3.1'
end
4 changes: 3 additions & 1 deletion spec/listen/listener_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Listen::Adapter.stub(:select_and_initialize) { adapter }
# Don't build a record of the files inside the base directory.
Listen::DirectoryRecord.any_instance.stub(:build)
Kernel.stub(:warn)
end
subject { described_class.new(watched_directories) }

Expand Down Expand Up @@ -209,7 +210,8 @@
end

it "stops the adapter and warns" do
Kernel.should_receive(:warn).with("[Listen warning]: Change block raise an execption: #<RuntimeError: foo>")
Kernel.should_receive(:warn).with("[Listen warning]: Change block raise an execption: foo")
Kernel.should_receive(:warn).with(/^Backtrace:.*/)
subject.on_change(directories)
end

Expand Down

0 comments on commit 5a26bcd

Please sign in to comment.