Skip to content

Commit

Permalink
Package fewer files in the gem
Browse files Browse the repository at this point in the history
* Do not distribute test files
* Do not distribute the intermediate api_names_out.yaml file

> Reduces the packaged gem size from 1.8Mb to 1.6Mb

The practice of not distributing test files with a gem was originally
discussed and adopted by the Bundler team here:
rubygems/bundler#3207
  • Loading branch information
teeparham committed Apr 17, 2016
1 parent 0bb3352 commit 5ce622c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions google-api-client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ Gem::Specification.new do |spec|
spec.homepage = 'https://github.com/google/google-api-ruby-client'
spec.license = 'Apache 2.0'

spec.files = `git ls-files -z`.split("\x0")
spec.files = `git ls-files -z`
.split("\x0")
.reject { |f| f.match(%r{^(spec|script)/|^api_names_out}) }

spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib', 'generated', 'third_party']

spec.required_ruby_version = '~> 2.0'
Expand Down

0 comments on commit 5ce622c

Please sign in to comment.