Permalink
Browse files

All unit tests now run in Rails 2.3.2.

  • Loading branch information...
1 parent 2b03f39 commit 1cb95550a475ef87331048a38f211b8c19501710 bguthrie committed May 11, 2009
Showing 1,010 changed files with 55,967 additions and 87,728 deletions.
@@ -1,11 +0,0 @@
-# Filters added to this controller apply to all controllers in the application.
-# Likewise, all the methods added will be available for all controllers.
-
-class ApplicationController < ActionController::Base
- session :off
-
- def render_not_found
- render :file => File.join(RAILS_ROOT, 'public/404.html'), :status => 404
- end
-
-end
View
@@ -1,5 +1,3 @@
-require 'fileutils'
-
class Project
@@plugin_names = []
@@ -243,7 +241,7 @@ def request_build
if builder_state_and_activity == 'builder_down'
BuilderStarter.begin_builder(name)
10.times do
- sleep 1.second
+ sleep 1.second.to_i
break if builder_state_and_activity != 'builder_down'
end
end
View
@@ -1,76 +1,110 @@
-# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
-
-require 'rbconfig'
-
-def find_home
- looks_like_windows = (Config::CONFIG["target_os"] =~ /32/)
-
- home =
- if ENV['HOME']
- ENV['HOME']
- elsif ENV['USERPROFILE']
- ENV['USERPROFILE'].gsub('\\', '/')
- elsif ENV['HOMEDRIVE'] && ENV['HOMEPATH']
- "#{ENV['HOMEDRIVE']}:#{ENV['HOMEPATH']}".gsub('\\', '/')
- else
- begin
- File.expand_path("~")
- rescue StandardError => ex
- looks_like_windows ? "C:/" : "/"
+# 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)
+
+module Rails
+ class << self
+ def boot!
+ unless booted?
+ preinitialize
+ pick_boot.run
end
end
- home
-end
-unless defined?(RAILS_ROOT)
- root_path = File.join(File.dirname(__FILE__), '..')
+ def booted?
+ defined? Rails::Initializer
+ end
- unless RUBY_PLATFORM =~ /mswin32/
- require 'pathname'
- root_path = Pathname.new(root_path).cleanpath(true).to_s
- end
+ def pick_boot
+ (vendor_rails? ? VendorBoot : GemBoot).new
+ end
- RAILS_ROOT = root_path
-end
+ def vendor_rails?
+ File.exist?("#{RAILS_ROOT}/vendor/rails")
+ end
-unless defined? CRUISE_DATA_ROOT
- if ENV['CRUISE_DATA_ROOT']
- CRUISE_DATA_ROOT = ENV['CRUISE_DATA_ROOT']
- else
- CRUISE_DATA_ROOT = File.join(find_home, ".cruise")
+ def preinitialize
+ load(preinitializer_path) if File.exist?(preinitializer_path)
+ end
+
+ def preinitializer_path
+ "#{RAILS_ROOT}/config/preinitializer.rb"
+ end
end
- puts "cruise data root = '#{CRUISE_DATA_ROOT}'"
-end
-unless defined?(Rails::Initializer)
- if File.directory?("#{RAILS_ROOT}/vendor/rails")
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- else
- require 'rubygems'
+ class Boot
+ def run
+ load_initializer
+ Rails::Initializer.run(:set_load_path)
+ end
+ end
- environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join
- environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/
- rails_gem_version = $1
+ class VendorBoot < Boot
+ def load_initializer
+ require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
+ Rails::Initializer.run(:install_gem_spec_stubs)
+ Rails::GemDependency.add_frozen_gem_path
+ end
+ end
- if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
- # Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems
- rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last
+ class GemBoot < Boot
+ def load_initializer
+ self.class.load_rubygems
+ load_rails_gem
+ require 'initializer'
+ end
- if rails_gem
- require_gem "rails", "=#{rails_gem.version.version}"
- require rails_gem.full_gem_path + '/lib/initializer'
+ def load_rails_gem
+ if version = self.class.gem_version
+ gem 'rails', version
else
- STDERR.puts %(Cannot find gem for Rails ~>#{version}.0:
- Install the missing gem with 'gem install -v=#{version} rails', or
- change environment.rb to define RAILS_GEM_VERSION with your desired version.
- )
+ 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 rescue nil
+ 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.3.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
+
+ rescue LoadError
+ $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
exit 1
end
- else
- require_gem "rails"
- require 'initializer'
+
+ def parse_gem_version(text)
+ $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
+ end
+
+ private
+ def read_environment_rb
+ File.read("#{RAILS_ROOT}/config/environment.rb")
+ end
end
end
+end
- Rails::Initializer.run(:set_load_path)
-end
+# All that for this:
+Rails.boot!
View
@@ -6,39 +6,68 @@
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
ABSOLUTE_RAILS_ROOT = File.expand_path(RAILS_ROOT) unless defined? ABSOLUTE_RAILS_ROOT
Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here
+ config.gem "xml-simple", :lib => "xmlsimple"
+ config.gem "mocha"
+ config.gem "rcov"
+
+ def find_home
+ looks_like_windows = (Config::CONFIG["target_os"] =~ /32/)
+
+ if ENV['HOME']
+ ENV['HOME']
+ elsif ENV['USERPROFILE']
+ ENV['USERPROFILE'].gsub('\\', '/')
+ elsif ENV['HOMEDRIVE'] && ENV['HOMEPATH']
+ "#{ENV['HOMEDRIVE']}:#{ENV['HOMEPATH']}".gsub('\\', '/')
+ else
+ begin
+ File.expand_path("~")
+ rescue StandardError => ex
+ looks_like_windows ? "C:/" : "/"
+ end
+ end
+ end
-
- module ActiveRecord
- # just so that WhinyNil doesn't complain about const missing
- class Base
- # and just so that ActiveRecordStore can load (even though we dont use it either
- def self.before_save(*args) end
- # and just so controller generator can do its stuff
- def self.pluralize_table_names() true; end
- # and just so that Dispatcher#reset_application works
- def self.reset_subclasses() end
- # and just so that Dispatcher#prepare_application works
- def self.verify_active_connections!() end
- # and just so that Dispatcher#reset_application! works so Webrick (unlike Mongrel) stops bombing out
- def self.clear_reloadable_connections!() end
- # and just so that benchmarking's render() works
- def self.connected?() false; end
- # and just so that Initializer#load_observers works
- def self.instantiate_observers; end
+ unless defined? CRUISE_DATA_ROOT
+ if ENV['CRUISE_DATA_ROOT']
+ CRUISE_DATA_ROOT = ENV['CRUISE_DATA_ROOT']
+ else
+ CRUISE_DATA_ROOT = File.join(find_home, ".cruise")
end
+ puts "cruise data root = '#{CRUISE_DATA_ROOT}'"
end
+ # module ActiveRecord
+ # # just so that WhinyNil doesn't complain about const missing
+ # class Base
+ # # and just so that ActiveRecordStore can load (even though we dont use it either
+ # def self.before_save(*args) end
+ # # and just so controller generator can do its stuff
+ # def self.pluralize_table_names() true; end
+ # # and just so that Dispatcher#reset_application works
+ # def self.reset_subclasses() end
+ # # and just so that Dispatcher#prepare_application works
+ # def self.verify_active_connections!() end
+ # # and just so that Dispatcher#reset_application! works so Webrick (unlike Mongrel) stops bombing out
+ # def self.clear_reloadable_connections!() end
+ # # and just so that benchmarking's render() works
+ # def self.connected?() false; end
+ # # and just so that Initializer#load_observers works
+ # def self.instantiate_observers; end
+ # end
+ # end
+
# Skip frameworks you're not going to use (only works if using vendor/rails)
- config.frameworks -= [ :active_record, :action_web_service ]
+ config.frameworks -= [ :active_record, :active_resource ]
# Only load the plugins named here, by default all plugins in vendor/plugins are loaded
# config.plugins = %W( exception_notification ssl_requirement )
@@ -58,6 +87,8 @@ def self.instantiate_observers; end
require 'cruise_control/version'
require 'smtp_tls'
+require 'date'
+require 'fileutils'
# custom MIME type for CCTray application
Mime::Type.register "application/cctray", :cctray
@@ -9,20 +9,18 @@
config.whiny_nils = true
# Enable the breakpoint server that script/breakpointer connects to
-config.breakpoint_server = true
# Show full error reports and disable caching
config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching = false
-config.action_view.cache_template_extensions = false
config.action_view.debug_rjs = true
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
CruiseControl::Log.verbose = true
-require 'configuration'
+require RAILS_ROOT + '/config/configuration'
config.after_initialize do
require CRUISE_DATA_ROOT + '/site_config' if File.exists?(CRUISE_DATA_ROOT + "/site_config.rb")
@@ -17,7 +17,7 @@
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
-require 'configuration'
+require RAILS_ROOT + '/config/configuration'
ProjectsMigration.new.migrate_data_if_needed
@@ -18,4 +18,4 @@
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
-require 'configuration'
+require RAILS_ROOT + '/config/configuration'
@@ -1,5 +1,3 @@
-require 'xml_simple'
-
module SourceControl
class Subversion
@@ -1,6 +1,3 @@
-require 'date'
-require 'xml_simple'
-
module SourceControl
class Subversion
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -1,15 +1,2 @@
// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
-
-function toggle_section(section) {
- if (section.className == "section_open")
- section.className = "section_closed"
- else
- section.className = "section_open"
-}
-
-function disableBuildNowButton(button) {
- button.className='build_button_disabled';
- button.disabled = true;
-}
-
Oops, something went wrong.

0 comments on commit 1cb9555

Please sign in to comment.