# HG changeset patch
# User Toshi MARUYAMA
# Date 1307972866 -32400
# Branch bundler-20120201-1
# Node ID 6cc5c6c01ec57bdcba9780f320ea79a7a4301aa8
# Parent  e7461c50053a60d8fbf679f4b14a28b853b2ea2b
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,8 +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'
-
   # 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-20120201-1
# Node ID 5c28ca27409c512b8adcb68a6e39b389a221edae
# Parent  6cc5c6c01ec57bdcba9780f320ea79a7a4301aa8
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 Gregor Schmidt <ruby@schmidtwisser.de>
# Date 1300550638 -3600
# Branch bundler-20120201-1
# Node ID 1d55cbf3d8af0ef70f0bfb56015574ab2f55af78
# Parent  5c28ca27409c512b8adcb68a6e39b389a221edae
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 Gregor Schmidt <ruby@schmidtwisser.de>
# Date 1305009757 -7200
# Branch bundler-20120201-1
# Node ID d453cdb024dfc3f0762a8dc679617fd35887d1d9
# Parent  1d55cbf3d8af0ef70f0bfb56015574ab2f55af78
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
@@ -39,7 +39,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-20120201-1
# Node ID fa6f0919305a9977b048a43a06fdd2dcd1566d1b
# Parent  d453cdb024dfc3f0762a8dc679617fd35887d1d9
Gemfile: only print the plugin Gemfile messages when $DEBUG is set (#5638)

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -71,6 +71,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 1311368919 25200
# Branch bundler-20120201-1
# Node ID 11232ca4626ea5cd95deab07a7b83e5f729947ee
# Parent  fa6f0919305a9977b048a43a06fdd2dcd1566d1b
Gemfile: fix string encodings coming from sqlite3 in MRI 1.9.x (#5638)

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

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -32,29 +32,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-20120201-1
# Node ID 7b4a06407c23dc377bf0dc300ac6529e8108d51f
# Parent  3d43e70434b9e1570119785591c92b8496a0b550
Gemfile: read Gemfile.local for local gem inclusions (#5638)

Contributed by Holger Just

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -80,6 +80,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-20120201-1
# Node ID af58d96866f4c0330eb862133e60f5314755940d
# Parent  7b4a06407c23dc377bf0dc300ac6529e8108d51f
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-20120201-1
# Node ID 45bb4cf0963761f9fd804d8e14837bd9cd2c6590
# Parent  af58d96866f4c0330eb862133e60f5314755940d
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-20120201-1
# Node ID f8d6f877f627bed632277b196841a7526759ba4c
# Parent  45bb4cf0963761f9fd804d8e14837bd9cd2c6590
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
