Skip to content

Commit

Permalink
Merge pull request rails#41934 from chriscz/bugfix/plugin-gemspec-tem…
Browse files Browse the repository at this point in the history
…plate

Expand gemspec files within gem directory
  • Loading branch information
rafaelfranca committed Oct 14, 2021
2 parents 21c6c22 + decf748 commit 6acaebd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ Gem::Specification.new do |spec|
spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."

spec.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
spec.files = Dir.chdir(File.expand_path(__dir__)) do
Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
end

<%= "# " if options.dev? || options.edge? || options.main? -%>spec.add_dependency "rails", "<%= Array(rails_version_specifier).join('", "') %>"
end
2 changes: 1 addition & 1 deletion railties/test/generators/plugin_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def test_creating_mountable_engine_mode_adds_keeps
def test_creating_gemspec
run_generator
assert_file "bukkits.gemspec", /spec\.name\s+= "bukkits"/
assert_file "bukkits.gemspec", /spec\.files = Dir\["\{app,config,db,lib\}\/\*\*\/\*", "MIT-LICENSE", "Rakefile", "README\.md"\]/
assert_file "bukkits.gemspec", /spec\.files = Dir.chdir\(File\.expand_path\(__dir__\)\)\s+do\s+Dir\["\{app,config,db,lib\}\/\*\*\/\*", "MIT-LICENSE", "Rakefile", "README\.md"\]\s+end/
assert_file "bukkits.gemspec", /spec\.version\s+ = Bukkits::VERSION/
end

Expand Down

0 comments on commit 6acaebd

Please sign in to comment.