Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit f05a45e

Browse files
Remove base_dir since not support by old rubies
The next `Dir.glob` in the gemspec does not use the `base_dir` argument, so if people are reading this gemspec from another folder, it's giving the correct list of files anyways? I can probably add compatibility code for this anyways, I just want to confirm this is the culprit for now.
1 parent 2d30d12 commit f05a45e

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

bundler.gemspec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ Gem::Specification.new do |s|
4747
s.add_development_dependency "rspec", "~> 3.6"
4848
s.add_development_dependency "rubocop", "= 0.50.0"
4949

50-
base_dir = File.dirname(__FILE__).gsub(%r{([^A-Za-z0-9_\-.,:\/@\n])}, "\\\\\\1")
51-
s.files = Dir.glob("{lib,exe}/**/*", File::FNM_DOTMATCH, :base => base_dir).reject {|f| File.directory?(File.expand_path(f, base_dir)) }
50+
s.files = Dir.glob("{lib,exe}/**/*", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
5251

5352
# we don't check in man pages, but we need to ship them because
5453
# we use them to generate the long-form help for each command.

spec/quality_spec.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,15 @@ def check_for_specific_pronouns(filename)
242242
end
243243

244244
it "ships the correct set of files" do
245-
base_dir = File.dirname(__dir__).gsub(%r{([^A-Za-z0-9_\-.,:\/@\n])}, "\\\\\\1")
246-
git_list = IO.popen("git -C #{base_dir} ls-files -z", &:read).split("\x0").select {|f| f.match(%r{^(lib|exe)/}) }
247-
git_list += %w[CHANGELOG.md LICENSE.md README.md bundler.gemspec]
245+
Dir.chdir(root) do
246+
git_list = IO.popen("git ls-files -z", &:read).split("\x0").select {|f| f.match(%r{^(lib|exe)/}) }
247+
git_list += %w[CHANGELOG.md LICENSE.md README.md bundler.gemspec]
248+
git_list += Dir.glob("man/**/*")
248249

249-
gem_list = Gem::Specification.load(gemspec.to_s).files
250+
gem_list = Gem::Specification.load(gemspec.to_s).files
250251

251-
expect(git_list.to_set).to eq(gem_list.to_set)
252+
expect(git_list.to_set).to eq(gem_list.to_set)
253+
end
252254
end
253255

254256
it "does not contain any warnings" do

0 commit comments

Comments
 (0)