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

Merged
merged 1 commit into from Jul 3, 2020
Merged

Drop git ls-files in gemspec #59

merged 1 commit into from Jul 3, 2020

Conversation

utkarsh2102
Copy link
Contributor

Hi @arnau,

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 us:

➜  ISO8601 git:(master)  rubocop --only Packaging

Offenses:

iso8601.gemspec:19:54: 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 =  %w{LICENSE README.md CONTRIBUTING.md} + `git ls-files`.split("\n").select { |f| f =~ %r{^(?:lib/)}i }
                                                     ^^^^^^^^^^^^^^

31 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>
@arnau arnau merged commit fb3ee52 into arnau:master Jul 3, 2020
@arnau
Copy link
Owner

arnau commented Jul 3, 2020

Thanks for this @utkarsh2102, always nice to remove dependencies :)

I'll release it shortly.

@utkarsh2102 utkarsh2102 deleted the drop-git branch July 3, 2020 16:42
@utkarsh2102
Copy link
Contributor Author

Aha, I see you're looking for help (and possibly for a new maintainer).
Perhaps, I can at least, help in keeping things updated and take care of your baby in the best way I can! 😄

@utkarsh2102
Copy link
Contributor Author

There are some more general RuboCop offenses I see. D'you want me to possibly raise yet another PR for that?
(and you can pick the things you want to keep! :))

@arnau
Copy link
Owner

arnau commented Jul 3, 2020

Aha, I see you're looking for help (and possibly for a new maintainer).
Perhaps, I can at least, help in keeping things updated and take care of your baby in the best way I can! 😄

That would be greatly appreciated :)

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