Skip to content

Commit

Permalink
Don't package test files with gem [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Oct 8, 2014
1 parent c85a4fe commit 27ce6b0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions delayed_job.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ Gem::Specification.new do |spec|
spec.authors = ['Brandon Keepers', 'Brian Ryckbost', 'Chris Gaffney', 'David Genord II', 'Erik Michaels-Ober', 'Matt Griffin', 'Steve Richert', 'Tobias Lütke']
spec.description = 'Delayed_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background. It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks.'
spec.email = ['brian@collectiveidea.com']
spec.files = %w[CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md Rakefile delayed_job.gemspec]
spec.files += Dir.glob('{contrib,lib,recipes,spec}/**/*')
spec.files = %w[CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md delayed_job.gemspec]
spec.files += Dir['{contrib,lib,recipes}/**/*']
spec.homepage = 'http://github.com/collectiveidea/delayed_job'
spec.licenses = ['MIT']
spec.name = 'delayed_job'
spec.require_paths = ['lib']
spec.summary = 'Database-backed asynchronous priority queue system -- Extracted from Shopify'
spec.test_files = Dir.glob('spec/**/*')
spec.version = '4.0.4'
end

3 comments on commit 27ce6b0

@albus522
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I know most people don't use it, isn't this an intentional feature of ruby gems?
Also the spec directory is roughly 72K uncompressed so this probably doesn't save much.

@sferik
Copy link
Collaborator Author

@sferik sferik commented on 27ce6b0 Oct 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@albus522 I made recently made the case for changing this default (in Bundler) here: rubygems/bundler#3207 and then applied that changed to all of the projects I help maintain. I just built the gem twice, before and after this commit. The size before is 36,352 bytes; the size after is 29,696 bytes. In absolute terms, a savings of 6,656 bytes (compressed) does not seem very significant but, in relative terms, it reduces the file size by 20% so installation should be about 20% faster (saving both bandwidth and CPU time to uncompress more files). I suspect more than 99% of users who install this gem never run the tests (rubygems tooling for this is very poor). Therefore, I think it’s a worthwhile tradeoff to make delayed_job installation about 20% faster. If every gem did this, it could significantly improve the performance of bundle install or deploying to Heroku, for example. The (less than) 1% of users who want to run the tests can clone the repo but I don’t think that’s the use-case we should optimizing for. Most people who run the tests are doing so because they’re working on a patch or pull request, so they’ll need to clone the repo anyway.

Of course, if you disagree, feel free to revert this change.

@sferik
Copy link
Collaborator Author

@sferik sferik commented on 27ce6b0 Dec 22, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@albus522 Reverted in b047b91.

Please sign in to comment.