Gemspec Included Files Recomendation

26 views
Skip to first unread message

Faraz Yashar

unread,
Jul 16, 2015, 11:37:34 AM7/16/15
to rubygems-...@googlegroups.com

I’ve recently begun publishing a number of small gems, and I’m not clear on what files should included in a gemspec’s file directive.

This confusion initially arose since the RubyGems specification guide includes tests…

require 'rake'
spec.files = Dir['lib/   *.rb'] + Dir['bin/*']
spec.files += Dir['[A-Z]*'] + Dir['test/**/*']
spec.files.reject! { |fn| fn.include? "CVS" }

…while Bundler excludes all tests with it’s own voodoo: git ls-files -z.split(“\x0”).reject { |f| f.match(%r{^(test|spec|features)/}) }`

I also sifted through unpacked gems written by people I respect and admire tremendously, and there doesn’t seem to be an appreciable pattern.

The files that clearly MUST be included are files necessary to use the gem (e.g. /lib) and any additional files required to build the documentation such as the README. The following is still unclear:

  • Should the license be included?
  • Should tests be included?
  • What about the Rakefile?
  • What about the gemspec?
  • Anything I’m missing?

I’d greatly appreciate some insight from you all, and I feel like the community would greatly benefit if the decided best practice were documented in the specification guide as well.

Thanks!
Faraz

Reply all
Reply to author
Forward
0 new messages