Skip to content

Commit 020d670

Browse files
authored
Merge pull request #47 from diogot/update-gems
Update gems
2 parents 661bd03 + 828fb2d commit 020d670

File tree

9 files changed

+99
-83
lines changed

9 files changed

+99
-83
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ cache:
44
- bundle
55

66
rvm:
7-
- 2.1.3
8-
- 2.3.1
7+
- 2.6.0
8+
- 2.5.3
9+
- 2.4.5
10+
- 2.3.8
911

1012
script:
1113
- bundle exec rake spec

Gemfile.lock

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
PATH
22
remote: .
33
specs:
4-
danger-xcode_summary (0.5.0)
4+
danger-xcode_summary (0.5.1)
55
danger-plugin-api (~> 1.0)
66

77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
addressable (2.5.2)
10+
addressable (2.6.0)
1111
public_suffix (>= 2.0.2, < 4.0)
1212
ast (2.4.0)
1313
claide (1.0.2)
@@ -19,29 +19,30 @@ GEM
1919
colored2 (3.1.2)
2020
cork (0.3.0)
2121
colored2 (~> 3.1)
22-
danger (5.5.10)
22+
danger (6.0.9)
2323
claide (~> 1.0)
2424
claide-plugins (>= 0.9.2)
2525
colored2 (~> 3.1)
2626
cork (~> 0.1)
2727
faraday (~> 0.9)
28-
faraday-http-cache (~> 1.0)
29-
git (~> 1)
30-
kramdown (~> 1.5)
28+
faraday-http-cache (~> 2.0)
29+
git (~> 1.5)
30+
kramdown (~> 2.0)
31+
kramdown-parser-gfm (~> 1.0)
3132
no_proxy_fix
3233
octokit (~> 4.7)
3334
terminal-table (~> 1)
3435
danger-plugin-api (1.0.0)
3536
danger (> 2.0)
3637
diff-lcs (1.3)
37-
faraday (0.14.0)
38+
faraday (0.15.4)
3839
multipart-post (>= 1.2, < 3)
39-
faraday-http-cache (1.3.1)
40+
faraday-http-cache (2.0.0)
4041
faraday (~> 0.8)
41-
ffi (1.9.23)
42+
ffi (1.11.1)
4243
formatador (0.2.5)
43-
git (1.3.0)
44-
guard (2.14.2)
44+
git (1.5.0)
45+
guard (2.15.0)
4546
formatador (>= 0.2.4)
4647
listen (>= 2.7, < 4.0)
4748
lumberjack (>= 1.0.12, < 2.0)
@@ -55,65 +56,67 @@ GEM
5556
guard (~> 2.1)
5657
guard-compat (~> 1.1)
5758
rspec (>= 2.99.0, < 4.0)
58-
kramdown (1.16.2)
59+
jaro_winkler (1.5.3)
60+
kramdown (2.1.0)
61+
kramdown-parser-gfm (1.1.0)
62+
kramdown (~> 2.0)
5963
listen (3.0.7)
6064
rb-fsevent (>= 0.9.3)
6165
rb-inotify (>= 0.9.7)
62-
lumberjack (1.0.12)
63-
method_source (0.9.0)
64-
multipart-post (2.0.0)
66+
lumberjack (1.0.13)
67+
method_source (0.9.2)
68+
multipart-post (2.1.1)
6569
nap (1.1.0)
6670
nenv (0.3.0)
6771
no_proxy_fix (0.1.2)
6872
notiffany (0.1.1)
6973
nenv (~> 0.1)
7074
shellany (~> 0.0)
71-
octokit (4.8.0)
75+
octokit (4.14.0)
7276
sawyer (~> 0.8.0, >= 0.5.3)
7377
open4 (1.3.4)
74-
parallel (1.12.1)
75-
parser (2.5.0.2)
78+
parallel (1.17.0)
79+
parser (2.6.3.0)
7680
ast (~> 2.4.0)
77-
powerpack (0.1.1)
78-
pry (0.11.3)
81+
pry (0.12.2)
7982
coderay (~> 1.1.0)
8083
method_source (~> 0.9.0)
81-
public_suffix (3.0.2)
84+
public_suffix (3.1.1)
8285
rainbow (3.0.0)
8386
rake (10.5.0)
8487
rb-fsevent (0.10.3)
85-
rb-inotify (0.9.10)
86-
ffi (>= 0.5.0, < 2)
87-
rspec (3.7.0)
88-
rspec-core (~> 3.7.0)
89-
rspec-expectations (~> 3.7.0)
90-
rspec-mocks (~> 3.7.0)
91-
rspec-core (3.7.1)
92-
rspec-support (~> 3.7.0)
93-
rspec-expectations (3.7.0)
88+
rb-inotify (0.10.0)
89+
ffi (~> 1.0)
90+
rspec (3.8.0)
91+
rspec-core (~> 3.8.0)
92+
rspec-expectations (~> 3.8.0)
93+
rspec-mocks (~> 3.8.0)
94+
rspec-core (3.8.2)
95+
rspec-support (~> 3.8.0)
96+
rspec-expectations (3.8.4)
9497
diff-lcs (>= 1.2.0, < 2.0)
95-
rspec-support (~> 3.7.0)
96-
rspec-mocks (3.7.0)
98+
rspec-support (~> 3.8.0)
99+
rspec-mocks (3.8.1)
97100
diff-lcs (>= 1.2.0, < 2.0)
98-
rspec-support (~> 3.7.0)
99-
rspec-support (3.7.1)
100-
rubocop (0.52.1)
101+
rspec-support (~> 3.8.0)
102+
rspec-support (3.8.2)
103+
rubocop (0.73.0)
104+
jaro_winkler (~> 1.5.1)
101105
parallel (~> 1.10)
102-
parser (>= 2.4.0.2, < 3.0)
103-
powerpack (~> 0.1)
106+
parser (>= 2.6)
104107
rainbow (>= 2.2.2, < 4.0)
105108
ruby-progressbar (~> 1.7)
106-
unicode-display_width (~> 1.0, >= 1.0.1)
107-
ruby-progressbar (1.9.0)
108-
sawyer (0.8.1)
109-
addressable (>= 2.3.5, < 2.6)
110-
faraday (~> 0.8, < 1.0)
109+
unicode-display_width (>= 1.4.0, < 1.7)
110+
ruby-progressbar (1.10.1)
111+
sawyer (0.8.2)
112+
addressable (>= 2.3.5)
113+
faraday (> 0.8, < 2.0)
111114
shellany (0.0.1)
112115
terminal-table (1.8.0)
113116
unicode-display_width (~> 1.1, >= 1.1.1)
114-
thor (0.20.0)
115-
unicode-display_width (1.3.0)
116-
yard (0.9.12)
117+
thor (0.20.3)
118+
unicode-display_width (1.6.0)
119+
yard (0.9.20)
117120

118121
PLATFORMS
119122
ruby
@@ -132,4 +135,4 @@ DEPENDENCIES
132135
yard
133136

134137
BUNDLED WITH
135-
1.16.1
138+
1.17.2

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](LICENSE.txt)
44
[![Gem Version](https://badge.fury.io/rb/danger-xcode_summary.svg)](https://badge.fury.io/rb/danger-xcode_summary)
55
[![Build Status](https://travis-ci.org/diogot/danger-xcode_summary.svg?branch=master)](https://travis-ci.org/diogot/danger-xcode_summary)
6-
[![Dependency Status](https://dependencyci.com/github/diogot/danger-xcode_summary/badge)](https://dependencyci.com/github/diogot/danger-xcode_summary)
76

87
A [Danger](http://danger.systems) plugin that shows all build errors, warnings and unit tests results generated from `xcodebuild`.
98

lib/danger_plugin.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# frozen_string_literal: true
2+
13
require 'xcode_summary/plugin'

lib/danger_xcode_summary.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# frozen_string_literal: true
2+
13
require 'xcode_summary/gem_version'

lib/xcode_summary/gem_version.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module XcodeSummary
2-
VERSION = '0.5.0'.freeze
4+
VERSION = '0.5.1'
35
end

lib/xcode_summary/plugin.rb

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'json'
24

35
module Danger
@@ -196,9 +198,9 @@ def errors(xcode_summary)
196198
errors.delete_if(&ignored_results)
197199
end
198200

199-
def parse_location(h)
200-
file_path, line, _column = h[:file_path].split(':')
201-
Location.new(h[:file_name], file_path, line.to_i)
201+
def parse_location(input)
202+
file_path, line, _column = input[:file_path].split(':')
203+
Location.new(input[:file_name], file_path, line.to_i)
202204
end
203205

204206
def parse_test_location(failure)
@@ -208,27 +210,29 @@ def parse_test_location(failure)
208210
end
209211

210212
def format_path(path)
211-
clean_path, line = parse_filename(path)
212-
path = clean_path + '#L' + line if clean_path && line
213-
214213
# Pick a Dangerfile plugin for a chosen request_source
215214
# based on https://github.com/danger/danger/blob/master/lib/danger/plugin_support/plugin.rb#L31
216215
plugins = Plugin.all_plugins.select { |plugin| Dangerfile.essential_plugin_classes.include? plugin }
217216
plugin = plugins.select { |p| p.method_defined? :html_link }.map { |p| p.new(@dangerfile) }.compact.first
218217

219-
plugin.html_link(path)
218+
if plugin
219+
clean_path, line = parse_filename(path)
220+
path = clean_path + '#L' + line if clean_path && line
221+
plugin.html_link(path)
222+
else
223+
path
224+
end
220225
end
221226

222227
def parse_filename(path)
223228
regex = /^(.*?):(\d*):?\d*$/
224229
match = path.match(regex)
225-
if match
226-
match.captures
227-
end
230+
match&.captures
228231
end
229232

230233
def relative_path(path)
231234
return nil if project_root.nil?
235+
232236
path.gsub(project_root, '')
233237
end
234238

@@ -242,38 +246,38 @@ def escape_reason(reason)
242246
reason.gsub('>', '\>').gsub('<', '\<')
243247
end
244248

245-
def format_compile_warning(h)
246-
path = relative_path(h[:file_path])
249+
def format_compile_warning(input)
250+
path = relative_path(input[:file_path])
247251
return nil if should_ignore_warning?(path)
248252

249253
path_link = format_path(path)
250254

251-
warning = "**#{path_link}**: #{escape_reason(h[:reason])} <br />"
252-
if h[:line] && !h[:line].empty?
255+
warning = "**#{path_link}**: #{escape_reason(input[:reason])} <br />"
256+
if input[:line] && !input[:line].empty?
253257
"#{warning}" \
254258
"```\n" \
255-
"#{h[:line]}\n" \
259+
"#{input[:line]}\n" \
256260
'```'
257261
else
258262
warning
259263
end
260264
end
261265

262-
def format_format_file_missing_error(h)
263-
path = relative_path(h[:file_path])
266+
def format_format_file_missing_error(input)
267+
path = relative_path(input[:file_path])
264268
path_link = format_path(path)
265-
"**#{escape_reason(h[:reason])}**: #{path_link}"
269+
"**#{escape_reason(input[:reason])}**: #{path_link}"
266270
end
267271

268-
def format_undefined_symbols(h)
269-
"#{h[:message]} <br />" \
270-
"> Symbol: #{h[:symbol]} <br />" \
271-
"> Referenced from: #{h[:reference]}"
272+
def format_undefined_symbols(input)
273+
"#{input[:message]} <br />" \
274+
"> Symbol: #{input[:symbol]} <br />" \
275+
"> Referenced from: #{input[:reference]}"
272276
end
273277

274-
def format_duplicate_symbols(h)
275-
"#{h[:message]} <br />" \
276-
"> #{h[:file_paths].map { |path| path.split('/').last }.join('<br /> ')}"
278+
def format_duplicate_symbols(input)
279+
"#{input[:message]} <br />" \
280+
"> #{input[:file_paths].map { |path| path.split('/').last }.join('<br /> ')}"
277281
end
278282

279283
def format_test_failure(suite_name, failure)

spec/spec_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# frozen_string_literal: true
2+
13
require 'pathname'
2-
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
4+
ROOT = Pathname.new(File.expand_path('..', __dir__))
35
$LOAD_PATH.unshift((ROOT + 'lib').to_s)
46
$LOAD_PATH.unshift((ROOT + 'spec').to_s)
57

spec/xcode_summary_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
require File.expand_path('../spec_helper', __FILE__)
1+
# frozen_string_literal: true
2+
3+
require File.expand_path('spec_helper', __dir__)
24

35
module Danger
46
describe Danger::DangerXcodeSummary do
@@ -73,7 +75,7 @@ module Danger
7375
@xcode_summary.report('spec/fixtures/summary.json')
7476
expect(@dangerfile.status_report[:warnings]).to eq [
7577
# rubocop:disable LineLength
76-
"**<a href='https://github.com/diogot/danger-xcode_summary/blob/129jef029jf029fj2039fj203f92/MyWeight/Bla.m#L32'>MyWeight/Bla.m#L32</a>**: Value stored to 'theme' is never read <br />```\n theme = *ptr++;\n```",
78+
"**<a href='https://github.com/diogot/danger-xcode_summary/blob/129jef029jf029fj2039fj203f92/MyWeight/Bla.m#L32'>MyWeight/Bla.m#L32</a>**: Value stored to 'theme' is never read <br />```\n theme = *ptr++;\n```"
7779
# rubocop:enable LineLength
7880
]
7981
end
@@ -89,7 +91,7 @@ module Danger
8991
expect(@dangerfile.status_report[:errors]).to eq [
9092
# rubocop:disable LineLength
9193
'**MyWeight.MyWeightSpec**: works_with_success, expected to eventually not be nil, got \<nil\> <br /> ' \
92-
"<a href='https://github.com/diogot/danger-xcode_summary/blob/129jef029jf029fj2039fj203f92/MyWeight/MyWeightTests/Tests.swift#L86'>MyWeight/MyWeightTests/Tests.swift#L86</a>",
94+
"<a href='https://github.com/diogot/danger-xcode_summary/blob/129jef029jf029fj2039fj203f92/MyWeight/MyWeightTests/Tests.swift#L86'>MyWeight/MyWeightTests/Tests.swift#L86</a>"
9395
# rubocop:enable LineLength
9496
]
9597
end
@@ -204,10 +206,8 @@ module Danger
204206

205207
describe 'where request source' do
206208
it 'should be bitbucket' do
207-
path = @xcode_summary.send(:format_path, 'lib/xcode_summary/plugin.rb#L3')
208-
# rubocop:disable LineLength
209-
expect(path).to eq "<a href='https://github.com/diogot/danger-xcode_summary/lib/xcode_summary/plugin.rb?at=4d4c0f31857e3185b51b6865a0700525bc0cb2bb#L3'>lib/xcode_summary/plugin.rb</a>"
210-
# rubocop:enable LineLength
209+
path = @xcode_summary.send(:format_path, 'lib/xcode_summary/plugin.rb:3')
210+
expect(path).to eq 'lib/xcode_summary/plugin.rb:3'
211211
end
212212
end
213213
end

0 commit comments

Comments
 (0)