Permalink
Browse files

upgrade to Bundler and Rails 2.3.8

  • Loading branch information...
1 parent 7f205c8 commit a6ef931dd7c3ae8acfd5f168412af220756c81cf @mislav committed Jun 22, 2010
Showing with 202 additions and 115 deletions.
  1. +2 −1 .gitignore
  2. +29 −0 Gemfile
  3. +139 −0 Gemfile.lock
  4. +20 −101 config/boot.rb
  5. +4 −8 config/environment.rb
  6. +8 −5 test/test_helper.rb
View
@@ -1 +1,2 @@
-tmp/**/*
+.bundle
+/tmp
View
29 Gemfile
@@ -0,0 +1,29 @@
+source :gemcutter
+
+group :rails do
+ gem 'rails', '~> 2.3.5', :require => nil
+ gem 'builder', '~> 2.1.2'
+ gem 'memcache-client', '>= 1.7.4', :require => nil
+ gem 'tzinfo', '~> 0.3.12'
+ gem 'i18n', '>= 0.1.3'
+ gem 'tmail', '~> 1.2.3'
+ gem 'text-format', '>= 0.6.3', :require => 'text/format'
+end
+
+gem 'ya2yaml', '~> 0.29.2'
+
+group :plugins do
+ gem 'will_paginate', '~> 2.3.14'
+end
+
+group :development do
+ gem 'sqlite3-ruby', '~> 1.2.5', :require => nil
+ gem 'ruby-debug', '~> 0.10.3', :require => nil
+ gem 'mongrel', '~> 1.1.5', :require => nil
+end
+
+# we don't call the group :test because we don't want them auto-required
+group :test do
+ gem 'webrat', '~> 0.7.1'
+ gem 'mocha', '~> 0.9.8', :require => nil
+end
View
@@ -0,0 +1,139 @@
+---
+dependencies:
+ tzinfo:
+ group:
+ - :rails
+ version: ~> 0.3.12
+ ruby-debug:
+ group:
+ - :development
+ version: ~> 0.10.3
+ require: []
+
+ mongrel:
+ group:
+ - :development
+ version: ~> 1.1.5
+ require: []
+
+ rails:
+ group:
+ - :rails
+ version: ~> 2.3.5
+ require: []
+
+ text-format:
+ group:
+ - :rails
+ version: ">= 0.6.3"
+ require:
+ - text/format
+ sqlite3-ruby:
+ group:
+ - :development
+ version: ~> 1.2.5
+ require: []
+
+ memcache-client:
+ group:
+ - :rails
+ version: ">= 1.7.4"
+ require: []
+
+ tmail:
+ group:
+ - :rails
+ version: ~> 1.2.3
+ mocha:
+ group:
+ - :test
+ version: ~> 0.9.8
+ require: []
+
+ ya2yaml:
+ group:
+ - :default
+ version: ~> 0.29.2
+ will_paginate:
+ group:
+ - :plugins
+ version: ~> 2.3.14
+ webrat:
+ group:
+ - :test
+ version: ~> 0.7.1
+ i18n:
+ group:
+ - :rails
+ version: ">= 0.1.3"
+ builder:
+ group:
+ - :rails
+ version: ~> 2.1.2
+specs:
+- rake:
+ version: 0.8.7
+- activesupport:
+ version: 2.3.8
+- rack:
+ version: 1.1.0
+- actionpack:
+ version: 2.3.8
+- actionmailer:
+ version: 2.3.8
+- activerecord:
+ version: 2.3.8
+- activeresource:
+ version: 2.3.8
+- builder:
+ version: 2.1.2
+- cgi_multipart_eof_fix:
+ version: 2.5.0
+- columnize:
+ version: 0.3.1
+- daemons:
+ version: 1.1.0
+- fastthread:
+ version: 1.0.7
+- gem_plugin:
+ version: 0.2.3
+- i18n:
+ version: 0.4.1
+- linecache:
+ version: "0.43"
+- memcache-client:
+ version: 1.8.3
+- mocha:
+ version: 0.9.8
+- mongrel:
+ version: 1.1.5
+- nokogiri:
+ version: 1.4.2
+- rack-test:
+ version: 0.5.4
+- rails:
+ version: 2.3.8
+- ruby-debug-base:
+ version: 0.10.3
+- ruby-debug:
+ version: 0.10.3
+- sqlite3-ruby:
+ version: 1.2.5
+- text-hyphen:
+ version: 1.0.0
+- text-format:
+ version: 1.0.0
+- tmail:
+ version: 1.2.7.1
+- tzinfo:
+ version: 0.3.22
+- webrat:
+ version: 0.7.1
+- will_paginate:
+ version: 2.3.14
+- ya2yaml:
+ version: 0.29.2
+hash: 08118fd2c9c76a058ba279a820fb3e2d123ee289
+sources:
+- Rubygems:
+ uri: http://gemcutter.org
View
@@ -1,109 +1,28 @@
-# Don't change this file!
-# Configure your app in config/environment.rb and config/environments/*.rb
-
-RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
+begin
+ # Try to require the preresolved locked set of gems.
+ require File.expand_path('../../.bundle/environment', __FILE__)
+rescue LoadError
+ # Fall back on doing an unlocked resolve at runtime.
+ require 'rubygems'
+ require 'bundler'
+ Bundler.setup
+end
module Rails
- class << self
- def boot!
- unless booted?
- preinitialize
- pick_boot.run
- end
- end
-
- def booted?
- defined? Rails::Initializer
- end
-
- def pick_boot
- (vendor_rails? ? VendorBoot : GemBoot).new
- end
-
- def vendor_rails?
- File.exist?("#{RAILS_ROOT}/vendor/rails")
- end
-
- def preinitialize
- load(preinitializer_path) if File.exist?(preinitializer_path)
- end
-
- def preinitializer_path
- "#{RAILS_ROOT}/config/preinitializer.rb"
- end
- end
-
- class Boot
- def run
- load_initializer
- Rails::Initializer.run(:set_load_path)
- end
- end
-
- class VendorBoot < Boot
- def load_initializer
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- Rails::Initializer.run(:install_gem_spec_stubs)
- end
- end
-
- class GemBoot < Boot
- def load_initializer
- self.class.load_rubygems
- load_rails_gem
- require 'initializer'
- end
-
- def load_rails_gem
- if version = self.class.gem_version
- gem 'rails', version
- else
- gem 'rails'
- end
- rescue Gem::LoadError => load_error
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
- exit 1
- end
-
- class << self
- def rubygems_version
- Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
- end
-
- def gem_version
- if defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION
- elsif ENV.include?('RAILS_GEM_VERSION')
- ENV['RAILS_GEM_VERSION']
- else
- parse_gem_version(read_environment_rb)
- end
- end
-
- def load_rubygems
- require 'rubygems'
- min_version = '1.1.1'
- unless rubygems_version >= min_version
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
- exit 1
- end
+ # so Rails doesn't think we have an "outdated" boot.rb file
+ def self.vendor_rails?() false end
+end
- rescue LoadError
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
- exit 1
- end
+RAILS_ROOT = File.expand_path('../..', __FILE__) unless defined?(RAILS_ROOT)
- def parse_gem_version(text)
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
- end
+require 'initializer'
- private
- def read_environment_rb
- File.read("#{RAILS_ROOT}/config/environment.rb")
- end
- end
+Rails::Initializer.class_eval do
+ alias old_load_gems load_gems
+ # require gems that are Rails plugins
+ def load_gems
+ Bundler.require(:plugins)
end
end
-# All that for this:
-Rails.boot!
+Rails::Initializer.run(:set_load_path)
View
@@ -1,16 +1,12 @@
-RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
+require File.expand_path('../boot', __FILE__)
-# Bootstrap the Rails environment, frameworks, and default configuration
-require File.join(File.dirname(__FILE__), 'boot')
+Bundler.require(:default, RAILS_ENV)
Rails::Initializer.run do |config|
config.time_zone = 'UTC'
config.action_controller.session = {
- :session_key => '_tolk_session',
- :secret => 'f2d72b63242db79df080031c60159a419981cc6c066e961405c1a86c5c38ba56c960d6de171dc4cf985f1544c00466400abf0aac2ce1cbdb726f6127d304fb07'
+ :key => '_tolk_session',
+ :secret => 'f2d72b63242db79df080031c60159a419981cc6c066e961405c1a86c5c38ba56c960d6de171dc4cf985f1544c00466400abf0aac2ce1cbdb726f6127d304fb07'
}
end
-
-$KCODE = 'UTF8'
-require 'ya2yaml'
View
@@ -1,8 +1,7 @@
-ENV["RAILS_ENV"] = "test"
-require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
+ENV["RAILS_ENV"] ||= "test"
+require File.expand_path('../../config/environment', __FILE__)
require 'test_help'
-
-require "webrat"
+require 'mocha'
Webrat.configure do |config|
config.mode = :rails
@@ -18,5 +17,9 @@ class ActiveSupport::TestCase
fixtures :all
- self.fixture_class_names = {:tolk_locales => 'Tolk::Locale', :tolk_phrases => 'Tolk::Phrase', :tolk_translations => 'Tolk::Translation'}
+ self.fixture_class_names = {
+ :tolk_locales => 'Tolk::Locale',
+ :tolk_phrases => 'Tolk::Phrase',
+ :tolk_translations => 'Tolk::Translation'
+ }
end

0 comments on commit a6ef931

Please sign in to comment.