Skip to content

Reduce gem size by excluding test files#397

Merged
numbata merged 1 commit intoruby-grape:masterfrom
yuri-zubov:reduce-gem-size
Apr 15, 2026
Merged

Reduce gem size by excluding test files#397
numbata merged 1 commit intoruby-grape:masterfrom
yuri-zubov:reduce-gem-size

Conversation

@yuri-zubov
Copy link
Copy Markdown
Contributor

This pull request updates the *.gemspec file to optimize the gem package size and structure

$ gem build -o before.tar

$ git switch reduce-gem-size

$ gem build -o after.tar

$ du -sh before.tar after.tar
 48K	before.tar
 28K	after.tar
Metric Before After Saved
Size 48K 28K −20K (⏷ −41.7%)

whitch files was deleted?

data
-├── .github
-│   ├── workflows
-│   │   └── ci.yml
-│   └── dependabot.yml
-├── bench
-│   └── serializing.rb
 ├── lib
 │   ├── grape_entity
 │   │   ├── condition
 │   │   │   ├── base.rb
 │   │   │   ├── block_condition.rb
 │   │   │   ├── hash_condition.rb
 │   │   │   └── symbol_condition.rb
 │   │   ├── delegator
 │   │   │   ├── base.rb
 │   │   │   ├── hash_object.rb
 │   │   │   ├── openstruct_object.rb
 │   │   │   └── plain_object.rb
 │   │   ├── exposure
 │   │   │   ├── nesting_exposure
 │   │   │   │   ├── nested_exposures.rb
 │   │   │   │   └── output_builder.rb
 │   │   │   ├── base.rb
 │   │   │   ├── block_exposure.rb
 │   │   │   ├── delegator_exposure.rb
 │   │   │   ├── formatter_block_exposure.rb
 │   │   │   ├── formatter_exposure.rb
 │   │   │   ├── nesting_exposure.rb
 │   │   │   └── represent_exposure.rb
 │   │   ├── condition.rb
 │   │   ├── delegator.rb
 │   │   ├── deprecated.rb
 │   │   ├── entity.rb
 │   │   ├── exposure.rb
 │   │   ├── json.rb
 │   │   ├── options.rb
 │   │   └── version.rb
 │   ├── grape_entity.rb
 │   └── grape-entity.rb
-├── spec
-│   ├── grape_entity
-│   │   ├── exposure
-│   │   │   ├── nesting_exposure
-│   │   │   │   └── nested_exposures_spec.rb
-│   │   │   └── represent_exposure_spec.rb
-│   │   ├── entity_spec.rb
-│   │   ├── exposure_spec.rb
-│   │   ├── hash_spec.rb
-│   │   ├── json_spec.rb
-│   │   └── options_spec.rb
-│   └── spec_helper.rb
-├── .coveralls.yml
-├── .gitignore
-├── .rspec
-├── .rubocop_todo.yml
-├── .rubocop.yml
-├── .yardopts
 ├── CHANGELOG.md
-├── CONTRIBUTING.md
-├── Dangerfile
-├── Gemfile
-├── grape-entity.gemspec
-├── Guardfile
 ├── LICENSE
-├── Rakefile
 ├── README.md
-├── RELEASING.md
-└── UPGRADING.md

ps: you can see on rails repo

Comment thread grape-entity.gemspec
s.add_dependency 'activesupport', '>= 3.0.0'

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec}/*`.split("\n")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The test_files directive is no longer used by RubyGems.org.

@numbata
Copy link
Copy Markdown
Collaborator

numbata commented Apr 14, 2026

@yuri-zubov thanks for PR. Absolutely make sense!

@numbata
Copy link
Copy Markdown
Collaborator

numbata commented Apr 14, 2026

May I ask you to update CHANGELOG.md ?

@yuri-zubov
Copy link
Copy Markdown
Contributor Author

May I ask you to update CHANGELOG.md ?

done

@github-actions
Copy link
Copy Markdown

Danger Report

No issues found.

View run

@numbata
Copy link
Copy Markdown
Collaborator

numbata commented Apr 15, 2026

Thanks @yuri-zubov! This is a nice cleanup! Merging.

@numbata numbata merged commit 65d41f1 into ruby-grape:master Apr 15, 2026
7 checks passed
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