New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a `bundle licenses` cli task #1898

Merged
merged 1 commit into from Jan 23, 2013

Conversation

Projects
None yet
5 participants
@bryanwoods
Contributor

bryanwoods commented May 4, 2012

This commit adds a bundle licenses task, which lists the license for each gem in the bundle or "Unknown" if one isn't found.

After having felt the pain of walking through a Ruby application's dependencies to determine license information on several occasions, it would be a dream to me if more gem authors used the license directive in their gemspecs, which would allow a simple task like this to be a more authoritative guide to determine dependency licenses.

I've added a new test for this change, and would love any and all feedback to this approach.

Thanks!

@travisbot

This comment has been minimized.

Show comment
Hide comment
@travisbot

travisbot May 4, 2012

This pull request passes (merged 7e26aaf into a63bdd3).

travisbot commented May 4, 2012

This pull request passes (merged 7e26aaf into a63bdd3).

@indirect

This comment has been minimized.

Show comment
Hide comment
@indirect

indirect May 4, 2012

Member

This seems like a perfect example of something that I would like to make possible via a Bundler plugin. We don't have a plugin system yet, but we want to make one so that things like this are easy to do without having to go into bundler core, which we want to keep smaller and more focused.

Since we don't have a plugin system worked out yet, it might be useful to accept this and then refactor it into a plugin when possible. @hone, what do you think?

On May 4, 2012, at 3:15 PM, Bryan Woodsreply@reply.github.com wrote:

This commit adds a bundle licenses task, which lists the license for each gem in the bundle or "Unknown" if one isn't found.

After having felt the pain of walking through a Ruby application's dependencies to determine license information on several occasions, it would be a dream to me if more gem authors used the license directive in their gemspecs, which would allow a simple task like this to be a more authoritative guide to determine dependency licenses.

I've added a new test for this change, and would love any and all feedback to this approach.

Thanks!

You can merge this Pull Request by running:

git pull https://github.com/bryanwoods/bundler master

Or you can view, comment on it, or merge it online at:

#1898

-- Commit Summary --

  • Adds bundle licenses cli task

-- File Changes --

M lib/bundler/cli.rb (14)
A spec/other/licenses_spec.rb (18)
M spec/support/builders.rb (4)

-- Patch Links --

https://github.com/carlhuda/bundler/pull/1898.patch
https://github.com/carlhuda/bundler/pull/1898.diff


Reply to this email directly or view it on GitHub:
#1898

Member

indirect commented May 4, 2012

This seems like a perfect example of something that I would like to make possible via a Bundler plugin. We don't have a plugin system yet, but we want to make one so that things like this are easy to do without having to go into bundler core, which we want to keep smaller and more focused.

Since we don't have a plugin system worked out yet, it might be useful to accept this and then refactor it into a plugin when possible. @hone, what do you think?

On May 4, 2012, at 3:15 PM, Bryan Woodsreply@reply.github.com wrote:

This commit adds a bundle licenses task, which lists the license for each gem in the bundle or "Unknown" if one isn't found.

After having felt the pain of walking through a Ruby application's dependencies to determine license information on several occasions, it would be a dream to me if more gem authors used the license directive in their gemspecs, which would allow a simple task like this to be a more authoritative guide to determine dependency licenses.

I've added a new test for this change, and would love any and all feedback to this approach.

Thanks!

You can merge this Pull Request by running:

git pull https://github.com/bryanwoods/bundler master

Or you can view, comment on it, or merge it online at:

#1898

-- Commit Summary --

  • Adds bundle licenses cli task

-- File Changes --

M lib/bundler/cli.rb (14)
A spec/other/licenses_spec.rb (18)
M spec/support/builders.rb (4)

-- Patch Links --

https://github.com/carlhuda/bundler/pull/1898.patch
https://github.com/carlhuda/bundler/pull/1898.diff


Reply to this email directly or view it on GitHub:
#1898

@bryanwoods

This comment has been minimized.

Show comment
Hide comment
@bryanwoods

bryanwoods May 22, 2012

Contributor

Thanks for the feedback. I'd definitely love to see this added in order to begin encouraging developers to use the license directive in their gems, but I hear you that this might be better suited as a plugin (I did some digging around looking to see if bundler had a plugin system before working on this). I'm happy either way as long as I can work on encouraging gem authors and users to be mindful of representing their licenses with the tools we already have. :)

I'm excited by the prospect of a bundler plugin system and would love to offer my time and help to make it happen. Would love to hear from the project maintainers about how they envision this working, any thought that's gone into it already, and how I might be able to help.

Thanks again.

Contributor

bryanwoods commented May 22, 2012

Thanks for the feedback. I'd definitely love to see this added in order to begin encouraging developers to use the license directive in their gems, but I hear you that this might be better suited as a plugin (I did some digging around looking to see if bundler had a plugin system before working on this). I'm happy either way as long as I can work on encouraging gem authors and users to be mindful of representing their licenses with the tools we already have. :)

I'm excited by the prospect of a bundler plugin system and would love to offer my time and help to make it happen. Would love to hear from the project maintainers about how they envision this working, any thought that's gone into it already, and how I might be able to help.

Thanks again.

@indirect

This comment has been minimized.

Show comment
Hide comment
@indirect

indirect May 22, 2012

Member

I've opened a new ticket (#1945) with my thoughts about a Bundler plugin system. It would be fantastic if you could chime in with your thoughts, and I would love to spend some time talking to you about getting something implemented. Thanks!

Member

indirect commented May 22, 2012

I've opened a new ticket (#1945) with my thoughts about a Bundler plugin system. It would be fantastic if you could chime in with your thoughts, and I would love to spend some time talking to you about getting something implemented. Thanks!

@mfoo

This comment has been minimized.

Show comment
Hide comment
@mfoo

mfoo Jul 18, 2012

I would also like to see this change incorporated into Bundler (whether through a plugin or not). Being able to check that I didn't accidentally pull in a dependency with an incompatible license would be very useful.

It seems like it should be fairly core functionality to me. I should be able to ask my distribution system about the metadata of the software I've installed through it. (e.g. apt-cache showpkg, brew info).

For those who turn up here before this is implemented, I managed to hack around it with this:

bundle list | tr -d '  *' |  sed 's/\([a-z_0-9-]*\)([0-9\.rc]*)/echo "\1:"; gem specification \1 licenses/g' | sh

(As an annoying note, only about 6 of the gems that I'm using provide this information in the Gemspec)

mfoo commented Jul 18, 2012

I would also like to see this change incorporated into Bundler (whether through a plugin or not). Being able to check that I didn't accidentally pull in a dependency with an incompatible license would be very useful.

It seems like it should be fairly core functionality to me. I should be able to ask my distribution system about the metadata of the software I've installed through it. (e.g. apt-cache showpkg, brew info).

For those who turn up here before this is implemented, I managed to hack around it with this:

bundle list | tr -d '  *' |  sed 's/\([a-z_0-9-]*\)([0-9\.rc]*)/echo "\1:"; gem specification \1 licenses/g' | sh

(As an annoying note, only about 6 of the gems that I'm using provide this information in the Gemspec)

@indirect

This comment has been minimized.

Show comment
Hide comment
@indirect

indirect Jul 18, 2012

Member

You can also use bundle show --paths to search for LICENSE files, which may be more helpful.

Member

indirect commented Jul 18, 2012

You can also use bundle show --paths to search for LICENSE files, which may be more helpful.

@iwz

This comment has been minimized.

Show comment
Hide comment
@iwz

iwz Dec 1, 2012

For what it's worth, the license_finder gem is a useful utility for managing your dependencies' licenses.

https://github.com/pivotal/LicenseFinder

iwz commented Dec 1, 2012

For what it's worth, the license_finder gem is a useful utility for managing your dependencies' licenses.

https://github.com/pivotal/LicenseFinder

@indirect

This comment has been minimized.

Show comment
Hide comment
@indirect

indirect Jan 23, 2013

Member

I'm merging this for now, with the intent to pull it into a plugin once those are working.

Member

indirect commented Jan 23, 2013

I'm merging this for now, with the intent to pull it into a plugin once those are working.

indirect added a commit that referenced this pull request Jan 23, 2013

Merge pull request #1898 from bryanwoods/master
Added a `bundle licenses` cli task

@indirect indirect merged commit cab01e6 into bundler:master Jan 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment