Permalink
Browse files

Handle case when gem dependencies are not yet installed.

  • Loading branch information...
1 parent 46b813c commit 926ae618175dd63bde9738df92d7274a912c7977 @kjwierenga committed May 9, 2011
Showing with 23 additions and 17 deletions.
  1. +23 −17 Rakefile
View
40 Rakefile
@@ -15,36 +15,42 @@ begin
gem.homepage = "http://github.com/kjwierenga/ralf"
gem.authors = ["Klaas Jan Wierenga", "Leon Berenschot"]
- gem.add_development_dependency 'rspec', '>= 1.3.0'
- gem.add_development_dependency 'fakeweb', '>= 1.2.8'
+ gem.add_development_dependency 'rspec', '~> 1.3.0'
+ gem.add_development_dependency 'fakeweb', '~> 1.2.8'
- gem.add_dependency 'right_aws', '>= 1.10.0'
- gem.add_dependency 'logmerge', '>= 1.0.2'
+ gem.add_dependency 'right_aws', '~> 1.10.0'
+ gem.add_dependency 'logmerge', '~> 1.0.2'
gem.add_dependency 'chronic', '>= 0.2.3'
gem.rdoc_options << '--exclude' << '.'
gem.has_rdoc = false
end
Jeweler::GemcutterTasks.new
rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
+ puts "Warning: Jeweler (or a dependency) not available."
+ puts " Check dependencies with `rake check_dependencies`."
end
-require 'spec/rake/spectask'
-Spec::Rake::SpecTask.new(:spec) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.spec_files = FileList['spec/**/*_spec.rb']
-end
+begin
+ require 'spec/rake/spectask'
+ Spec::Rake::SpecTask.new(:spec) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.spec_files = FileList['spec/**/*_spec.rb']
+ end
-Spec::Rake::SpecTask.new(:rcov) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.pattern = 'spec/**/*_spec.rb'
- spec.rcov = true
-end
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.rcov = true
+ end
-task :spec => :check_dependencies
+ task :spec => :check_dependencies
-task :default => :spec
+ task :default => :spec
+rescue LoadError
+ puts "Warning: Rspec not available."
+ puts " Check dependencies with `rake check_dependencies`."
+end
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|

0 comments on commit 926ae61

Please sign in to comment.