Skip to content
Browse files

Update Rakefile to use Bundler

* includes updating Gemspec to include Rake (for rake tasks)
  • Loading branch information...
1 parent e7925c9 commit 6c9d632613854dd2faec35b3dc88c7efd9e6163c @mtodd mtodd committed Apr 30, 2011
Showing with 16 additions and 3 deletions.
  1. +13 −3 Rakefile
  2. +3 −0 quantity.gemspec
View
16 Rakefile
@@ -1,12 +1,23 @@
#!/usr/bin/env ruby
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
-require 'rubygems'
require 'quantity'
+
+require "rubygems"
+require "bundler"
+Bundler::GemHelper.install_tasks
+
+begin
+ Bundler.setup(:default, :development)
+rescue Bundler::BundlerError => e
+ $stderr.puts e.message
+ $stderr.puts "Run `bundle install` to install missing gems"
+ exit e.status_code
+end
+
require 'spec'
require 'spec/rake/spectask'
require 'yard'
-
desc "Run specs"
Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = FileList['spec/quantity.spec']
@@ -35,4 +46,3 @@ desc "package yardocs"
YARD::Rake::YardocTask.new('yard') do |t|
# see .yardopts for the action
end
-
View
3 quantity.gemspec
@@ -21,13 +21,16 @@ Things like 1.meter / 1.second == 1 meter/second.
s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_development_dependency(%q<rake>, ["= 0.8.7"])
s.add_development_dependency(%q<rspec>, ["= 1.2.9"])
s.add_development_dependency(%q<yard>, ["= 0.5.2"])
else
+ s.add_dependency(%q<rake>, ["= 0.8.7"])
s.add_dependency(%q<rspec>, ["= 1.2.9"])
s.add_dependency(%q<yard>, ["= 0.5.2"])
end
else
+ s.add_dependency(%q<rake>, ["= 0.8.7"])
s.add_dependency(%q<rspec>, ["= 1.2.9"])
s.add_dependency(%q<yard>, ["= 0.5.2"])
end

0 comments on commit 6c9d632

Please sign in to comment.
Something went wrong with that request. Please try again.