Permalink
Browse files

Added bundler support

  • Loading branch information...
1 parent 663167a commit 9dce34cb28d7fc5fe5c47cec1655a000caee44b0 @pturley committed Oct 13, 2010
Showing with 113 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +16 −0 Gemfile
  3. +64 −0 Gemfile.lock
  4. +14 −0 config/boot.rb
  5. +18 −0 config/preinitializer.rb
View
@@ -7,3 +7,4 @@ db/*.sqlite3
*.swp
*~
.DS_Store
+/.bundle/
View
@@ -0,0 +1,16 @@
+source :gemcutter
+
+gem 'rails', '2.3.8'
+gem 'autotest-rails', '4.1.0'
+gem 'sqlite3-ruby', '1.3.1'
+
+group :test do
+ gem 'rspec', '1.3.0'
+ gem 'rspec-rails', '1.3.2'
+ gem 'webrat', '0.7.1'
+ gem 'launchy', '0.3.7'
+ gem 'autotest-rails', '4.1.0'
+ gem 'autotest-fsevent', '0.1.1'
+ gem 'autotest-growl', '0.2.0'
+ gem 'factory_girl', '1.3.2'
+end
View
@@ -0,0 +1,64 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ ZenTest (4.4.0)
+ actionmailer (2.3.8)
+ actionpack (= 2.3.8)
+ actionpack (2.3.8)
+ activesupport (= 2.3.8)
+ rack (~> 1.1.0)
+ activerecord (2.3.8)
+ activesupport (= 2.3.8)
+ activeresource (2.3.8)
+ activesupport (= 2.3.8)
+ activesupport (2.3.8)
+ autotest (4.4.1)
+ autotest-fsevent (0.1.1)
+ ZenTest (>= 4.0.0)
+ sys-uname (>= 0.8.3)
+ autotest-growl (0.2.0)
+ autotest (>= 4.2.4)
+ autotest-rails (4.1.0)
+ ZenTest
+ configuration (1.1.0)
+ factory_girl (1.3.2)
+ launchy (0.3.7)
+ configuration (>= 0.0.5)
+ rake (>= 0.8.1)
+ nokogiri (1.4.3.1)
+ rack (1.1.0)
+ rack-test (0.5.6)
+ rack (>= 1.0)
+ rails (2.3.8)
+ actionmailer (= 2.3.8)
+ actionpack (= 2.3.8)
+ activerecord (= 2.3.8)
+ activeresource (= 2.3.8)
+ activesupport (= 2.3.8)
+ rake (>= 0.8.3)
+ rake (0.8.7)
+ rspec (1.3.0)
+ rspec-rails (1.3.2)
+ rack (>= 1.0.0)
+ rspec (>= 1.3.0)
+ sqlite3-ruby (1.3.1)
+ sys-uname (0.8.4)
+ webrat (0.7.1)
+ nokogiri (>= 1.2.0)
+ rack (>= 1.0)
+ rack-test (>= 0.5.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ autotest-fsevent (= 0.1.1)
+ autotest-growl (= 0.2.0)
+ autotest-rails (= 4.1.0)
+ factory_girl (= 1.3.2)
+ launchy (= 0.3.7)
+ rails (= 2.3.8)
+ rspec (= 1.3.0)
+ rspec-rails (= 1.3.2)
+ sqlite3-ruby (= 1.3.1)
+ webrat (= 0.7.1)
View
@@ -106,5 +106,19 @@ def read_environment_rb
end
end
+class Rails::Boot
+ def run
+ load_initializer
+
+ Rails::Initializer.class_eval do
+ def load_gems
+ @bundler_loaded ||= Bundler.require :default, (ENV['RAILS_ENV']||'development')
+ end
+ end
+
+ Rails::Initializer.run(:set_load_path)
+ end
+end
+
# All that for this:
Rails.boot!
@@ -0,0 +1,18 @@
+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("0.9.24")
+ raise RuntimeError, "Your bunder version is too old for Rails 2.3. Run `gem install bundler` to upgrate."
+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

0 comments on commit 9dce34c

Please sign in to comment.