Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updating Rakefile to require bundler to run

  • Loading branch information...
commit 7eaed2195b4e060456df1e1df86fc2f7e2fa807f 1 parent bf65c1e
Mikel Lindsaar authored
Showing with 21 additions and 14 deletions.
  1. +21 −0 Rakefile
  2. +0 −14 spec/environment.rb
21 Rakefile
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'
14 spec/environment.rb
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__)
Please sign in to comment.
Something went wrong with that request. Please try again.