@@ -3,29 +3,31 @@ lib = File.expand_path('../lib', __FILE__)
3
3
$LOAD_PATH. unshift ( lib ) unless $LOAD_PATH. include? ( lib )
4
4
require 'pact_broker/version'
5
5
6
- def gem_files
7
- if Dir . exist? ( ".git" )
8
- `git ls-files` . split ( $/)
9
- else
10
- root_path = File . dirname ( __FILE__ )
11
- all_files = Dir . chdir ( root_path ) { Dir . glob ( "**/{*,.*}" ) }
12
- all_files . reject! { |file | [ "." , ".." ] . include? ( File . basename ( file ) ) || File . directory? ( file ) }
13
- gitignore_path = File . join ( root_path , ".gitignore" )
14
- gitignore = File . readlines ( gitignore_path )
15
- gitignore . map! { |line | line . chomp . strip }
16
- gitignore . reject! { |line | line . empty? || line =~ /^(#|!)/ }
17
6
18
- all_files . reject do |file |
19
- gitignore . any? do |ignore |
20
- file . start_with? ( ignore ) ||
21
- File . fnmatch ( ignore , file , File ::FNM_PATHNAME ) ||
22
- File . fnmatch ( ignore , File . basename ( file ) , File ::FNM_PATHNAME )
7
+ Gem ::Specification . new do |gem |
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
23
27
end
24
28
end
25
29
end
26
- end
27
30
28
- Gem ::Specification . new do |gem |
29
31
gem . name = "pact_broker"
30
32
gem . version = PactBroker ::VERSION
31
33
gem . authors = [ "Bethany Skurrie" , "Sergei Matheson" , "Warner Godfrey" ]
0 commit comments