File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,14 @@ Gem::Specification.new do |s|
3232
3333 s . add_development_dependency 'rspec' , '~> 3.6' , '>= 3.6.0'
3434
35- s . files = `find *` . split ( "\n " ) . uniq . sort . select { |f | !f . empty? }
36- s . test_files = `find spec/*` . split ( "\n " )
37- s . executables = [ ]
35+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
36+ gemspec = File . basename ( __FILE__ )
37+ s . files = IO . popen ( %w[ git ls-files -z ] , chdir : __dir__ , err : IO ::NULL ) do |ls |
38+ ls . readlines ( "\x0 " , chomp : true ) . reject do |f |
39+ ( f == gemspec ) ||
40+ f . start_with? ( *%w[ bin/ test/ spec/ features/ .git .github appveyor Gemfile ] )
41+ end
42+ end
43+ s . executables = s . files . grep ( %r{\A exe/} ) { |f | File . basename ( f ) }
3844 s . require_paths = [ "lib" ]
3945end
You can’t perform that action at this time.
0 commit comments