cucumber / cucumber-rails

Rails Generators for Cucumber with special support for Capybara and DatabaseCleaner
https://github.com/cucumber/cucumber-rails
MIT License
1.02k stars 327 forks source link

Drop `git ls-files` in gemspec #476

Closed utkarsh2102 closed 4 years ago

utkarsh2102 commented 4 years ago

Hi,

Thanks again for working on this! :heart: However, while maintaining this in Debian, we found that this library relies on git to list the files which could be done via pure Ruby alternative -- which is what this PR does.

Also, added rubocop-packaging as a development_dependency which will ensure the best practices. Here's what it shows:

Inspecting 33 files
...C.............................

Offenses:

cucumber-rails.gemspec:49:24: C: Packaging/GemspecGit: Avoid using git to produce lists of files.
Downstreams often need to build your package in an environment that does not have git (on purpose).
Use some pure Ruby alternative, like Dir or Dir.glob.
  s.files            = `git ls-files`.split("\n")
                       ^^^^^^^^^^^^^^

cucumber-rails.gemspec:50:24: C: Packaging/GemspecGit: Avoid using git to produce lists of files.
Downstreams often need to build your package in an environment that does not have git (on purpose).
Use some pure Ruby alternative, like Dir or Dir.glob.
  s.test_files       = `git ls-files -- {spec,features}/*`.split("\n")
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

33 files inspected, 2 offense detected

And this PR fixes the same, which helps us in shipping this in Debian! :tada: Hope this would make sense and you'll be open to this change :100:

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>


CC: @luke-hill :smile: Closes: #475

aslakhellesoy commented 4 years ago

Hi @utkarsh2102,

Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾

In return for this generous offer we hope you will:

On behalf of the Cucumber core team, Aslak Hellesøy Creator of Cucumber

utkarsh2102 commented 4 years ago

Wow, thank you, @luke-hill and @aslakhellesoy :heart: