# HG changeset patch
# User Toshi MARUYAMA
# Date 1307972866 -32400
# Branch bundler-20120203-3
# Node ID 8ae1f03ed8e81e556190506098662a351b69b38c
# Parent  1d59184d21699b2d7ce5b9c63c9674e9d42a54a8
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.14'
+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
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 'coderay', :version => '~>1.0.0'
-  config.gem 'net-ldap', :version => '~>0.2.2'
-
   # 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-20120203-3
# Node ID f33bec4584625c8c4e568198cd059d2b30a8c3c0
# Parent  8ae1f03ed8e81e556190506098662a351b69b38c
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.14'
 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 Eric Davis <edavis@littlestreamsoftware.com>
# Date 1305303449 25200
# Branch bundler-20120203-3
# Node ID 70ae1a8ad9cfcf7ca73617b9dac37d5e17832d13
# Parent  f33bec4584625c8c4e568198cd059d2b30a8c3c0
Gemfile: only print the plugin Gemfile messages when $DEBUG is set (#5638)

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -69,6 +69,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 Eric Davis <edavis@littlestreamsoftware.com>
# Date 1311370988 25200
# Branch bundler-20120203-3
# Node ID 1d2d674cf5d93810e3676b11bdf8462b1f389c5f
# Parent  70ae1a8ad9cfcf7ca73617b9dac37d5e17832d13
Gemfile: read Gemfile.local for local gem inclusions (#5638)

Contributed by Holger Just

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -67,6 +67,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 Gregor Schmidt <ruby@schmidtwisser.de>
# Date 1305009757 -7200
# Branch bundler-20120203-3
# Node ID 8272ccae63121e012bfee292cdbb5861cbb724f2
# Parent  1d2d674cf5d93810e3676b11bdf8462b1f389c5f
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
@@ -37,7 +37,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 1311368919 25200
# Branch bundler-20120203-3
# Node ID a14245ea7c95b1011e6fad3da55512d7fb290dc6
# Parent  8272ccae63121e012bfee292cdbb5861cbb724f2
Gemfile: fix string encodings coming from sqlite3 in MRI 1.9.x (#5638)

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -44,10 +44,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-20120203-3
# Node ID 1b0fcb80c042d2958d4fea8f0fc5667da0afa9d2
# Parent  a14245ea7c95b1011e6fad3da55512d7fb290dc6
Gemfile: add database gems for mingw (Ruby on Windows) (#5638)

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -30,29 +30,35 @@ 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
+end
+
+platforms :mri_19, :mingw_19 do
   group :sqlite do
     gem "sqlite3"
   end
# HG changeset patch
# User Gregor Schmidt <ruby@schmidtwisser.de>
# Date 1300550638 -3600
# Branch bundler-20120203-3
# Node ID 1e21552e6f3744119f4abb389ce8e0d569a1de77
# Parent  1b0fcb80c042d2958d4fea8f0fc5667da0afa9d2
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.14'
 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 Toshi MARUYAMA
# Date 1314188679 -32400
# Branch bundler-20120203-3
# Node ID 320c84d3d42784d582c2c2d3b6ea1dbc477830a5
# Parent  1e21552e6f3744119f4abb389ce8e0d569a1de77
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
 
# HG changeset patch
# User Gregor Schmidt <ruby@schmidtwisser.de>
# Date 1300551149 -3600
# Branch bundler-20120203-3
# Node ID 4ed4e5d4a7249f8eb3906da712c9824995fe5b84
# Parent  320c84d3d42784d582c2c2d3b6ea1dbc477830a5
Gemfile: add rmagick, making it opt-out on only Linux Ruby 1.8 (mri_18) and JRuby (#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
@@ -28,6 +28,17 @@ group :openid do
   gem "ruby-openid", '~> 2.1.4', :require => 'openid'
 end
 
+group :rmagick do
+  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
+
+  platforms :jruby do gem "rmagick4j" end
+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 Felix Schäfer <felix@fachschaften.org>
# Date 1322250863 -3600
# Branch bundler-20120203-3
# Node ID f49e9d1df2070b15bec7dba79530984cc4cd37f7
# Parent  4ed4e5d4a7249f8eb3906da712c9824995fe5b84
Gemfile: add net-ldap (#5638)

Contributed by Felix Schäfer.

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -24,6 +24,10 @@ group :test do
   gem 'edavis10-object_daddy', :require => 'object_daddy'
 end
 
+group :ldap do
+  gem "net-ldap", '~> 0.2.2'
+end
+
 group :openid do
   gem "ruby-openid", '~> 2.1.4', :require => 'openid'
 end
