Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Cleanup engine generator #1328

Merged
merged 2 commits into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 26, 2011
  1. @flippingbits
  2. @flippingbits
This page is out of date. Refresh to see the latest.
View
2  railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
@@ -258,7 +258,7 @@ def valid_const?
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
View
2  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 -%>
View
2  railties/test/generators/plugin_new_generator_test.rb
@@ -148,7 +148,7 @@ def test_creating_engine_in_full_mode
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
Something went wrong with that request. Please try again.