mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Merge pull request #1328 from flippingbits/cleanup_engine_generator
Cleanup engine generator
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module <%= camelized %>
|
||||
class Engine < Rails::Engine
|
||||
class Engine < ::Rails::Engine
|
||||
<% if mountable? -%>
|
||||
isolate_namespace <%= camelized %>
|
||||
<% end -%>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user