Permalink
Browse files

Added 1.8.6 compatibility

Closes #2.
  • Loading branch information...
1 parent ee3f3f6 commit c347c2c7e0c59d6fd270677c0757f7603eb192a4 Thibaud Guillaume-Gentil committed Oct 18, 2010
Showing with 30 additions and 7 deletions.
  1. +6 −0 CHANGELOG.rdoc
  2. +1 −1 README.rdoc
  3. +1 −1 Rakefile
  4. +6 −2 lib/guard.rb
  5. +3 −3 lib/guard/interactor.rb
  6. +13 −0 spec/guard_spec.rb
View
@@ -1,3 +1,9 @@
+== Master
+
+Bugs fixes:
+
+- Fixes for 1.8.6 compatibility (issue #2)
+
== 0.2.0.beta.1 (Oct 17, 2010)
Features:
View
@@ -11,7 +11,7 @@ Guard is a command line tool to easly handle events on files modifications.
- Automatic files modifications detection (even new files are detected)
- Growl notification (please install {growlnotify}[http://growl.info/documentation/growlnotify.php])
- Libnotify notification
-- Tested on Ruby 1.8.7 & 1.9.2.
+- Tested on Ruby 1.8.6, 1.8.7 & 1.9.2
== Install
View
@@ -8,7 +8,7 @@ task :default => :spec
namespace(:spec) do
desc "Run all specs on multiple ruby versions (requires rvm)"
task(:portability) do
- %w[1.8.7 1.9.2 jruby].each do |version|
+ %w[1.8.6 1.8.7 1.9.2].each do |version|
system <<-BASH
bash -c 'source ~/.rvm/scripts/rvm;
rvm #{version};
View
@@ -33,7 +33,7 @@ def start(options = {})
end
UI.info "Guard is now watching at '#{Dir.pwd}'"
- guards.each(&:start)
+ guards.each { |g| g.start }
listener.start
end
end
@@ -45,7 +45,11 @@ def add_guard(name, watchers = [], options = {})
def get_guard_class(name)
require "guard/#{name.downcase}"
- guard_class = ObjectSpace.each_object(Class).detect { |c| c.to_s.downcase.match "^guard::#{name.downcase}" }
+ klasses = []
+ ObjectSpace.each_object(Class) do |klass|
+ klasses << klass if klass.to_s.downcase.match "^guard::#{name.downcase}"
+ end
+ klasses.first
rescue LoadError
UI.error "Could not find gem 'guard-#{name}' in the current Gemfile."
end
@@ -5,14 +5,14 @@ def self.init_signal_traps
# Run all (Ctrl-\)
Signal.trap('QUIT') do
::Guard.run do
- ::Guard.guards.each(&:run_all)
+ ::Guard.guards.each { |g| g.run_all }
end
end
# Stop (Ctrl-C)
Signal.trap('INT') do
::Guard.listener.stop
- if ::Guard.guards.all?(&:stop)
+ if ::Guard.guards.all? { |g| g.stop }
UI.info "Bye bye...", :reset => true
abort("\n")
else
@@ -23,7 +23,7 @@ def self.init_signal_traps
# Reload (Ctrl-Z)
Signal.trap('TSTP') do
::Guard.run do
- ::Guard.guards.each(&:reload)
+ ::Guard.guards.each { |g| g.reload }
end
end
end
View
@@ -0,0 +1,13 @@
+require 'spec_helper'
+
+describe Guard do
+
+ describe "get_guard_class" do
+
+ it "should return Guard::RSpec" do
+ Guard.get_guard_class('rspec').should == Guard::RSpec
+ end
+
+ end
+
+end

0 comments on commit c347c2c

Please sign in to comment.