diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-02 10:25:18 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-02 10:25:18 +0200 |
commit | 1c265da1db934ffab0a5151dc7beeed3ef1bbabb (patch) | |
tree | e3e2af724e0fe70b9bceb09a26a179fadf76b992 /railties | |
parent | 4739f0ff5d5c013eb33aed7f371a3a91d3fca292 (diff) | |
parent | 8bb510f6c1e235f5fb1cf9e79af759a429a497b0 (diff) | |
download | rails-1c265da1db934ffab0a5151dc7beeed3ef1bbabb.tar.gz rails-1c265da1db934ffab0a5151dc7beeed3ef1bbabb.tar.bz2 rails-1c265da1db934ffab0a5151dc7beeed3ef1bbabb.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'railties')
-rw-r--r-- | railties/Rakefile | 10 | ||||
-rw-r--r-- | railties/lib/rails/configuration.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/paths.rb | 4 | ||||
-rw-r--r-- | railties/lib/rails/version.rb | 6 | ||||
-rw-r--r-- | railties/lib/test_help.rb | 6 | ||||
-rw-r--r-- | railties/test/abstract_unit.rb | 5 | ||||
-rw-r--r-- | railties/test/initializer/path_test.rb | 17 | ||||
-rw-r--r-- | railties/test/paths_test.rb | 7 |
8 files changed, 44 insertions, 13 deletions
diff --git a/railties/Rakefile b/railties/Rakefile index 56389f9c33..35ae15ff0f 100644 --- a/railties/Rakefile +++ b/railties/Rakefile @@ -317,11 +317,11 @@ spec = Gem::Specification.new do |s| EOF s.add_dependency('rake', '>= 0.8.3') - s.add_dependency('activesupport', '= 2.3.2' + PKG_BUILD) - s.add_dependency('activerecord', '= 2.3.2' + PKG_BUILD) - s.add_dependency('actionpack', '= 2.3.2' + PKG_BUILD) - s.add_dependency('actionmailer', '= 2.3.2' + PKG_BUILD) - s.add_dependency('activeresource', '= 2.3.2' + PKG_BUILD) + s.add_dependency('activesupport', '= 3.0.pre' + PKG_BUILD) + s.add_dependency('activerecord', '= 3.0.pre' + PKG_BUILD) + s.add_dependency('actionpack', '= 3.0.pre' + PKG_BUILD) + s.add_dependency('actionmailer', '= 3.0.pre' + PKG_BUILD) + s.add_dependency('activeresource', '= 3.0.pre' + PKG_BUILD) s.rdoc_options << '--exclude' << '.' s.has_rdoc = false diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb index 59132efe98..d877915460 100644 --- a/railties/lib/rails/configuration.rb +++ b/railties/lib/rails/configuration.rb @@ -76,7 +76,7 @@ module Rails @paths.config.locales = "config/locales" @paths.config.environments = "config/environments" - @paths.app.controllers.push *builtin_directories + @paths.app.controllers.concat builtin_directories @paths.app.load_path! @paths.app.metals.load_path! diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index aada7d4a56..d2f6d83659 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -80,6 +80,10 @@ module Rails @paths.unshift path end + def concat(paths) + @paths.concat paths + end + def load_once! @load_once = true @root.load_once.push *self.paths diff --git a/railties/lib/rails/version.rb b/railties/lib/rails/version.rb index 99c7516a65..9a65096061 100644 --- a/railties/lib/rails/version.rb +++ b/railties/lib/rails/version.rb @@ -1,8 +1,8 @@ module Rails module VERSION #:nodoc: - MAJOR = 2 - MINOR = 3 - TINY = 2 + MAJOR = 3 + MINOR = 0 + TINY = "pre" STRING = [MAJOR, MINOR, TINY].join('.') end diff --git a/railties/lib/test_help.rb b/railties/lib/test_help.rb index 94e089a624..4318203a42 100644 --- a/railties/lib/test_help.rb +++ b/railties/lib/test_help.rb @@ -3,6 +3,7 @@ silence_warnings { RAILS_ENV = "test" } require 'test/unit' +require 'active_support/core_ext/kernel/requires' require 'action_controller/testing/test_case' require 'action_view/test_case' require 'action_controller/testing/integration' @@ -29,7 +30,10 @@ end begin require_library_or_gem 'ruby-debug' Debugger.start - Debugger.settings[:autoeval] = true if Debugger.respond_to?(:settings) + if Debugger.respond_to?(:settings) + Debugger.settings[:autoeval] = true + Debugger.settings[:autolist] = 1 + end rescue LoadError # ruby-debug wasn't available so neither can the debugging be end diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb index cef69e90cb..9a640bdbc5 100644 --- a/railties/test/abstract_unit.rb +++ b/railties/test/abstract_unit.rb @@ -1,3 +1,5 @@ +ORIG_ARGV = ARGV.dup + $:.unshift File.dirname(__FILE__) + "/../../activesupport/lib" $:.unshift File.dirname(__FILE__) + "/../../activerecord/lib" $:.unshift File.dirname(__FILE__) + "/../../actionpack/lib" @@ -10,9 +12,6 @@ require 'stringio' require 'rubygems' require 'test/unit' -gem 'mocha', '>= 0.9.5' -require 'mocha' - require 'active_support' require 'active_support/test_case' diff --git a/railties/test/initializer/path_test.rb b/railties/test/initializer/path_test.rb index 37e1eebbc7..8fbad24a73 100644 --- a/railties/test/initializer/path_test.rb +++ b/railties/test/initializer/path_test.rb @@ -14,6 +14,8 @@ Rails::Initializer.run do |config| end class PathsTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + def setup @paths = Rails::Initializer.default.config.paths end @@ -83,4 +85,19 @@ class PathsTest < ActiveSupport::TestCase assert_not_in_load_path "tmp", "cache" end + test "controller paths include builtin in development mode" do + RAILS_ENV.replace "development" + assert Rails::Configuration.new.paths.app.controllers.paths.any? { |p| p =~ /builtin/ } + end + + test "controller paths does not have builtin_directories in test mode" do + RAILS_ENV.replace "test" + assert !Rails::Configuration.new.paths.app.controllers.paths.any? { |p| p =~ /builtin/ } + end + + test "controller paths does not have builtin_directories in production mode" do + RAILS_ENV.replace "production" + assert !Rails::Configuration.new.paths.app.controllers.paths.any? { |p| p =~ /builtin/ } + end + end
\ No newline at end of file diff --git a/railties/test/paths_test.rb b/railties/test/paths_test.rb index a1ed43ad6d..fa2f6ceee2 100644 --- a/railties/test/paths_test.rb +++ b/railties/test/paths_test.rb @@ -52,6 +52,12 @@ class PathsTest < ActiveSupport::TestCase assert_equal ["/app", "/app2"], @root.app.to_a end + test "adding multiple physical paths using concat" do + @root.app = "/app" + @root.app.concat ["/app2", "/app3"] + assert_equal ["/app", "/app2", "/app3"], @root.app.to_a + end + test "adding multiple physical paths using #unshift" do @root.app = "/app" @root.app.unshift "/app2" @@ -62,6 +68,7 @@ class PathsTest < ActiveSupport::TestCase assert_raise(RuntimeError) { Rails::Application::Root.new(["/fiz", "/biz"]) } assert_raise(NoMethodError) { @root.push "/biz" } assert_raise(NoMethodError) { @root.unshift "/biz" } + assert_raise(NoMethodError) { @root.concat ["/biz"]} assert_raise(NoMethodError) { @root << "/biz" } end |