@@ -6,28 +6,6 @@ require 'pact_broker/version'
6
6
7
7
Gem ::Specification . new do |gem |
8
8
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
-
31
9
gem . name = "pact_broker"
32
10
gem . version = PactBroker ::VERSION
33
11
gem . authors = [ "Bethany Skurrie" , "Sergei Matheson" , "Warner Godfrey" ]
@@ -38,7 +16,27 @@ Gem::Specification.new do |gem|
38
16
39
17
gem . required_ruby_version = '>= 2.2.0'
40
18
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
42
40
gem . executables = gem . files . grep ( %r{^bin/} ) . map { |f | File . basename ( f ) }
43
41
gem . test_files = gem . files . grep ( %r{^(test|spec|features)/} )
44
42
gem . require_paths = [ "lib" ]
0 commit comments