提交 ff8e9e07 编写于 作者: C Carlos Antonio da Silva 提交者: Santiago Pastorino

Allow generator configs from http_only! to be overriden by app

[Carlos Antonio da Silva & Santiago Pastorino]
上级 2b355757
......@@ -61,6 +61,7 @@ module Generators
}
def self.configure!(config) #:nodoc:
http_only! if config.http_only?
no_color! unless config.colorize_logging
aliases.deep_merge! config.aliases
options.deep_merge! config.options
......@@ -68,7 +69,6 @@ def self.configure!(config) #:nodoc:
templates_path.concat config.templates
templates_path.uniq!
hide_namespaces(*config.hidden_namespaces)
http_only! if config.http_only?
end
def self.templates_path
......
......@@ -125,5 +125,20 @@ def with_bare_config
assert_equal expected, c.generators.options
end
end
test "http only allow overriding generators on initialization" do
add_to_config <<-RUBY
config.generators.helper = true
config.generators.http_only!
config.generators.template_engine = :my_template
RUBY
# Initialize the application
require "#{app_path}/config/environment"
Rails.application.load_generators
assert_equal :my_template, Rails::Generators.options[:rails][:template_engine]
assert_equal true, Rails::Generators.options[:rails][:helper]
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册