Permalink
Browse files

Convert to use wycat's Bundler

Signed-off-by: Alex Coles <alex@alexcolesportfolio.com>
  • Loading branch information...
myabc committed Dec 15, 2009
1 parent ae8aa48 commit 330c9b87ccf6c549c1fa63b573036d35a5c70ba6
Showing with 38 additions and 13 deletions.
  1. +3 −0 .gitignore
  2. +16 −0 Gemfile
  3. +0 −13 config/environment.rb
  4. +19 −0 config/preinitializer.rb
View
@@ -10,3 +10,6 @@ config/database.yml
config/deploy.rb
config/deploy/*
config/exceptional.yml
+vendor/bundler_gems/*
+!vendor/bundler_gems/cache/
+bin/
View
16 Gemfile
@@ -0,0 +1,16 @@
+clear_sources
+bundle_path 'vendor/bundler_gems'
+
+source 'http://gemcutter.org'
+source 'http://gems.github.com'
+
+gem 'rails', '2.3.5'
+gem 'ferret', '0.11.6'
+gem 'will_paginate', '2.3.11'
+gem 'ruby-recaptcha', '1.0.0'
+gem 'newrelic_rpm'
+
+only :test do
+ gem 'rspec', '1.2.9'
+ gem 'rspec-rails', '1.2.9'
+end
View
@@ -16,19 +16,6 @@
# you must remove the Active Record framework.
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
- # Specify gems that this application depends on.
- # They can then be installed with "rake gems:install" on new installations.
- # You have to specify the :lib option for libraries, where the Gem name (sqlite3-ruby) differs from the file itself (sqlite3)
- # config.gem "bj"
- # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
- # config.gem "sqlite3-ruby", :lib => "sqlite3"
- # config.gem "aws-s3", :lib => "aws/s3"
-
- config.gem "ferret"
- config.gem "mislav-will_paginate", :lib => 'will_paginate', :source => 'http://gems.github.com/'
- config.gem "ruby-recaptcha", :lib => 'ruby-recaptcha'
- config.gem 'newrelic_rpm'
-
# Only load the plugins named here, in the order given. By default, all plugins
# in vendor/plugins are loaded in alphabetical order.
# :all can be used as a placeholder for all plugins not explicitly named
View
@@ -0,0 +1,19 @@
+require "#{File.dirname(__FILE__)}/../vendor/bundler_gems/environment"
+
+class Rails::Boot
+ def run
+ load_initializer
+ extend_environment
+ Rails::Initializer.run(:set_load_path)
+ end
+
+ def extend_environment
+ Rails::Initializer.class_eval do
+ old_load = instance_method(:load_environment)
+ define_method(:load_environment) do
+ Bundler.require_env RAILS_ENV
+ old_load.bind(self).call
+ end
+ end
+ end
+end

0 comments on commit 330c9b8

Please sign in to comment.