WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 4d34320

Browse files
authored
Merge pull request #945 from krororo/remove-test-files
Remove unused files from package
2 parents ef42e02 + 759c46d commit 4d34320

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

draper.gemspec

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@ Gem::Specification.new do |s|
1010
s.description = "Draper adds an object-oriented layer of presentation logic to your Rails apps."
1111
s.license = "MIT"
1212

13-
s.files = `git ls-files`.split("\n")
14-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
13+
# Specify which files should be added to the gem when it is released.
14+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
15+
gemspec = File.basename(__FILE__)
16+
s.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
17+
ls.readlines("\x0", chomp: true).reject do |f|
18+
(f == gemspec) ||
19+
f.start_with?(*%w[bin/ test/ spec/ features/ .git appveyor Gemfile])
20+
end
21+
end
1522
s.require_paths = ["lib"]
1623

1724
s.required_ruby_version = '>= 2.2.2'

0 commit comments

Comments
 (0)