# HG changeset patch
# User Gregor Schmidt <ruby@schmidtwisser.de>
# Date 1308394982 -32400
# Node ID 97ce9e367b89521f9b64a55b4c9fec16b86462f7
# Parent  6698d18276549a55ce76c804fb4fb754ddfb65a1
add bundler generates files to .gitignore and .hgignore (#5638).

Contributed by Gregor Schmidt.

diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,7 @@
 /tmp/test/*
 /vendor/rails
 *.rbc
+
+/.bundle
+/Gemfile.lock
+
diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -25,5 +25,10 @@ tmp/sockets/*
 tmp/test/*
 vendor/rails
 *.rbc
+
 .svn/
 .git/
+
+.bundle
+Gemfile.lock
+
# HG changeset patch
# User Toshi MARUYAMA <marutosijp2@gmail.com>
# Date 1307972866 -32400
# Node ID 3d122df5dbdf0aa487d545901facc7b7002bb7f3
# Parent  97ce9e367b89521f9b64a55b4c9fec16b86462f7
using bundler (#5638).

Contributed by Etienne Massip.

diff --git a/Gemfile b/Gemfile
new file mode 100644
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,35 @@
+source :rubygems
+source :rubyforge
+source :gemcutter
+
+gem 'bundler', '~> 1.0.0'
+gem 'rails', '2.3.11'
+gem 'rack' , '~> 1.1.1'
+gem 'i18n', '>= 0.4.2'
+gem 'rubytree', '0.5.2', :require => 'tree'
+gem 'coderay', '~> 0.9.7'
+
+# Please uncomment lines for your databases.
+# Alternatively you may want to add these lines to specific groups below.
+# gem 'sqlite3-ruby', :require => 'sqlite3'  # for SQLite 3
+# gem 'mysql'                                #     MySQL
+# gem 'pg'                                   #     PostgreSQL
+gem 'pg'
+
+group :development do
+end
+
+group :production do
+end
+
+group :test do
+  gem 'shoulda'
+  gem 'mocha'
+  gem 'edavis10-object_daddy', :require => 'object_daddy'
+end
+
+# Load plugins Gemfiles
+Dir.glob(File.join(File.dirname(__FILE__), %w(vendor plugins * Gemfile))) do |file|
+  puts "Loading #{file} ..."
+  instance_eval File.read(file)
+end
diff --git a/config/boot.rb b/config/boot.rb
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -36,6 +36,13 @@ module Rails
   class 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
@@ -106,17 +113,5 @@ module Rails
   end
 end
 
-# TODO: Workaround for #7013 to be removed for 1.2.0
-# Loads i18n 0.4.2 before Rails loads any more recent gem
-# 0.5.0 is not compatible with the old interpolation syntax
-# Plugins will have to migrate to the new syntax for 1.2.0
-require 'rubygems'
-begin
-  gem 'i18n', '0.4.2'
-rescue Gem::LoadError => load_error
-  $stderr.puts %(Missing the i18n 0.4.2 gem. Please `gem install -v=0.4.2 i18n`)
-  exit 1
-end
-
 # All that for this:
 Rails.boot!
diff --git a/config/environment.rb b/config/environment.rb
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -49,9 +49,6 @@ Rails::Initializer.run do |config|
   # Define your email configuration in configuration.yml instead.
   # It will automatically turn deliveries on
   config.action_mailer.perform_deliveries = false
-
-  config.gem 'rubytree', :lib => 'tree'
-  config.gem 'coderay', :version => '~>0.9.7'
   
   # Load any local configuration that is kept out of source control
   # (e.g. gems, patches).
diff --git a/config/preinitializer.rb b/config/preinitializer.rb
new file mode 100644
--- /dev/null
+++ b/config/preinitializer.rb
@@ -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.25")
+  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
# HG changeset patch
# User Gregor Schmidt <ruby@schmidtwisser.de>
# Date 1300479945 -3600
# Node ID ee95872904b3137e567aa0bd0313ca5925b6a382
# Parent  ceaa9be9e419b1d1a5c7d7d4bc57a49d09e05679
update bundler files (#5638).

Contributed by Gregor Schmidt.

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -2,6 +2,7 @@ source :rubygems
 source :rubyforge
 source :gemcutter
 
+gem "ruby-openid"
 gem 'bundler', '~> 1.0.0'
 gem 'rails', '2.3.11'
 gem 'rack' , '~> 1.1.1'
@@ -9,13 +10,6 @@ gem 'i18n', '>= 0.4.2'
 gem 'rubytree', '0.5.2', :require => 'tree'
 gem 'coderay', '~> 0.9.7'
 
-# Please uncomment lines for your databases.
-# Alternatively you may want to add these lines to specific groups below.
-# gem 'sqlite3-ruby', :require => 'sqlite3'  # for SQLite 3
-# gem 'mysql'                                #     MySQL
-# gem 'pg'                                   #     PostgreSQL
-gem 'pg'
-
 group :development do
 end
 
@@ -23,11 +17,55 @@ group :production do
 end
 
 group :test do
-  gem 'shoulda'
+  gem 'shoulda', '~> 2.10.3'
   gem 'mocha'
   gem 'edavis10-object_daddy', :require => 'object_daddy'
 end
 
+
+# Use the commented pure ruby gems, if you have not the needed prerequisites on
+# board to compile the native ones.  Note, that their use is discouraged, since
+# their integration is propbably not that well tested and their are slower in
+# orders of magnitude compared to their native counterparts. You have been
+# warned.
+#
+platforms :mri do
+  group :mysql do
+    gem "mysql"
+    #   gem "ruby-mysql"
+  end
+
+  group :mysql2 do
+    gem "mysql2"
+  end
+
+  group :postgres do
+    gem "pg", "~> 0.9.0"
+    #   gem "postgres-pr"
+  end
+
+  group :sqlite do
+    gem "sqlite3-ruby", "< 1.3", :require => "sqlite3"
+    #   please tell me, if you are fond of a pure ruby sqlite3 binding
+  end
+end
+
+platforms :jruby do
+  gem "jruby-openssl"
+
+  group :mysql do
+    gem "activerecord-jdbcmysql-adapter"
+  end
+
+  group :postgres do
+    gem "activerecord-jdbcpostgresql-adapter"
+  end
+
+  group :sqlite do
+    gem "activerecord-jdbcsqlite3-adapter"
+  end
+end
+
 # Load plugins Gemfiles
 Dir.glob(File.join(File.dirname(__FILE__), %w(vendor plugins * Gemfile))) do |file|
   puts "Loading #{file} ..."
diff --git a/config/boot.rb b/config/boot.rb
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -37,6 +37,8 @@ module Rails
     def run
       load_initializer
 
+      # This block was added for bundler support while following setup
+      # instructions from http://gembundler.com/rails23.html
       Rails::Initializer.class_eval do
         def load_gems
           @bundler_loaded ||= Bundler.require :default, Rails.env
diff --git a/config/environments/test.rb b/config/environments/test.rb
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -23,7 +23,3 @@ config.action_controller.session = {
 
 # Skip protect_from_forgery in requests http://m.onkey.org/2007/9/28/csrf-protection-for-your-existing-rails-application
 config.action_controller.allow_forgery_protection  = false
-
-config.gem "shoulda", :version => "~> 2.10.3"
-config.gem "edavis10-object_daddy", :lib => "object_daddy"
-config.gem "mocha"
# HG changeset patch
# User Gregor Schmidt <ruby@schmidtwisser.de>
# Date 1300550638 -3600
# Node ID a7b992d8d2a6785ae48ede637cb41e5769482188
# Parent  ee95872904b3137e567aa0bd0313ca5925b6a382
making openid opt-out by adding it to a group (#5638).

Contributed by Gregor Schmidt.

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -2,7 +2,6 @@ source :rubygems
 source :rubyforge
 source :gemcutter
 
-gem "ruby-openid"
 gem 'bundler', '~> 1.0.0'
 gem 'rails', '2.3.11'
 gem 'rack' , '~> 1.1.1'
@@ -22,6 +21,9 @@ group :test do
   gem 'edavis10-object_daddy', :require => 'object_daddy'
 end
 
+group :openid do
+  gem "ruby-openid", '~> 2.1.4', :require => 'openid'
+end
 
 # Use the commented pure ruby gems, if you have not the needed prerequisites on
 # board to compile the native ones.  Note, that their use is discouraged, since
# HG changeset patch
# User Gregor Schmidt <ruby@schmidtwisser.de>
# Date 1300551149 -3600
# Node ID caa767395c9db8fce819aa5e8578c7cdb48219f3
# Parent  a7b992d8d2a6785ae48ede637cb41e5769482188
add rmagick, making it opt-out (#5638).

using version < 2.0 since later versions do not work w/o backports on Debian Lenny

Contributed by Gregor Schmidt.

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -25,6 +25,10 @@ group :openid do
   gem "ruby-openid", '~> 2.1.4', :require => 'openid'
 end
 
+group :rmagick do
+  gem "rmagick", "~> 1.15.17"
+end
+
 # Use the commented pure ruby gems, if you have not the needed prerequisites on
 # board to compile the native ones.  Note, that their use is discouraged, since
 # their integration is propbably not that well tested and their are slower in
# HG changeset patch
# User Gregor Schmidt <ruby@schmidtwisser.de>
# Date 1305009757 -7200
# Node ID 4f74c3442b99f6f7cc2498b1d30a6dd83a687cda
# Parent  caa767395c9db8fce819aa5e8578c7cdb48219f3
Pinning mysql2 gem to 0.2 branch, since 0.3 and the following are Rails 3 only (#5638).

Contributed by Gregor Schmidt.

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -42,7 +42,7 @@ platforms :mri do
   end
 
   group :mysql2 do
-    gem "mysql2"
+    gem "mysql2", "~> 0.2.7"
   end
 
   group :postgres do
# HG changeset patch
# User Eric Davis <edavis@littlestreamsoftware.com>
# Date 1305303449 25200
# Node ID f06c3b7f849ee802795d96828ae2b57f5dd06832
# Parent  4f74c3442b99f6f7cc2498b1d30a6dd83a687cda
Only print the plugin Gemfile messages when $DEBUG is set (#5638).

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -74,6 +74,6 @@ end
 
 # Load plugins Gemfiles
 Dir.glob(File.join(File.dirname(__FILE__), %w(vendor plugins * Gemfile))) do |file|
-  puts "Loading #{file} ..."
+  puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
   instance_eval File.read(file)
 end
