Permalink
Browse files

Updating Rakefile to require bundler to run

  • Loading branch information...
1 parent bf65c1e commit 7eaed2195b4e060456df1e1df86fc2f7e2fa807f @mikel committed Oct 7, 2010
Showing with 21 additions and 14 deletions.
  1. +21 −0 Rakefile
  2. +0 −14 spec/environment.rb
View
@@ -1,3 +1,24 @@
+begin
+ require "rubygems"
+ require "bundler"
+rescue LoadError
+ raise "Could not load the bundler gem. Install it with `gem install bundler`."
+end
+
+if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("1.0.0")
+ raise RuntimeError, "Your bundler version is too old for Mail" +
+ "Run `gem install bundler` to upgrade."
+end
+
+begin
+ # Set up load paths for all bundled gems
+ ENV["BUNDLE_GEMFILE"] = File.expand_path("../Gemfile", __FILE__)
+ Bundler.setup
+rescue Bundler::GemNotFound
+ raise RuntimeError, "Bundler couldn't find some gems." +
+ "Did you run `bundle install`?"
+end
+
require File.expand_path('../spec/environment', __FILE__)
require 'rake/rdoctask'
View
@@ -1,15 +1 @@
-begin
- require File.expand_path('../../.bundle/environment', __FILE__)
-rescue LoadError
- # bust gem prelude
- if defined? Gem
- Gem.cache
- gem 'bundler'
- else
- require 'rubygems'
- end
- require 'bundler'
- Bundler.setup
-end
-
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)

0 comments on commit 7eaed21

Please sign in to comment.