Skip to content

Commit

Permalink
Include source_code_uri in gemspec, version changelog_uri
Browse files Browse the repository at this point in the history
See #3684

Co-authored-by: TonyCTHsu <tonyc.t.hsu@gmail.com>
  • Loading branch information
Earlopain and TonyCTHsu committed Jun 11, 2024
1 parent e086475 commit f55d3ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion datadog.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Gem::Specification.new do |spec|

if spec.respond_to?(:metadata)
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
spec.metadata['changelog_uri'] = 'https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md'
spec.metadata['changelog_uri'] = "https://github.com/DataDog/dd-trace-rb/blob/v#{spec.version}/CHANGELOG.md"
spec.metadata['source_code_uri'] = "https://github.com/DataDog/dd-trace-rb/tree/v#{spec.version}"
else
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
end
Expand Down
12 changes: 12 additions & 0 deletions spec/datadog/release_gem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,17 @@
expect(gemspec.licenses).to contain_exactly('BSD-3-Clause', 'Apache-2.0')
end
end

describe '#metadata' do
it do
{
'allowed_push_host' => 'https://rubygems.org',
'changelog_uri' => "https://github.com/DataDog/dd-trace-rb/blob/v#{gemspec.version}/CHANGELOG.md",
'source_code_uri' => "https://github.com/DataDog/dd-trace-rb/tree/v#{gemspec.version}"
}.each do |key, value|
expect(gemspec.metadata[key]).to eq(value)
end
end
end
end
end

0 comments on commit f55d3ed

Please sign in to comment.