Skip to content

Commit ea15fcd

Browse files
committed
chore: update gemspec so that it hopefully works for the release action
1 parent ae045d6 commit ea15fcd

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

pact_broker.gemspec

+21-23
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,6 @@ require 'pact_broker/version'
66

77
Gem::Specification.new do |gem|
88

9-
def gem_files
10-
if Dir.exist?(".git")
11-
`git ls-files`.split($/)
12-
else
13-
root_path = File.dirname(__FILE__)
14-
all_files = Dir.chdir(root_path) { Dir.glob("**/{*,.*}") }
15-
all_files.reject! { |file| [".", ".."].include?(File.basename(file)) || File.directory?(file)}
16-
gitignore_path = File.join(root_path, ".gitignore")
17-
gitignore = File.readlines(gitignore_path)
18-
gitignore.map! { |line| line.chomp.strip }
19-
gitignore.reject! { |line| line.empty? || line =~ /^(#|!)/ }
20-
21-
all_files.reject do |file|
22-
gitignore.any? do |ignore|
23-
file.start_with?(ignore) ||
24-
File.fnmatch(ignore, file, File::FNM_PATHNAME) ||
25-
File.fnmatch(ignore, File.basename(file), File::FNM_PATHNAME)
26-
end
27-
end
28-
end
29-
end
30-
319
gem.name = "pact_broker"
3210
gem.version = PactBroker::VERSION
3311
gem.authors = ["Bethany Skurrie", "Sergei Matheson", "Warner Godfrey"]
@@ -38,7 +16,27 @@ Gem::Specification.new do |gem|
3816

3917
gem.required_ruby_version = '>= 2.2.0'
4018

41-
gem.files = gem_files
19+
gem.files = begin
20+
if Dir.exist?(".git")
21+
`git ls-files`.split($/)
22+
else
23+
root_path = File.dirname(__FILE__)
24+
all_files = Dir.chdir(root_path) { Dir.glob("**/{*,.*}") }
25+
all_files.reject! { |file| [".", ".."].include?(File.basename(file)) || File.directory?(file)}
26+
gitignore_path = File.join(root_path, ".gitignore")
27+
gitignore = File.readlines(gitignore_path)
28+
gitignore.map! { |line| line.chomp.strip }
29+
gitignore.reject! { |line| line.empty? || line =~ /^(#|!)/ }
30+
31+
all_files.reject do |file|
32+
gitignore.any? do |ignore|
33+
file.start_with?(ignore) ||
34+
File.fnmatch(ignore, file, File::FNM_PATHNAME) ||
35+
File.fnmatch(ignore, File.basename(file), File::FNM_PATHNAME)
36+
end
37+
end
38+
end
39+
end
4240
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
4341
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
4442
gem.require_paths = ["lib"]

0 commit comments

Comments
 (0)