Skip to content
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

Drop git ls-files in gemspec #721

Merged
merged 3 commits into from
Jul 16, 2020
Merged

Conversation

utkarsh2102
Copy link
Member

@utkarsh2102 utkarsh2102 commented Jul 16, 2020

Hi,

Thanks for working on this! ❤️
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.

As an addition, this PR makes sure that this gem only ships the required files to the end-users and not other things which are not needed by them! 🚀

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

Inspecting 172 files
...C..........C.........C...........
....................................
....................................
....................................
............................

Offenses:

aruba.gemspec:48:16: 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.
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
               ^^^^^^^^^^^^^^^^^
fixtures/cli-app/cli-app.gemspec:18: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.
  spec.files         = `git ls-files -z`.split("\x0")
                       ^^^^^^^^^^^^^^^^^
fixtures/empty-app/cli-app.gemspec:18: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.
  spec.files         = `git ls-files -z`.split("\x0")
                       ^^^^^^^^^^^^^^^^^

172 files inspected, 3 offenses detected

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

Signed-off-by: Utkarsh Gupta <[email protected]>


CC: @luke-hill
Closes: #720

Signed-off-by: Utkarsh Gupta <[email protected]>
aruba.gemspec Outdated Show resolved Hide resolved
@utkarsh2102 utkarsh2102 requested a review from mvz July 16, 2020 08:22
Signed-off-by: Utkarsh Gupta <[email protected]>
Copy link
Contributor

@mvz mvz left a comment

Choose a reason for hiding this comment

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

:shipit:

@utkarsh2102 utkarsh2102 merged commit 99a9197 into cucumber:master Jul 16, 2020
@utkarsh2102 utkarsh2102 deleted the drop-git branch July 16, 2020 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop git from gemspec
3 participants