Skip to content

Reduce gem size by excluding test files#65

Open
yuri-zubov wants to merge 1 commit into
igorkasyanchuk:masterfrom
yuri-zubov:reduce-gem-size
Open

Reduce gem size by excluding test files#65
yuri-zubov wants to merge 1 commit into
igorkasyanchuk:masterfrom
yuri-zubov:reduce-gem-size

Conversation

@yuri-zubov
Copy link
Copy Markdown

@yuri-zubov yuri-zubov commented Jan 31, 2026

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
76K   before.tar.gz
12K   after.tar.gz
Metric Before After Saved
Size 76K 12K −64K (⏷ −84.2%)

whitch files was deleted?

 data
├── app
│   ├── assets
│   │   └── stylesheets
│   │       └── any_login
│   │           └── application.css
│   ├── controllers
│   │   └── any_login
│   │       └── application_controller.rb
│   └── views
│       └── any_login
│           ├── _any_login.html.erb
│           ├── assets
│           │   ├── _css.html.erb
│           │   └── _js.html.erb
│           └── svg
│               └── _user.html.erb
├── config
│   └── routes.rb
├── lib
│   ├── any_login
│   │   ├── collection.rb
│   │   ├── engine.rb
│   │   ├── helpers.rb
│   │   ├── providers
│   │   │   ├── authlogic.rb
│   │   │   ├── clearance.rb
│   │   │   ├── devise.rb
│   │   │   └── sorcery.rb
│   │   ├── routes.rb
│   │   └── version.rb
│   ├── any_login.rb
│   └── generators
│       └── any_login
│           ├── any_login_generator.rb
│           ├── templates
│           │   └── any_login.rb
│           └── USAGE
├── MIT-LICENSE
-├── Rakefile
-└── test
-    ├── authlogic
-    │   ├── integration
-    │   │   └── navigation_test.rb
-    │   └── test_helper_authlogic.rb
-    ├── clearance
-    │   ├── integration
-    │   │   └── navigation_test.rb
-    │   └── test_helper_clearance.rb
-    ├── devise
-    │   ├── integration
-    │   │   └── navigation_test.rb
-    │   ├── test_helper_devise.rb
-    │   └── unit
-    │       ├── any_login_test.rb
-    │       └── collection_test.rb
-    ├── rails_apps
-    │   ├── authlogic
-    │   │   ├── app
-    │   │   │   ├── assets
-    │   │   │   │   └── config
-    │   │   │   │       └── manifest.js
-    │   │   │   ├── controllers
-    │   │   │   │   ├── application_controller.rb
-    │   │   │   │   ├── home_controller.rb
-    │   │   │   │   └── user_sessions_controller.rb
-    │   │   │   ├── models
-    │   │   │   │   ├── user_session.rb
-    │   │   │   │   └── user.rb
-    │   │   │   └── views
-    │   │   │       ├── home
-    │   │   │       │   ├── about.html.erb
-    │   │   │       │   └── index.html.erb
-    │   │   │       ├── layouts
-    │   │   │       │   └── application.html.erb
-    │   │   │       ├── shared
-    │   │   │       │   ├── _footer.html.erb
-    │   │   │       │   └── _header.html.erb
-    │   │   │       └── user_sessions
-    │   │   │           └── new.html.erb
-    │   │   ├── bin
-    │   │   │   ├── rails
-    │   │   │   ├── rake
-    │   │   │   └── setup
-    │   │   ├── config
-    │   │   │   ├── application.rb
-    │   │   │   ├── boot.rb
-    │   │   │   ├── database.yml
-    │   │   │   ├── environment.rb
-    │   │   │   ├── environments
-    │   │   │   │   ├── development.rb
-    │   │   │   │   ├── production.rb
-    │   │   │   │   └── test.rb
-    │   │   │   ├── initializers
-    │   │   │   │   ├── any_login.rb
-    │   │   │   │   ├── assets.rb
-    │   │   │   │   ├── filter_parameter_logging.rb
-    │   │   │   │   ├── inflections.rb
-    │   │   │   │   └── sorcery.rb
-    │   │   │   ├── locales
-    │   │   │   │   └── en.yml
-    │   │   │   ├── routes.rb
-    │   │   │   └── storage.yml
-    │   │   ├── config.ru
-    │   │   ├── db
-    │   │   │   ├── migrate
-    │   │   │   │   ├── 20150907190739_create_users.rb
-    │   │   │   │   ├── 20150907190846_add_devise_to_users.rb
-    │   │   │   │   ├── 20150928123254_change_users.rb
-    │   │   │   │   └── 20220825195914_populate_test_users.rb
-    │   │   │   └── schema.rb
-    │   │   ├── public
-    │   │   │   ├── 404.html
-    │   │   │   ├── 422.html
-    │   │   │   ├── 500.html
-    │   │   │   └── favicon.ico
-    │   │   └── Rakefile
-    │   ├── clearance
-    │   │   ├── app
-    │   │   │   ├── assets
-    │   │   │   │   └── config
-    │   │   │   │       └── manifest.js
-    │   │   │   ├── controllers
-    │   │   │   │   ├── application_controller.rb
-    │   │   │   │   └── home_controller.rb
-    │   │   │   ├── models
-    │   │   │   │   ├── user_session.rb
-    │   │   │   │   └── user.rb
-    │   │   │   └── views
-    │   │   │       ├── home
-    │   │   │       │   ├── about.html.erb
-    │   │   │       │   └── index.html.erb
-    │   │   │       ├── layouts
-    │   │   │       │   └── application.html.erb
-    │   │   │       └── shared
-    │   │   │           ├── _footer.html.erb
-    │   │   │           └── _header.html.erb
-    │   │   ├── bin
-    │   │   │   ├── rails
-    │   │   │   ├── rake
-    │   │   │   └── setup
-    │   │   ├── config
-    │   │   │   ├── application.rb
-    │   │   │   ├── boot.rb
-    │   │   │   ├── database.yml
-    │   │   │   ├── environment.rb
-    │   │   │   ├── environments
-    │   │   │   │   ├── development.rb
-    │   │   │   │   ├── production.rb
-    │   │   │   │   └── test.rb
-    │   │   │   ├── initializers
-    │   │   │   │   ├── any_login.rb
-    │   │   │   │   ├── assets.rb
-    │   │   │   │   ├── clearance.rb
-    │   │   │   │   ├── filter_parameter_logging.rb
-    │   │   │   │   └── inflections.rb
-    │   │   │   ├── locales
-    │   │   │   │   └── en.yml
-    │   │   │   ├── routes.rb
-    │   │   │   └── storage.yml
-    │   │   ├── config.ru
-    │   │   ├── db
-    │   │   │   ├── migrate
-    │   │   │   │   ├── 20150907190739_create_users.rb
-    │   │   │   │   ├── 20150907190846_add_devise_to_users.rb
-    │   │   │   │   ├── 20150909210357_populate_test_users.rb
-    │   │   │   │   └── 20151007170422_add_clearance_to_users.rb
-    │   │   │   └── schema.rb
-    │   │   ├── public
-    │   │   │   ├── 404.html
-    │   │   │   ├── 422.html
-    │   │   │   ├── 500.html
-    │   │   │   └── favicon.ico
-    │   │   └── Rakefile
-    │   ├── devise
-    │   │   ├── app
-    │   │   │   ├── assets
-    │   │   │   │   └── config
-    │   │   │   │       └── manifest.js
-    │   │   │   ├── controllers
-    │   │   │   │   ├── application_controller.rb
-    │   │   │   │   └── home_controller.rb
-    │   │   │   ├── models
-    │   │   │   │   └── user.rb
-    │   │   │   └── views
-    │   │   │       ├── home
-    │   │   │       │   ├── about.html.erb
-    │   │   │       │   └── index.html.erb
-    │   │   │       ├── layouts
-    │   │   │       │   └── application.html.erb
-    │   │   │       └── shared
-    │   │   │           ├── _footer.html.erb
-    │   │   │           └── _header.html.erb
-    │   │   ├── bin
-    │   │   │   ├── rails
-    │   │   │   ├── rake
-    │   │   │   └── setup
-    │   │   ├── config
-    │   │   │   ├── application.rb
-    │   │   │   ├── boot.rb
-    │   │   │   ├── database.yml
-    │   │   │   ├── environment.rb
-    │   │   │   ├── environments
-    │   │   │   │   ├── development.rb
-    │   │   │   │   ├── production.rb
-    │   │   │   │   └── test.rb
-    │   │   │   ├── initializers
-    │   │   │   │   ├── any_login.rb
-    │   │   │   │   ├── assets.rb
-    │   │   │   │   ├── devise.rb
-    │   │   │   │   ├── filter_parameter_logging.rb
-    │   │   │   │   └── inflections.rb
-    │   │   │   ├── locales
-    │   │   │   │   └── en.yml
-    │   │   │   ├── routes.rb
-    │   │   │   └── storage.yml
-    │   │   ├── config.ru
-    │   │   ├── db
-    │   │   │   ├── migrate
-    │   │   │   │   ├── 20150907190739_create_users.rb
-    │   │   │   │   ├── 20150907190846_add_devise_to_users.rb
-    │   │   │   │   └── 20150909210357_populate_test_users.rb
-    │   │   │   └── schema.rb
-    │   │   ├── public
-    │   │   │   ├── 404.html
-    │   │   │   ├── 422.html
-    │   │   │   ├── 500.html
-    │   │   │   └── favicon.ico
-    │   │   └── Rakefile
-    │   └── sorcery
-    │       ├── app
-    │       │   ├── assets
-    │       │   │   └── config
-    │       │   │       └── manifest.js
-    │       │   ├── controllers
-    │       │   │   ├── application_controller.rb
-    │       │   │   └── home_controller.rb
-    │       │   ├── models
-    │       │   │   └── user.rb
-    │       │   └── views
-    │       │       ├── home
-    │       │       │   ├── about.html.erb
-    │       │       │   └── index.html.erb
-    │       │       ├── layouts
-    │       │       │   └── application.html.erb
-    │       │       └── shared
-    │       │           ├── _footer.html.erb
-    │       │           └── _header.html.erb
-    │       ├── bin
-    │       │   ├── rails
-    │       │   ├── rake
-    │       │   └── setup
-    │       ├── config
-    │       │   ├── application.rb
-    │       │   ├── boot.rb
-    │       │   ├── database.yml
-    │       │   ├── environment.rb
-    │       │   ├── environments
-    │       │   │   ├── development.rb
-    │       │   │   ├── production.rb
-    │       │   │   └── test.rb
-    │       │   ├── initializers
-    │       │   │   ├── any_login.rb
-    │       │   │   ├── assets.rb
-    │       │   │   ├── filter_parameter_logging.rb
-    │       │   │   ├── inflections.rb
-    │       │   │   └── sorcery.rb
-    │       │   ├── locales
-    │       │   │   └── en.yml
-    │       │   ├── routes.rb
-    │       │   └── storage.yml
-    │       ├── config.ru
-    │       ├── db
-    │       │   ├── migrate
-    │       │   │   ├── 20150907190739_create_users.rb
-    │       │   │   ├── 20150907190846_add_devise_to_users.rb
-    │       │   │   ├── 20150909210357_add_role_to_users.rb
-    │       │   │   ├── 20151019154558_sorcery_core.rb
-    │       │   │   └── 20220827040518_populate_test_users.rb
-    │       │   └── schema.rb
-    │       ├── public
-    │       │   ├── 404.html
-    │       │   ├── 422.html
-    │       │   ├── 500.html
-    │       │   └── favicon.ico
-    │       └── Rakefile
-    ├── sorcery
-    │   ├── integration
-    │   │   └── navigation_test.rb
-    │   └── test_helper_sorcery.rb
-    └── test_helper_common.rb

ps: you can see on rails repo

Comment thread any_login.gemspec
s.license = "MIT"

s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
s.test_files = Dir["test/**/*"]
Copy link
Copy Markdown
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