Skip to content

chore: omit spec/ from .gem file #551

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

Merged
merged 1 commit into from
Mar 26, 2021
Merged

chore: omit spec/ from .gem file #551

merged 1 commit into from
Mar 26, 2021

Conversation

mroach
Copy link
Contributor

@mroach mroach commented Mar 25, 2021

The test_files attribute was already being set in twilio-ruby.gemspec, but this does not prevent the test files from being added to the .gem bundle and installed onto the system/image.

Prevent spec/test files from being added to the bundle in the first place by adding a reject filter. This practice is now the default when creating new gems: https://github.com/rubygems/rubygems/blob/85677a06a727d5053e9f4a3f13355775ed1e0fd5/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt#L27-L31

This change shrinks the disk space used by about ~4.5 MB:

du -sh /opt/local/lib/ruby/gems/2.7.0/gems/twilio-ruby-5.*
13M     /opt/local/lib/ruby/gems/2.7.0/gems/twilio-ruby-5.48.0
8.6M    /opt/local/lib/ruby/gems/2.7.0/gems/twilio-ruby-5.50.0

Fixes

A short description of what this PR does.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
    I don't believe there is a realistic way to test this. I tested it manually, if that counts.
  • I have added the necessary documentation about the functionality in the appropriate .md file
    I don't believe this applies
  • I have added inline documentation to the code I modified
    I don't believe this is required.

If you have questions, please file a support ticket, or create a GitHub Issue in this repository.

The 'test_files' attribute was already being set, but this does not prevent the test files from being added to the .gem bundle.

Prevent spec/test files from being added to the bundle in the first place.
Copy link
Contributor

@JenniferMah JenniferMah left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the contribution!

@JenniferMah JenniferMah merged commit 790a21c into twilio:main Mar 26, 2021
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