Permalink
Browse files

moving this app to using bundler

  • Loading branch information...
1 parent 1094772 commit 0ef7aef4abcd2bc30d02870b76d5c1ca4562c813 @Bringo Bringo committed Jan 3, 2012
Showing with 154 additions and 17 deletions.
  1. +1 −0 .gitignore
  2. +21 −0 Gemfile
  3. +95 −0 Gemfile.lock
  4. +15 −0 config/boot.rb
  5. +2 −17 config/environment.rb
  6. +20 −0 config/preinitializer.rb
View
@@ -8,3 +8,4 @@ public/javascripts/bundle_*
public/stylesheets/bundle_*
.DS_Store
.rvmrc
+.bundle
View
21 Gemfile
@@ -0,0 +1,21 @@
+source 'http://rubygems.org/'
+gem 'rails', '2.3.14'
+gem 'mysql'
+
+gem 'haml', '~> 3.0.6'
+gem 'libxml-ruby', :require => 'libxml'
+gem 'libxslt-ruby', '0.9.2', :require => 'libxslt'
+gem 'rubyzip', :require => 'zip/zip'
+gem 'mime-types', :require => 'mime/types'
+gem 'uuidtools', '1.0.4'
+gem 'will_paginate', '~> 2.3.16'
+gem 'whenever', '0.4.1', :require => false
+gem 'rsolr', '0.12.1'
+gem 'sunspot', '1.1.0'
+gem 'sunspot_rails', '1.1.0', :require => 'sunspot/rails'
+gem 'grit'
+gem 'aws-s3', :require => 'aws/s3'
+gem 'delayed_job', '< 2'
+gem 'fastercsv'
+gem 'formtastic', '1.2.4'
+gem 'exceptional', :group => :production
View
@@ -0,0 +1,95 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (2.3.14)
+ actionpack (= 2.3.14)
+ actionpack (2.3.14)
+ activesupport (= 2.3.14)
+ rack (~> 1.1.0)
+ activerecord (2.3.14)
+ activesupport (= 2.3.14)
+ activeresource (2.3.14)
+ activesupport (= 2.3.14)
+ activesupport (2.3.14)
+ aws-s3 (0.6.2)
+ builder
+ mime-types
+ xml-simple
+ builder (3.0.0)
+ chronic (0.6.6)
+ delayed_job (1.8.5)
+ diff-lcs (1.1.3)
+ escape (0.0.4)
+ exceptional (2.0.32)
+ rack
+ fastercsv (1.5.4)
+ formtastic (1.2.4)
+ actionpack (>= 2.3.7)
+ activesupport (>= 2.3.7)
+ i18n (~> 0.4)
+ grit (2.4.1)
+ diff-lcs (~> 1.1)
+ mime-types (~> 1.15)
+ haml (3.0.25)
+ i18n (0.6.0)
+ libxml-ruby (2.2.2)
+ libxslt-ruby (0.9.2)
+ libxml-ruby (>= 0.9.4)
+ mime-types (1.17.2)
+ mysql (2.8.1)
+ rack (1.1.3)
+ rails (2.3.14)
+ actionmailer (= 2.3.14)
+ actionpack (= 2.3.14)
+ activerecord (= 2.3.14)
+ activeresource (= 2.3.14)
+ activesupport (= 2.3.14)
+ rake (>= 0.8.3)
+ rake (0.9.2.2)
+ rsolr (0.12.1)
+ builder (>= 2.1.2)
+ rspec (2.7.0)
+ rspec-core (~> 2.7.0)
+ rspec-expectations (~> 2.7.0)
+ rspec-mocks (~> 2.7.0)
+ rspec-core (2.7.1)
+ rspec-expectations (2.7.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.7.0)
+ rubyzip (0.9.5)
+ sunspot (1.1.0)
+ escape (= 0.0.4)
+ rsolr (= 0.12.1)
+ sunspot_rails (1.1.0)
+ sunspot (= 1.1.0)
+ uuidtools (1.0.4)
+ rake (>= 0.7.3)
+ rspec (>= 1.0.8)
+ whenever (0.4.1)
+ chronic (>= 0.2.3)
+ will_paginate (2.3.16)
+ xml-simple (1.1.1)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ aws-s3
+ delayed_job (< 2)
+ exceptional
+ fastercsv
+ formtastic (= 1.2.4)
+ grit
+ haml (~> 3.0.6)
+ libxml-ruby
+ libxslt-ruby (= 0.9.2)
+ mime-types
+ mysql
+ rails (= 2.3.14)
+ rsolr (= 0.12.1)
+ rubyzip
+ sunspot (= 1.1.0)
+ sunspot_rails (= 1.1.0)
+ uuidtools (= 1.0.4)
+ whenever (= 0.4.1)
+ will_paginate (~> 2.3.16)
View
@@ -110,5 +110,20 @@ def read_environment_rb
end
end
+# bundle support
+class Rails::Boot
+ def run
+ load_initializer
+
+ Rails::Initializer.class_eval do
+ def load_gems
+ @bundler_loaded ||= Bundler.require :default, Rails.env
+ end
+ end
+
+ Rails::Initializer.run(:set_load_path)
+ end
+end
+
# All that for this:
Rails.boot!
View
@@ -26,23 +26,8 @@
# Specify gems that this application depends on.
# They can then be installed with "rake gems:install" on new installations.
- config.gem 'haml', :version => '~> 3.0.6'
- config.gem 'libxml-ruby', :lib => 'libxml' #, :version => '0.8.0'
- config.gem 'libxslt-ruby', :lib => 'libxslt', :version => '0.9.2'
- config.gem 'rubyzip', :lib => 'zip/zip'
- config.gem 'mime-types', :lib => 'mime/types'
- config.gem 'uuidtools', :version => '1.0.4'
- config.gem 'mislav-will_paginate', :version => '~> 2.2.3', :lib => 'will_paginate', :source => 'http://gems.github.com'
- config.gem 'whenever', :version => "0.4.1", :lib => false
- config.gem 'rsolr', :version => '0.9.6' # NEWER VERSIONS ARE BUGGY!
- config.gem 'sunspot', :version => "1.1.0", :lib => 'sunspot'
- config.gem 'sunspot_rails', :version => "1.1.0", :lib => 'sunspot/rails'
- config.gem 'grit'
- config.gem 'aws-s3', :lib => 'aws/s3'
- config.gem 'delayed_job', :lib => 'delayed_job', :version => "<2"
- config.gem 'exceptional' if RAILS_ENV=='production'
- config.gem 'fastercsv'
- config.gem 'formtastic', :version => "1.2.4"
+
+ # Use Gemfile to specify gems and bundle install to install required gems
# Only load the plugins named here, in the order given. By default, all plugins
# in vendor/plugins are loaded in alphabetical order.
View
@@ -0,0 +1,20 @@
+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 bundler version is too old for Rails 2.3." +
+ "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

0 comments on commit 0ef7aef

Please sign in to comment.