danger-slather 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0c4a2ede587c8cb03b3fef63b3328ed62a03c7c
4
- data.tar.gz: 8b0ad6fe348f9bc5a4c3684de4c00dce09391242
3
+ metadata.gz: daf1faf277f42d3940ce36ca0dd0ab32e7a126ff
4
+ data.tar.gz: 8ac31bca44077ca0894cb94d1f3ee73a226b313a
5
5
  SHA512:
6
- metadata.gz: a5f9dd555b450283e6e9888dfffcc9ec5f827acd32bab5700aaeae36eaeafcaa76bae523248fb549e74e0e9895d19abe5d7ca8de9d2878a75fb2937263c9beb8
7
- data.tar.gz: 0d72e097ee957bfff4a78181bc96e65d330e5ae9fa665c6bd058c2e042a905b3a42a406b4e528d39f67e71b9a94ce2a38dba2a11beb6dcab9557cbe5f47d322e
6
+ metadata.gz: 1c4048856be40b2deb7b7a3557c9ec5a6b02d815dfe0fed694ad127ea22cd816c70d1cb123a95d0269d169fa67f152fa901b1d380b28e478b882ff3956017738
7
+ data.tar.gz: 2cd1a99f45199e1c6094626af399dfb6fd4f673f2d60425d4e28fbaedccd0792f7a42deddde28e522d1ec41ecc67319866f852d81046387390150a76a83267d3
data/Gemfile.lock CHANGED
@@ -133,7 +133,7 @@ GEM
133
133
  slop (3.6.0)
134
134
  terminal-table (1.7.3)
135
135
  unicode-display_width (~> 1.1.1)
136
- thor (0.19.1)
136
+ thor (0.19.3)
137
137
  thread_safe (0.3.5)
138
138
  tzinfo (1.2.2)
139
139
  thread_safe (~> 0.1)
@@ -155,8 +155,8 @@ DEPENDENCIES
155
155
  guard (~> 2.14)
156
156
  guard-rspec (~> 4.7)
157
157
  listen (= 3.0.7)
158
- mocha
159
- pry
158
+ mocha (~> 1.2)
159
+ pry (~> 0.9)
160
160
  rake (~> 10.0)
161
161
  rspec (~> 3.4)
162
162
  rubocop (~> 0.41)
@@ -1,3 +1,3 @@
1
1
  module Slather
2
- VERSION = '0.0.1'.freeze
2
+ VERSION = '0.0.2'.freeze
3
3
  end
@@ -113,12 +113,19 @@ module Danger
113
113
  # @return [String]
114
114
  def modified_files_coverage_table
115
115
  unless @project.nil?
116
- line = "File | Coverage\n"
117
- line << "-----|-----\n"
118
- @project.coverage_files.each do |coverage_file|
119
- file_name = coverage_file.source_file_pathname_relative_to_repo_root.to_s
120
- percentage = @project.decimal_f([coverage_file.percentage_lines_tested])
121
- line << "#{file_name} | #{percentage}\n"
116
+
117
+ modified_files_coverage = @project.coverage_files.select do |file|
118
+ git.modified_files.include? file.source_file_pathname_relative_to_repo_root.to_s
119
+ end
120
+ line = ''
121
+ if modified_files_coverage.count > 0
122
+ line << "File | Coverage\n"
123
+ line << "-----|-----\n"
124
+ modified_files_coverage.each do |coverage_file|
125
+ file_name = coverage_file.source_file_pathname_relative_to_repo_root.to_s
126
+ percentage = @project.decimal_f([coverage_file.percentage_lines_tested])
127
+ line << "#{file_name} | #{percentage}\n"
128
+ end
122
129
  end
123
130
  return line
124
131
  end
data/spec/slather_spec.rb CHANGED
@@ -185,7 +185,6 @@ ViewController.swift | 20.00
185
185
  ViewController2.swift | 30.00
186
186
  ViewController3.swift | 40.00
187
187
  ViewController4.swift | 50.00
188
- ViewController5.swift | 60.00
189
188
  > Powered by [Slather](https://github.com/SlatherOrg/slather)"
190
189
  )
191
190
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-slather
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno Mazzo