# HG changeset patch
# User Toshi MARUYAMA
# Date 1307972866 -32400
# Branch bundler-20111019-1
# Node ID 1dda19e4bdeb01035d1e42b769540424bc1cae0b
# Parent  82e018612154b7f0b46a35ccf2451a37e7a0d52c
bundler: use bundler (#5638)

Contributed by Etienne Massip.

diff --git a/Gemfile b/Gemfile
new file mode 100644
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,36 @@
+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'
+gem 'coderay'
+
+# 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
@@ -41,6 +41,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
@@ -111,17 +118,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
@@ -54,9 +54,6 @@ Rails::Initializer.run do |config|
   # It will automatically turn deliveries on
   config.action_mailer.perform_deliveries = false
 
-  config.gem 'rubytree', :lib => 'tree'
-  config.gem 'coderay', :version => '~>1.0.0'
-
   # Load any local configuration that is kept out of source control
   # (e.g. gems, patches).
   if File.exists?(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
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
# Branch bundler-20111019-1
# Node ID fdbd24267cd8775eca2de96ce2634775a87951ac
# Parent  1dda19e4bdeb01035d1e42b769540424bc1cae0b
bundler: 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'
@@ -10,13 +11,6 @@ gem 'rubytree', '0.5.2', :require => 'tr
 # gem 'coderay', '~> 0.9.7'
 gem 'coderay'
 
-# 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
 
@@ -24,11 +18,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
@@ -42,6 +42,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
# Branch bundler-20111019-1
# Node ID 75461f2b28180ba03b994cf1df5953feaf722ba5
# Parent  fdbd24267cd8775eca2de96ce2634775a87951ac
Gemfile: 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'
@@ -23,6 +22,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
# Branch bundler-20111019-1
# Node ID b3055bf0e12d0a466e9c8aa6200e56cb66ad8943
# Parent  75461f2b28180ba03b994cf1df5953feaf722ba5
Gemfile: 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
@@ -26,6 +26,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 Toshi MARUYAMA
# Date 1314534898 -32400
# Branch bundler-20111019-1
# Node ID 08728925aa30cf50b6a43b02a3d714a2d02091a0
# Parent  b3055bf0e12d0a466e9c8aa6200e56cb66ad8943
Gemfile: use rmagick on only Linux Ruby 1.8 (mri_18) (#5638)

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -27,7 +27,11 @@ group :openid do
 end
 
 group :rmagick do
-  gem "rmagick", "~> 1.15.17"
+  platforms :mri_18 do gem "rmagick", "~> 1.15.17" end
+  ## You cannot specify the same gem twice with different version requirements.
+  ## You specified: rmagick (~> 1.15.17) and rmagick (>= 0)
+  ## https://github.com/carlhuda/bundler/issues/751
+  # platforms :mri_19 do gem "rmagick" end
 end
 
 # Use the commented pure ruby gems, if you have not the needed prerequisites on
# HG changeset patch
# User Gregor Schmidt <ruby@schmidtwisser.de>
# Date 1305009757 -7200
# Branch bundler-20111019-1
# Node ID a3e6429338fcfa2cfdd5e3b4d31989a8e364d588
# Parent  08728925aa30cf50b6a43b02a3d714a2d02091a0
Gemfile: 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
@@ -47,7 +47,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
# Branch bundler-20111019-1
# Node ID 94a7c13f3089c59ce5e91122cfbb36920e8f30a5
# Parent  a3e6429338fcfa2cfdd5e3b4d31989a8e364d588
Gemfile: only print the plugin Gemfile messages when $DEBUG is set (#5638)

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -79,6 +79,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
# HG changeset patch
# User Holger Just <h.just@finn.de>
# Date 1311621777 -7200
# Branch bundler-20111019-1
# Node ID 33a25c5f55b71fddf6a9792f4f55cabb212bff75
# Parent  94a7c13f3089c59ce5e91122cfbb36920e8f30a5
Gemfile: add ruby-debug as test dependency to debug failing tests (#5638)

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -20,6 +20,10 @@ group :test do
   gem 'shoulda', '~> 2.10.3'
   gem 'mocha'
   gem 'edavis10-object_daddy', :require => 'object_daddy'
+
+  # cannot install on mingw due to fail installing linecache with native extensions
+  platforms :mri_18 do gem 'ruby-debug' end
+  platforms :mri_19 do gem 'ruby-debug19', :require => 'ruby-debug' end
 end
 
 group :openid do
# HG changeset patch
# User Eric Davis <edavis@littlestreamsoftware.com>
# Date 1311368919 25200
# Branch bundler-20111019-1
# Node ID 773b05fb4cc41d396c4bfb6d55d17971839eef69
# Parent  33a25c5f55b71fddf6a9792f4f55cabb212bff75
Gemfile: fix string encodings coming from sqlite3 in MRI 1.9.x (#5638)

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -58,10 +58,17 @@ platforms :mri do
     gem "pg", "~> 0.9.0"
     #   gem "postgres-pr"
   end
+end
 
+platforms :mri_18 do
   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 :mri_19 do
+  group :sqlite do
+    gem "sqlite3"
   end
 end
 
# HG changeset patch
# User Toshi MARUYAMA
# Date 1318939050 -32400
# Branch bundler-20111019-1
# Node ID 079b4a35ad628731c6988dc4bb2d350949d9867c
# Parent  773b05fb4cc41d396c4bfb6d55d17971839eef69
Gemfile: add database gems for mingw (Ruby on Windows) (#5638)

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -44,29 +44,33 @@ end
 # orders of magnitude compared to their native counterparts. You have been
 # warned.
 #
-platforms :mri do
+platforms :mri, :mingw do
   group :mysql do
     gem "mysql"
     #   gem "ruby-mysql"
   end
 
-  group :mysql2 do
-    gem "mysql2", "~> 0.2.7"
-  end
-
   group :postgres do
     gem "pg", "~> 0.9.0"
     #   gem "postgres-pr"
   end
 end
 
-platforms :mri_18 do
+platforms :mri_18, :mingw_18 do
   group :sqlite do
     gem "sqlite3-ruby", "< 1.3", :require => "sqlite3"
   end
 end
 
 platforms :mri_19 do
+  ## Add Windows support
+  ## https://github.com/brianmario/mysql2/issues/8
+  ## Getting mysql2 gem to work with Ruby on Rails 3.0 and Windows 7 64bit
+  ## http://paul-wong-jr.blogspot.com/2011/06/getting-mysql2-gem-to-work-with-ruby-on.html
+  group :mysql2 do
+    gem "mysql2", "~> 0.2.7"
+  end
+
   group :sqlite do
     gem "sqlite3"
   end
# HG changeset patch
# User Eric Davis <edavis@littlestreamsoftware.com>
# Date 1311370988 25200
# Branch bundler-20111019-1
# Node ID e12c669a872e3009edbb7375500e80adf2e53119
# Parent  079b4a35ad628731c6988dc4bb2d350949d9867c
Gemfile: read Gemfile.local for local gem inclusions (#5638)

Contributed by Holger Just

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -92,6 +92,13 @@ platforms :jruby do
   end
 end
 
+# Load a "local" Gemfile
+gemfile_local = File.join(File.dirname(__FILE__), "Gemfile.local")
+if File.readable?(gemfile_local)
+  puts "Loading #{gemfile_local} ..." if $DEBUG
+  instance_eval(File.read(gemfile_local))
+end
+
 # Load plugins Gemfiles
 Dir.glob(File.join(File.dirname(__FILE__), %w(vendor plugins * Gemfile))) do |file|
   puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
# HG changeset patch
# User Toshi MARUYAMA
# Date 1314188679 -32400
# Branch bundler-20111019-1
# Node ID 15955d4bf007121c9816a1ff03578cb9f02cc185
# Parent  e12c669a872e3009edbb7375500e80adf2e53119
Gemfile: add fastercsv (#5638)

Contributed by Felix Schäfer.

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -10,6 +10,8 @@ gem 'rubytree', '0.5.2', :require => 'tr
 # gem 'coderay', '~> 0.9.7'
 gem 'coderay'
 
+gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :jruby, :mingw_18]
+
 group :development do
 end
 
