From 2da724f5e9f8071c5c401b957f81a1771b8100ad Mon Sep 17 00:00:00 2001 From: Thibaud Guillaume-Gentil Date: Fri, 6 May 2011 21:23:30 +0200 Subject: [PATCH] Fixed Rubygems deprecation messages --- lib/guard.rb | 2 +- spec/guard_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/guard.rb b/lib/guard.rb index b5f1865..23ffd8a 100644 --- a/lib/guard.rb +++ b/lib/guard.rb @@ -93,7 +93,7 @@ module Guard end def locate_guard(name) - Gem.source_index.find_name("guard-#{name}").last.full_gem_path + Gem::Specification.find_by_name("guard-#{name}").full_gem_path rescue UI.error "Could not find 'guard-#{name}' gem path." end diff --git a/spec/guard_spec.rb b/spec/guard_spec.rb index 7997a18..c776314 100644 --- a/spec/guard_spec.rb +++ b/spec/guard_spec.rb @@ -111,7 +111,7 @@ describe Guard do describe ".locate_guard" do it "returns the path of the guard gem" do - Guard.locate_guard('rspec').should == Gem.source_index.find_name("guard-rspec").last.full_gem_path + Guard.locate_guard('rspec').should == Gem::Specification.find_by_name("guard-rspec").full_gem_path end end end