license-cop icon indicating copy to clipboard operation
license-cop copied to clipboard

[AG-30] Parse git_source section from Gemfile and mark as "internal" Ruby dependencies with organization URLs

Open felipead opened this issue 7 years ago • 0 comments

Inside Ruby's Gemfile we can declare a git source with the git_source block. This will give us a git URL were bundler should fetch the package from. Example:

git_source(:acme) do |repo_name|
  "https://x-oauth-basic:[email protected]/acme/#{repo_name}.git"
end

Then we can declare packages like:

gem 'foo-sdk', acme: 'foo-ruby-sdk', tag: 'v2017.10.16'
gem 'graphitti', acme: 'graphitti'
gem 'hyperfoo-rb', acme: 'hyperfoo-rb'
gem 'neo_form', acme: 'neo_form'
gem 'neo_list', acme: 'neo_list'
gem 's3d', acme: 's3d', branch: 'add_remote_name_flag'
gem 'top-rspec-matchers', acme: 'top-rspec-matchers'
gem 'declutter', acme: 'declutter'

We should mark these dependencies as "internal", and not process them.

To make this detection organization-agnostic, we can match the GitHub url that was given as input to license-cop with the url declared inside the git_source block.

felipead avatar Jan 11 '18 00:01 felipead