summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-02-22 17:48:47 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-05 14:55:33 +0100
commit9677d2e82e24ed8e72792fd3869db066ccd0b113 (patch)
tree3a058bdfb0b98d76e00a4b944c050c7262f01585
parent4c817e5632e596c6c811ed31bb26af64c1f0195e (diff)
downloadbundler-9677d2e82e24ed8e72792fd3869db066ccd0b113.tar.gz
Remove git subshelling from gemspec
-rw-r--r--bundler.gemspec3
-rw-r--r--spec/quality_spec.rb12
2 files changed, 13 insertions, 2 deletions
diff --git a/bundler.gemspec b/bundler.gemspec
index d849979594..d58b1d3d0c 100644
--- a/bundler.gemspec
+++ b/bundler.gemspec
@@ -46,8 +46,7 @@ Gem::Specification.new do |s|
s.add_development_dependency "rspec", "~> 3.6"
s.add_development_dependency "rubocop", "= 0.65.0"
- base_dir = File.dirname(__FILE__).gsub(%r{([^A-Za-z0-9_\-.,:\/@\n])}, "\\\\\\1")
- s.files = IO.popen("git -C #{base_dir} ls-files -z", &:read).split("\x0").select {|f| f.match(%r{^(lib|exe)/}) }
+ s.files = Dir.glob("{lib,exe}/**/*", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
# we don't check in man pages, but we need to ship them because
# we use them to generate the long-form help for each command.
diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb
index 8bdef33a79..6477a03fe4 100644
--- a/spec/quality_spec.rb
+++ b/spec/quality_spec.rb
@@ -237,6 +237,18 @@ RSpec.describe "The library itself" do
end
end
+ it "ships the correct set of files" do
+ Dir.chdir(root) do
+ git_list = IO.popen("git ls-files -z", &:read).split("\x0").select {|f| f.match(%r{^(lib|exe)/}) }
+ git_list += %w[CHANGELOG.md LICENSE.md README.md bundler.gemspec]
+ git_list += Dir.glob("man/**/*")
+
+ gem_list = Gem::Specification.load(gemspec.to_s).files
+
+ expect(git_list.to_set).to eq(gem_list.to_set)
+ end
+ end
+
it "does not contain any warnings" do
Dir.chdir(root) do
exclusions = %w[