List plugins embedded in non dedicated gem #373

Merged
merged 1 commit into from Dec 17, 2012

Conversation

Projects
None yet
4 participants
Contributor

schmurfy commented Dec 11, 2012

It looks like it was easier than I thought !

this change includes in the "guard list" output guard plugins which are not in a "guard-xxx" gem by looking inside the gem folder if a "lib/guard/<gem_name>.rb" file is available.

I only updated the code for rubygems 1.8.0+ since I am not sure about the api provided below.

Owner

thibaudgg commented Dec 12, 2012

Can you please add some specs, thanks!

Contributor

schmurfy commented Dec 13, 2012

specs added !

Owner

thibaudgg commented Dec 13, 2012

Thanks, @guard/core-team seems good to you?

Contributor

netzpirat commented Dec 13, 2012

Yes, looks fine for me.

@rymai rymai and 1 other commented on an outdated diff Dec 13, 2012

spec/guard_spec.rb
@@ -780,6 +780,20 @@ class Inline < Guard
gems = Guard.guard_gem_names
gems.should include("rspec")
end
+
+ it "returns the list of embedded guard gems" do
+ gem1 = stub(:gem, :name => "gem1", :full_gem_path => '/gem1' )
+ gem2 = stub(:gem, :name => "gem2", :full_gem_path => '/gem2' )
+ gem3 = stub(:gem, :name => "guard", :full_gem_path => '/guard' )
+
+ File.should_receive(:exists?).with('/gem1/lib/guard/gem1.rb').and_return(false)
+ File.should_receive(:exists?).with('/gem2/lib/guard/gem2.rb').and_return(true)
+
+ Gem::Specification.should_receive(:find_all).and_return([gem1, gem2])
@rymai

rymai Dec 13, 2012

Owner

Shouldn't you return Gem::Specification.should_receive(:find_all).and_return([gem1, gem2, gem3]) here instead?

@schmurfy

schmurfy Dec 13, 2012

Contributor

good catch :)

Owner

rymai commented Dec 13, 2012

Other than my comment, it seems good to me!

Contributor

schmurfy commented Dec 13, 2012

specs fixed.

Owner

thibaudgg commented Dec 17, 2012

@schmurfy can you try an empty commit to see if travis-ci build are ok now? Thanks!

Contributor

schmurfy commented Dec 17, 2012

just rebased on master.

Owner

thibaudgg commented Dec 17, 2012

Great thanks!

thibaudgg merged commit 8883a30 into guard:master Dec 17, 2012

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment