Skip to content

Commit

Permalink
Switched to bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
mlainez committed Mar 26, 2011
1 parent 769dcae commit 57ea5b9
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ coverage.data
config/database.yml
config/options.yml
public/system
public/stylesheets/*.css
public/stylesheets/*.css
.rvmrc
16 changes: 16 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
source :rubygems

gem "rails", "2.3.8"
gem "sqlite3-ruby"
gem "haml"
gem "authlogic"
gem "paperclip"
gem "mysql"

# erubis required by rails_xss
gem "erubis"

group :test do
gem "shoulda", "2.10.3"
gem "factory_girl", "1.3.3"
end
51 changes: 51 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
GEM
remote: http://rubygems.org/
specs:
abstract (1.0.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)
authlogic (2.1.6)
activesupport
erubis (2.6.6)
abstract (>= 1.0.0)
factory_girl (1.3.3)
haml (3.0.25)
mysql (2.8.1)
paperclip (2.3.8)
activerecord
activesupport
rack (1.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)
shoulda (2.10.3)
sqlite3 (1.3.3)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)

PLATFORMS
ruby

DEPENDENCIES
authlogic
erubis
factory_girl (= 1.3.3)
haml
mysql
paperclip
rails (= 2.3.8)
shoulda (= 2.10.3)
sqlite3-ruby
14 changes: 14 additions & 0 deletions config/boot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,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, Rails.env
end
end

Rails::Initializer.run(:set_load_path)
end
end

# All that for this:
Rails.boot!
7 changes: 0 additions & 7 deletions config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
# 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 'haml'
config.gem 'authlogic'
config.gem "thoughtbot-paperclip", :lib => "paperclip", :source => "http://gems.github.com"

# erubis required by rails_xss
config.gem "erubis"

# Only load the plugins named here, in the order given. By default, all plugins
# in vendor/plugins are loaded in alphabetical order.
Expand Down
6 changes: 1 addition & 5 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test

config.gem "thoughtbot-shoulda", :lib => "shoulda", :source => "http://gems.github.com"
config.gem "thoughtbot-factory_girl", :lib => "factory_girl", :source => "http://gems.github.com"
# config.gem 'metric_fu', :lib => 'metric_fu'
config.action_mailer.delivery_method = :test
20 changes: 20 additions & 0 deletions config/preinitializer.rb
Original file line number Diff line number Diff line change
@@ -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 57ea5b9

Please sign in to comment.