aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-05-26 03:44:14 -0700
committerJosé Valim <jose.valim@gmail.com>2011-05-26 03:44:14 -0700
commit5083d70f6f0041fe7ee8b662ecc58db2c15580e3 (patch)
treefba632b402a53c672ac19a74356a1d1fb9f42a6b /railties
parentec08bfc035e792d973152902563fb5dad82c437c (diff)
parent4686ace999467935e659260d1a23c6617bc51986 (diff)
downloadrails-5083d70f6f0041fe7ee8b662ecc58db2c15580e3.tar.gz
rails-5083d70f6f0041fe7ee8b662ecc58db2c15580e3.tar.bz2
rails-5083d70f6f0041fe7ee8b662ecc58db2c15580e3.zip
Merge pull request #1328 from flippingbits/cleanup_engine_generator
Cleanup engine generator
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb2
-rw-r--r--railties/lib/rails/generators/rails/plugin_new/templates/lib/%name%/engine.rb2
-rw-r--r--railties/test/generators/plugin_new_generator_test.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
index 4967d1793c..00f90f9498 100644
--- a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
+++ b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
@@ -258,7 +258,7 @@ task :default => :test
elsif RESERVED_NAMES.include?(name)
raise Error, "Invalid plugin name #{name}. Please give a name which does not match one of the reserved rails words."
elsif Object.const_defined?(camelized)
- raise Error, "Invalid plugin name #{name}, constant #{camelized} is already in use. Please choose another application name."
+ raise Error, "Invalid plugin name #{name}, constant #{camelized} is already in use. Please choose another plugin name."
end
end
diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/lib/%name%/engine.rb b/railties/lib/rails/generators/rails/plugin_new/templates/lib/%name%/engine.rb
index aa8ea77bae..967668fe66 100644
--- a/railties/lib/rails/generators/rails/plugin_new/templates/lib/%name%/engine.rb
+++ b/railties/lib/rails/generators/rails/plugin_new/templates/lib/%name%/engine.rb
@@ -1,5 +1,5 @@
module <%= camelized %>
- class Engine < Rails::Engine
+ class Engine < ::Rails::Engine
<% if mountable? -%>
isolate_namespace <%= camelized %>
<% end -%>
diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb
index b93e33f61a..528c73ffaf 100644
--- a/railties/test/generators/plugin_new_generator_test.rb
+++ b/railties/test/generators/plugin_new_generator_test.rb
@@ -148,7 +148,7 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase
assert_file "app/views"
assert_file "app/helpers"
assert_file "config/routes.rb", /Rails.application.routes.draw do/
- assert_file "lib/bukkits/engine.rb", /module Bukkits\n class Engine < Rails::Engine\n end\nend/
+ assert_file "lib/bukkits/engine.rb", /module Bukkits\n class Engine < ::Rails::Engine\n end\nend/
assert_file "lib/bukkits.rb", /require "bukkits\/engine"/
end