guard init <guard-name> command no more need Gemfile presence but open_gem is required now

Closes #3.
This commit is contained in:
Thibaud Guillaume-Gentil 2010-10-20 22:34:32 +02:00
parent e5f4f2aa8d
commit ec87585472
5 changed files with 27 additions and 10 deletions

View File

@ -3,6 +3,7 @@
Bugs fixes:
- Fixes for 1.8.6 compatibility (issue #2)
- guard init <guard-name> no more need Gemfile presence but open_gem is required now (issue #3)
== 0.2.0.beta.1 (Oct 17, 2010)

View File

@ -2,16 +2,23 @@ PATH
remote: .
specs:
guard (0.2.0.beta.1)
bundler (~> 1.0.2)
open_gem (~> 1.4.2)
thor (~> 0.14.3)
GEM
remote: http://rubygems.org/
specs:
configuration (1.1.0)
diff-lcs (1.1.2)
growl (1.0.3)
guard-rspec (0.1.3)
guard
launchy (0.3.7)
configuration (>= 0.0.5)
rake (>= 0.8.1)
open_gem (1.4.2)
launchy (~> 0.3.5)
rake (0.8.7)
rb-fsevent (0.3.2)
rspec (2.0.1)
rspec-core (~> 2.0.1)
@ -29,10 +36,11 @@ PLATFORMS
ruby
DEPENDENCIES
bundler (~> 1.0.2)
bundler (~> 1.0.3)
growl (~> 1.0.3)
guard!
guard-rspec (~> 0.1.3)
open_gem (~> 1.4.2)
rb-fsevent (>= 0.3.2)
rspec (~> 2.0.1)
thor (~> 0.14.3)

View File

@ -15,11 +15,12 @@ Gem::Specification.new do |s|
s.required_rubygems_version = '>= 1.3.6'
s.rubyforge_project = 'guard'
s.add_development_dependency 'rspec', '~> 2.0.1'
s.add_development_dependency 'guard-rspec', '~> 0.1.3'
s.add_development_dependency 'bundler', '~> 1.0.3'
s.add_development_dependency 'rspec', '~> 2.0.1'
s.add_development_dependency 'guard-rspec', '~> 0.1.3'
s.add_dependency 'bundler', '~> 1.0.2'
s.add_dependency 'thor', '~> 0.14.3'
s.add_dependency 'thor', '~> 0.14.3'
s.add_dependency 'open_gem', '~> 1.4.2'
s.files = Dir.glob('{bin,images,lib}/**/*') + %w[LICENSE README.rdoc]
s.executable = 'guard'

View File

@ -55,15 +55,14 @@ module Guard
end
def locate_guard(name)
spec = Bundler.load.specs.find{|s| s.name == "guard-#{name}" }
spec.full_gem_path
`gem open guard-#{name} --latest --command echo`
rescue
UI.error "Could not find gem 'guard-#{name}' in the current Gemfile."
UI.error "Could not find 'guard-#{name}' gem path."
end
def run
listener.stop
UI. clear if options[:clear]
UI.clear if options[:clear]
yield
listener.start
end

View File

@ -10,4 +10,12 @@ describe Guard do
end
describe "locate_guard" do
it "should return guard-rspec pat" do
Guard.locate_guard('rspec').should match(/^.*\/guard-rspec-.*$/)
end
end
end