Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

bundle info prints gem metadata #7376

Merged
2 commits merged into from
Oct 30, 2019
Merged

bundle info prints gem metadata #7376

2 commits merged into from
Oct 30, 2019

Conversation

orien
Copy link
Contributor

@orien orien commented Oct 6, 2019

What was the end-user problem that led to this PR?

Rubygems has supported gemspec metadata since version 2.0. I think it'd be great to display this information in response to the bundle info <gem> command.

What is your fix for the problem, implemented in this PR?

Added a check for metadata, outputting this extra information if it has been included with the gem release. For example:

> bundle info rspec-mocks
  * rspec-mocks (3.8.1)
	Summary: rspec-mocks-3.8.1
	Homepage: https://github.com/rspec/rspec-mocks
	Documentation: https://rspec.info/documentation/
	Source Code: https://github.com/rspec/rspec-mocks
	Changelog: https://github.com/rspec/rspec-mocks/blob/v3.8.1/Changelog.md
	Bug Tracker: https://github.com/rspec/rspec-mocks/issues
	Mailing List: https://groups.google.com/forum/#!forum/rspec
	Path: /opt/asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rspec-mocks-3.8.1

For better readability, we could align the values. However, this would mean a change to the existing info property lines (Summary, Homepage, Path and Default). Which would potentially break existing scripts that are coupled to the precise output.

This provides more information about the gem to developers. For example:

bundle info rspec-mocks
  * rspec-mocks (3.8.1)
	Summary: rspec-mocks-3.8.1
	Homepage: https://github.com/rspec/rspec-mocks
	Documentation: https://rspec.info/documentation/
	Source Code: https://github.com/rspec/rspec-mocks
	Changelog: https://github.com/rspec/rspec-mocks/blob/v3.8.1/Changelog.md
	Bug Tracker: https://github.com/rspec/rspec-mocks/issues
	Mailing List: https://groups.google.com/forum/#!forum/rspec
	Path: /opt/asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rspec-mocks-3.8.1
@welcome
Copy link

welcome bot commented Oct 6, 2019

Thanks for opening a pull request and helping make Bundler better! Someone from the Bundler team will take a look at your pull request shortly and leave any feedback. Please make sure that your pull request has tests for any changes or added functionality.

We use Travis CI to test and make sure your change works functionally and uses acceptable conventions, you can review the current progress of Travis CI in the PR status window below.

If you have any questions or concerns that you wish to ask, feel free to leave a comment in this PR or join our #bundler channel on Slack.

For more information about contributing to the Bundler project feel free to review our CONTRIBUTING guide

Copy link
Member

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

We can rely on it always being available since in our gemspec we set:
required_rubygems_version >= 2.5.2
@deivid-rodriguez
Copy link
Member

Let's do it!

@bundlerbot r+

ghost pushed a commit that referenced this pull request Oct 30, 2019
7376: bundle info prints gem metadata r=deivid-rodriguez a=orien

### What was the end-user problem that led to this PR?

Rubygems has supported [gemspec metadata](https://guides.rubygems.org/specification-reference/#metadata) since version 2.0. I think it'd be great to display this information in response to the `bundle info <gem>` command.

### What is your fix for the problem, implemented in this PR?

Added a check for `metadata`, outputting this extra information if it has been included with the gem release. For example:

```
> bundle info rspec-mocks
  * rspec-mocks (3.8.1)
	Summary: rspec-mocks-3.8.1
	Homepage: https://github.com/rspec/rspec-mocks
	Documentation: https://rspec.info/documentation/
	Source Code: https://github.com/rspec/rspec-mocks
	Changelog: https://github.com/rspec/rspec-mocks/blob/v3.8.1/Changelog.md
	Bug Tracker: https://github.com/rspec/rspec-mocks/issues
	Mailing List: https://groups.google.com/forum/#!forum/rspec
	Path: /opt/asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rspec-mocks-3.8.1
```

For better readability, we could align the values. However, this would mean a change to the existing info property lines (`Summary`, `Homepage`, `Path` and `Default`). Which would potentially break existing scripts that are coupled to the precise output.



Co-authored-by: Orien Madgwick <_@orien.io>
@ghost
Copy link

ghost commented Oct 30, 2019

Build succeeded

@ghost ghost merged commit ca2af53 into rubygems:master Oct 30, 2019
@orien orien deleted the info-metadata branch October 31, 2019 02:44
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants