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

Merged
merged 1 commit into from
Jun 30, 2020
Merged

Conversation

utkarsh2102
Copy link
Contributor

Hi again @pboling 👋

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

➜  rspec-pending_for git:(master)  rubocop --only Packaging

Inspecting 26 files
......................C...

Offenses:

rspec-pending_for.gemspec:16: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)/}) }
                       ^^^^^^^^^^^^^^^^^

26 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>
@pboling pboling merged commit 1afd64d into pboling:master Jun 30, 2020
@pboling
Copy link
Owner

pboling commented Jun 30, 2020

@utkarsh2102 ❤️

@utkarsh2102 utkarsh2102 deleted the drop-git branch June 30, 2020 19:33
@utkarsh2102
Copy link
Contributor Author

Thank you so much, @pboling! You're the best! ❤️
Whenever you have some time, would you mind cutting a release for both, rspec-stubbed_env and rspec-pending_for? 😄

@pboling
Copy link
Owner

pboling commented Jun 30, 2020

@utkarsh2102 I will soon!

@utkarsh2102
Copy link
Contributor Author

utkarsh2102 commented Jun 30, 2020

I will soon!

Awesome, thank you! 🎉
(just btw, in case you missed it, I posted an answer to your question here: pboling/rspec-stubbed_env#5 (comment) 😄)

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.

2 participants