aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators.rb2
-rw-r--r--railties/lib/rails/generators/rails/app/templates/app/mailers/.empty_directory0
-rw-r--r--railties/lib/rails/ruby_version_check.rb20
-rw-r--r--railties/test/generators/app_generator_test.rb1
-rw-r--r--railties/test/generators/mailer_generator_test.rb4
5 files changed, 21 insertions, 6 deletions
diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb
index f4990bfb4c..41aecea355 100644
--- a/railties/lib/rails/generators.rb
+++ b/railties/lib/rails/generators.rb
@@ -327,7 +327,7 @@ module Rails
paths = []
namespaces.each do |namespace|
pieces = namespace.split(":")
- paths << pieces.dup.push(pieces.last).join("/") unless pieces.uniq.size == 1
+ paths << pieces.dup.push(pieces.last).join("/")
paths << pieces.join("/")
end
paths.uniq!
diff --git a/railties/lib/rails/generators/rails/app/templates/app/mailers/.empty_directory b/railties/lib/rails/generators/rails/app/templates/app/mailers/.empty_directory
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/railties/lib/rails/generators/rails/app/templates/app/mailers/.empty_directory
diff --git a/railties/lib/rails/ruby_version_check.rb b/railties/lib/rails/ruby_version_check.rb
index 994df17e65..e8d1d1e039 100644
--- a/railties/lib/rails/ruby_version_check.rb
+++ b/railties/lib/rails/ruby_version_check.rb
@@ -1,10 +1,24 @@
-ruby_release = "#{RUBY_VERSION} (#{RUBY_RELEASE_DATE})"
-if ruby_release < '1.8.7' || (ruby_release > '1.8' && ruby_release < '1.9.2')
+if RUBY_VERSION < '1.8.7'
+ desc = defined?(RUBY_DESCRIPTION) ? RUBY_DESCRIPTION : "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE})"
abort <<-end_message
Rails 3 requires Ruby 1.8.7 or 1.9.2.
- You're running #{ruby_release}; please upgrade to continue.
+ You're running
+ #{desc}
+
+ Please upgrade to continue.
+
+ end_message
+elsif RUBY_VERSION > '1.9' and RUBY_VERSION < '1.9.2'
+ $stderr.puts <<-end_message
+
+ Rails 3 doesn't officially support Ruby 1.9.1 since recent stable
+ releases have segfaulted the test suite. Please upgrade to Ruby 1.9.2
+ before Rails 3 is released!
+
+ You're running
+ #{RUBY_DESCRIPTION}
end_message
end
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index ffc5636467..6a3b5de9de 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -9,6 +9,7 @@ DEFAULT_APP_FILES = %w(
config.ru
app/controllers
app/helpers
+ app/mailers
app/models
app/views/layouts
config/environments
diff --git a/railties/test/generators/mailer_generator_test.rb b/railties/test/generators/mailer_generator_test.rb
index 850b45ff74..450dec7716 100644
--- a/railties/test/generators/mailer_generator_test.rb
+++ b/railties/test/generators/mailer_generator_test.rb
@@ -17,8 +17,8 @@ class MailerGeneratorTest < Rails::Generators::TestCase
def test_mailer_with_i18n_helper
run_generator
assert_file "app/mailers/notifier.rb" do |mailer|
- assert_match /en\.actionmailer\.notifier\.foo\.subject/, mailer
- assert_match /en\.actionmailer\.notifier\.bar\.subject/, mailer
+ assert_match /en\.notifier\.foo\.subject/, mailer
+ assert_match /en\.notifier\.bar\.subject/, mailer
end
end