Skip to content

Commit 6a2dedd

Browse files
authored
Modernize gemspec: add metadata, use Dir glob, drop defaults (#401)
## Summary - Replace `git ls-files` shell-out with `Dir['lib/**/*.rb', ...]` to avoid dependency on git at build time and prevent accidental inclusion of non-Ruby files or directories - Add RubyGems metadata (homepage, bug tracker, changelog, docs, source code) and require MFA for gem pushes via `rubygems_mfa_required` - Remove redundant `s.platform = Gem::Platform::RUBY` (it is the default)
1 parent 65d41f1 commit 6a2dedd

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* [#400](https://github.com/ruby-grape/grape-entity/pull/400): Switch to danger-pr-comment for PR checks - [@numbata](https://github.com/numbata).
66
* [#397](https://github.com/ruby-grape/grape-entity/pull/397): Reduce gem size by excluding test files - [@yuri-zubov](https://github.com/yuri-zubov).
7+
* [#401](https://github.com/ruby-grape/grape-entity/pull/401): Modernize gemspec: add metadata, use Dir glob, require MFA - [@numbata](https://github.com/numbata).
78
* Your contribution here.
89

910
#### Fixes

grape-entity.gemspec

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,26 @@ require 'grape_entity/version'
66
Gem::Specification.new do |s|
77
s.name = 'grape-entity'
88
s.version = GrapeEntity::VERSION
9-
s.platform = Gem::Platform::RUBY
109
s.authors = ['LeFnord', 'Michael Bleigh']
1110
s.email = ['pscholz.le@gmail.com', 'michael@intridea.com']
1211
s.homepage = 'https://github.com/ruby-grape/grape-entity'
1312
s.summary = 'A simple facade for managing the relationship between your model and API.'
1413
s.description = 'Extracted from Grape, A Ruby framework for rapid API development with great conventions.'
1514
s.license = 'MIT'
1615

16+
s.metadata = {
17+
'homepage_uri' => 'https://github.com/ruby-grape/grape-entity',
18+
'bug_tracker_uri' => 'https://github.com/ruby-grape/grape-entity/issues',
19+
'changelog_uri' => "https://github.com/ruby-grape/grape-entity/blob/v#{s.version}/CHANGELOG.md",
20+
'documentation_uri' => "https://www.rubydoc.info/gems/grape-entity/#{s.version}",
21+
'source_code_uri' => "https://github.com/ruby-grape/grape-entity/tree/v#{s.version}",
22+
'rubygems_mfa_required' => 'true'
23+
}
24+
1725
s.required_ruby_version = '>= 3.0'
1826

1927
s.add_dependency 'activesupport', '>= 3.0.0'
2028

21-
s.files = `git ls-files lib`.split("\n") + ['CHANGELOG.md', 'LICENSE', 'README.md']
29+
s.files = Dir['lib/**/*.rb', 'CHANGELOG.md', 'LICENSE', 'README.md']
2230
s.require_paths = ['lib']
2331
end

0 commit comments

Comments
 (0)