Skip to content

Commit

Permalink
Stop generating a license for in-app plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
gmcgibbon committed Mar 1, 2021
1 parent 45359e5 commit 9790ae9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions railties/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
course of developing a Rails app. See [#41083](https://github.com/rails/rails/pull/41083) for
the full list of changes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def gemfile
end

def license
template "MIT-LICENSE"
template "MIT-LICENSE" unless inside_application?
end

def gemspec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ Gem::Specification.new do |spec|
spec.homepage = "TODO"
spec.summary = "TODO: Summary of <%= camelized_modules %>."
spec.description = "TODO: Description of <%= camelized_modules %>."
<% unless inside_application? -%>
spec.license = "MIT"
<% end -%>

# 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.
Expand Down
12 changes: 12 additions & 0 deletions railties/test/generators/plugin_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,18 @@ def test_skipping_gemfile_entry
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
run_generator [destination_root, "--mountable"]

Expand Down

0 comments on commit 9790ae9

Please sign in to comment.