Skip to content

Reduce gem size by excluding test files#137

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

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

Conversation

@yuri-zubov
Copy link
Copy Markdown

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
 352K	before.tar
 16K	after.tar
Metric Before After Saved
Size 352K 16K −336K (⏷ −95.5%)

whitch files was deleted?

data
-├── .github
-│   └── workflows
-│       └── test.yml
 ├── lib
 │   ├── creek
 │   │   ├── styles
 │   │   │   ├── constants.rb
 │   │   │   ├── converter.rb
 │   │   │   └── style_types.rb
 │   │   ├── book.rb
 │   │   ├── drawing.rb
 │   │   ├── shared_strings.rb
 │   │   ├── sheet.rb
 │   │   ├── styles.rb
 │   │   ├── utils.rb
 │   │   └── version.rb
 │   └── creek.rb
-├── spec
-│   ├── fixtures
-│   │   ├── sheets
-│   │   │   ├── sample_dates.xlsx
-│   │   │   ├── sheet1.xml
-│   │   │   └── single_data_programme.xlsx
-│   │   ├── styles
-│   │   │   └── first.xml
-│   │   ├── escaped.xlsx
-│   │   ├── escaped2.xlsx
-│   │   ├── invalid.xls
-│   │   ├── large_numbers.xlsx
-│   │   ├── sample_dates.xlsx
-│   │   ├── sample_namespaced.xlsx
-│   │   ├── sample-as-zip.zip
-│   │   ├── sample-with-headers_namespaced.xlsx
-│   │   ├── sample-with-headers.xlsx
-│   │   ├── sample-with-images.xlsx
-│   │   ├── sample-with-one-cell-anchored-images.xlsx
-│   │   ├── sample.xlsx
-│   │   ├── sst_namespaced.xml
-│   │   ├── sst.xml
-│   │   └── temp_string_io_file_path_with_no_extension
-│   ├── styles
-│   │   ├── converter_spec.rb
-│   │   └── style_types_spec.rb
-│   ├── .DS_Store
-│   ├── drawing_spec.rb
-│   ├── shared_string_spec.rb
-│   ├── sheet_spec.rb
-│   ├── spec_helper.rb
-│   └── test_spec.rb
-├── .gitignore
-├── .rubocop.yml
-├── creek.gemspec
-├── Gemfile
 ├── LICENSE.txt
-├── Rakefile
 └── README.md

ps: you can see on rails repo

Comment thread creek.gemspec

spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
Copy link
Copy Markdown
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.

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