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 #25

Merged
merged 2 commits into from Jul 16, 2020
Merged

Conversation

utkarsh2102
Copy link
Contributor

Hi @tarcieri,

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:

➜  ed25519:(master) rubocop --only Packaging

Inspecting 14 files
..C..........

Offenses:

ed25519.gemspec:17: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").reject { |f| f.match(%r{^(test|spec|features)/}) }
                       ^^^^^^^^^^^^^^^^^

14 files inspected, 1 offense 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 <utkarsh@debian.org>

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
@utkarsh2102
Copy link
Contributor Author

Oh wait, something's wrong with lint, that's weird..
So I am marking this as WIP and will ping you once it's worked out.

@utkarsh2102 utkarsh2102 changed the title Drop git ls-files in gemspec WIP: Drop git ls-files in gemspec Jul 16, 2020
@utkarsh2102 utkarsh2102 changed the title WIP: Drop git ls-files in gemspec Drop git ls-files in gemspec Jul 16, 2020
@utkarsh2102
Copy link
Contributor Author

@tarcieri, fixed, CI is green again! 🎉

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
@tarcieri tarcieri merged commit 2448332 into RubyCrypto:master Jul 16, 2020
@tarcieri
Copy link
Collaborator

Thanks!

@utkarsh2102 utkarsh2102 deleted the drop-git branch July 16, 2020 14:44
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.

None yet

2 participants