fixing require bug; updating documentation and version

This commit is contained in:
Jeff Sacks 2011-04-25 09:18:59 -05:00
parent a0b6ecacdb
commit 38c371272d
4 changed files with 22 additions and 6 deletions

View File

@ -215,6 +215,22 @@ Creating a new guard is very easy, just create a new gem (<tt>bundle gem</tt> if
Please take a look at the existing guards' source code (see the list above) for more concrete example.
Alternatively, a new guard can be added inline to a Guardfile with this basic structure:
require 'guard/guard'
module ::Guard
class Example < ::Guard::Guard
def run_all
true
end
def run_on_change(paths)
true
end
end
end
== Development
- Source hosted at {GitHub}[https://github.com/guard/guard].

View File

@ -90,7 +90,7 @@ module Guard
end
def try_to_load_gem(name)
Kernel.require "guard/#{name.downcase}"
require "guard/#{name.downcase}"
rescue LoadError
end

View File

@ -1,3 +1,3 @@
module Guard
VERSION = "0.3.3"
VERSION = "0.3.4"
end

View File

@ -37,8 +37,8 @@ describe Guard do
context 'loaded some nested classes' do
it "should find and return loaded class" do
Kernel.should_receive(:require) { |file_name|
file_name.should == 'guard/classname'
Guard.should_receive(:try_to_load_gem) { |className|
className.should == 'classname'
class Guard::Classname
end
}