summaryrefslogtreecommitdiff
path: root/lib/tmpdir.gemspec
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tmpdir.gemspec')
-rw-r--r--lib/tmpdir.gemspec7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/tmpdir.gemspec b/lib/tmpdir.gemspec
index a7463105fa..15fbd1d4c8 100644
--- a/lib/tmpdir.gemspec
+++ b/lib/tmpdir.gemspec
@@ -15,8 +15,11 @@ Gem::Specification.new do |spec|
# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
- `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
+ spec.files = Dir.chdir(__dir__) do
+ `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject do |f|
+ (File.expand_path(f) == __FILE__) ||
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git Gemfile])
+ end
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }