Skip to content

Commit

Permalink
Reduce gem size (#258)
Browse files Browse the repository at this point in the history
The current published gem includes test files or build files that are actually unneeded.
This change removes such files from a published gem.

In addition, this removes `test_files` from the gemspec since it is no longer supported.
See https://guides.rubygems.org/specification-reference/

Verification:

```console
$ bundle exec rake build && gem unpack pkg/*.gem
public_suffix 5.0.3 built to pkg/public_suffix-5.0.3.gem.
Unpacked gem: '/Users/masafumi.koba/git/ybiquitous/publicsuffix-ruby/public_suffix-5.0.3'

$ tree public_suffix-*
public_suffix-5.0.3/
├── .yardopts
├── 2.0-Upgrade.md
├── CHANGELOG.md
├── LICENSE.txt
├── README.md
├── SECURITY.md
├── data/
│   └── list.txt
└── lib/
    ├── public_suffix/
    │   ├── domain.rb
    │   ├── errors.rb
    │   ├── list.rb
    │   ├── rule.rb
    │   └── version.rb
    └── public_suffix.rb

4 directories, 13 files
```
  • Loading branch information
ybiquitous authored Aug 31, 2023
1 parent 3500941 commit 4883fbd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions public_suffix.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Gem::Specification.new do |s|
s.required_ruby_version = ">= 2.6"

s.require_paths = ["lib"]
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.files = `git ls-files -z`.split("\x0").reject { |f| (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ .git .rubocop Gemfile Rakefile]) }
s.extra_rdoc_files = %w( LICENSE.txt )
end

0 comments on commit 4883fbd

Please sign in to comment.