Skip to content

Reduce gem size by excluding test files#177

Open
yuri-zubov wants to merge 1 commit intobasecamp:mainfrom
yuri-zubov:reduce-gem-size
Open

Reduce gem size by excluding test files#177
yuri-zubov wants to merge 1 commit intobasecamp:mainfrom
yuri-zubov:reduce-gem-size

Conversation

@yuri-zubov
Copy link

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

$ gem build -o before.tar.gz

$ git switch reduce-gem-size

$ gem build -o after.tar.gz

du -sh before.tar.gz after.tar.gz
784K	before.tar.gz
 12K	after.tar.gz
Metric Before After Saved
Size 784K 12K −772K (⏷ −98.46%)

whitch files was deleted?

data
 ├── app
 │   ├── assets
 │   │   └── javascripts
 │   │       ├── local-time.es2017-esm.js
 │   │       └── local-time.es2017-umd.js
 │   └── helpers
 │       └── local_time_helper.rb
 ├── lib
 │   ├── local_time
 │   │   └── version.rb
 │   └── local_time.rb
 ├── MIT-LICENSE
 ├── README.md
-└── test
-    ├── helpers
-    │   └── local_time_helper_test.rb
-    └── javascripts
-        ├── fixtures
-        │   ├── index.html
-        │   └── time_zone_check.html
-        ├── server.mjs
-        ├── src
-        │   ├── format24_test.js
-        │   ├── i18n_test.js
-        │   ├── index.js
-        │   ├── local_time_test.js
-        │   ├── relative_date_test.js
-        │   ├── strftime_test.js
-        │   ├── test_helpers.js
-        │   └── time_ago_test.js
-        └── vendor
-            ├── moment.js
-            └── sinon.js

ps: you can see on rails repo

s.license = "MIT"

s.files = Dir["app/**/*", "lib/local_time.rb", "lib/local_time/**/*", "MIT-LICENSE", "README.md"]
s.test_files = Dir["test/**/*"]
Copy link
Author

@yuri-zubov yuri-zubov Feb 1, 2026

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.

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.

1 participant

Comments