aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-04-23 01:09:27 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-04-23 01:09:27 +0100
commit5a1fe9039b33414b7088813712e03bbe38567cff (patch)
tree10e3a15c06494dd09c0324dca894ddcbb68ce582 /railties
parent3384f073e35c5391deaeb209a62a485a0c4dd7b1 (diff)
parent7f6779c1d5e4ec7f642839caa7e86320720f77c8 (diff)
downloadrails-5a1fe9039b33414b7088813712e03bbe38567cff.tar.gz
rails-5a1fe9039b33414b7088813712e03bbe38567cff.tar.bz2
rails-5a1fe9039b33414b7088813712e03bbe38567cff.zip
Merge commit 'mainstream/master'
Diffstat (limited to 'railties')
-rw-r--r--railties/Rakefile4
-rw-r--r--railties/lib/rails/plugin.rb11
-rw-r--r--railties/lib/rails/rack/metal.rb1
-rw-r--r--railties/lib/rails_generator.rb14
-rw-r--r--railties/lib/tasks/framework.rake4
5 files changed, 21 insertions, 13 deletions
diff --git a/railties/Rakefile b/railties/Rakefile
index a9adbda0b5..9cd102df0f 100644
--- a/railties/Rakefile
+++ b/railties/Rakefile
@@ -29,12 +29,12 @@ task :default => :test
task :test do
Dir['test/**/*_test.rb'].all? do |file|
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
- system(ruby, '-Itest', file)
+ system(ruby, '-Itest', "-I#{File.dirname(__FILE__)}/../activesupport/lib", file)
end or raise "Failures"
end
Rake::TestTask.new("regular_test") do |t|
- t.libs << 'test'
+ t.libs << 'test' << "#{File.dirname(__FILE__)}/../activesupport/lib"
t.pattern = 'test/**/*_test.rb'
t.warning = true
t.verbose = true
diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb
index 80deb73bbb..dd840ef058 100644
--- a/railties/lib/rails/plugin.rb
+++ b/railties/lib/rails/plugin.rb
@@ -1,3 +1,6 @@
+require 'active_support/core_ext/kernel/reporting'
+require 'active_support/dependencies'
+
module Rails
# The Plugin class should be an object which provides the following methods:
#
@@ -35,10 +38,10 @@ module Rails
def load_paths
report_nonexistant_or_empty_plugin! unless valid?
- returning [] do |load_paths|
- load_paths << lib_path if has_lib_directory?
- load_paths << app_paths if has_app_directory?
- end.flatten
+ load_paths = []
+ load_paths << lib_path if has_lib_directory?
+ load_paths << app_paths if has_app_directory?
+ load_paths.flatten
end
# Evaluates a plugin's init.rb file.
diff --git a/railties/lib/rails/rack/metal.rb b/railties/lib/rails/rack/metal.rb
index adc43da864..7a616c7911 100644
--- a/railties/lib/rails/rack/metal.rb
+++ b/railties/lib/rails/rack/metal.rb
@@ -1,4 +1,5 @@
require 'active_support/ordered_hash'
+require 'active_support/core_ext/class/attribute_accessors'
module Rails
module Rack
diff --git a/railties/lib/rails_generator.rb b/railties/lib/rails_generator.rb
index 9f0ffc1562..201a9e0f91 100644
--- a/railties/lib/rails_generator.rb
+++ b/railties/lib/rails_generator.rb
@@ -21,16 +21,18 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
-$:.unshift(File.dirname(__FILE__))
-$:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib")
-
begin
- require 'active_support'
+ require 'active_support'
rescue LoadError
- require 'rubygems'
- gem 'activesupport'
+ activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib"
+ if File.directory?(activesupport_path)
+ $:.unshift activesupport_path
+ require 'active_support'
+ end
end
+require 'active_support/core/all'
+$:.unshift(File.dirname(__FILE__))
require 'rails_generator/base'
require 'rails_generator/lookup'
require 'rails_generator/commands'
diff --git a/railties/lib/tasks/framework.rake b/railties/lib/tasks/framework.rake
index 191c9361ff..b6f2f2bc18 100644
--- a/railties/lib/tasks/framework.rake
+++ b/railties/lib/tasks/framework.rake
@@ -83,7 +83,9 @@ namespace :rails do
desc "Applies the template supplied by LOCATION=/path/to/template"
task :template do
require 'rails_generator/generators/applications/app/template_runner'
- Rails::TemplateRunner.new(ENV["LOCATION"])
+ template = ENV["LOCATION"]
+ template = File.expand_path(template) if template !~ %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://}
+ Rails::TemplateRunner.new(template)
end
namespace :update do