Merge pull request #41563 from gmcgibbon/plugin_license_in_application
Stop generating a license for in-app plugins
This commit is contained in:
commit
35e9812dfc
|
@ -1,3 +1,7 @@
|
||||||
|
* Stop generating a license for in-app plugins.
|
||||||
|
|
||||||
|
*Gannon McGibbon*
|
||||||
|
|
||||||
* `rails app:update` no longer prompts you to overwrite files that are generally modified in the
|
* `rails app:update` no longer prompts you to overwrite files that are generally modified in the
|
||||||
course of developing a Rails app. See [#41083](https://github.com/rails/rails/pull/41083) for
|
course of developing a Rails app. See [#41083](https://github.com/rails/rails/pull/41083) for
|
||||||
the full list of changes.
|
the full list of changes.
|
||||||
|
|
|
@ -51,7 +51,7 @@ module Rails
|
||||||
end
|
end
|
||||||
|
|
||||||
def license
|
def license
|
||||||
template "MIT-LICENSE"
|
template "MIT-LICENSE" unless inside_application?
|
||||||
end
|
end
|
||||||
|
|
||||||
def gemspec
|
def gemspec
|
||||||
|
|
|
@ -8,7 +8,9 @@ Gem::Specification.new do |spec|
|
||||||
spec.homepage = "TODO"
|
spec.homepage = "TODO"
|
||||||
spec.summary = "TODO: Summary of <%= camelized_modules %>."
|
spec.summary = "TODO: Summary of <%= camelized_modules %>."
|
||||||
spec.description = "TODO: Description of <%= camelized_modules %>."
|
spec.description = "TODO: Description of <%= camelized_modules %>."
|
||||||
|
<% unless inside_application? -%>
|
||||||
spec.license = "MIT"
|
spec.license = "MIT"
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
||||||
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
||||||
|
|
|
@ -631,6 +631,18 @@ class PluginGeneratorTest < Rails::Generators::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_creating_plugin_in_application_skips_license
|
||||||
|
with_simulated_app do |gemfile_path|
|
||||||
|
FileUtils.cd(destination_root)
|
||||||
|
run_generator ["bukkits"]
|
||||||
|
|
||||||
|
assert_file "bukkits/bukkits.gemspec" do |contents|
|
||||||
|
assert_no_match(/spec.license/, contents)
|
||||||
|
end
|
||||||
|
assert_no_file "bukkits/MIT-LICENSE"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_generating_controller_inside_mountable_engine
|
def test_generating_controller_inside_mountable_engine
|
||||||
run_generator [destination_root, "--mountable"]
|
run_generator [destination_root, "--mountable"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue