danger-periphery 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/danger/danger_periphery.rb +1 -1
- data/lib/danger_periphery/version.rb +1 -1
- data/lib/periphery/runner.rb +12 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d2f612902b0953cad3166423f6ec628619d1de19fe9727b0c55164067283de6
|
4
|
+
data.tar.gz: 9ed570bd16dfea55ade3e05ea1043e29c8f0924edec9c2851501a92c6a3989dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b805c2969118ac69ac822c01f155138798d005cda0f14264cf71cde95cbbab5143f6dd2eba4439accd980d53b54b37baf0778803ca7a95526919ca5fed8a923b
|
7
|
+
data.tar.gz: 96c7baebde3044b5d7c70014b3a42fb408e24775c8c5587363b496cb53e1d31ad5a86af3665a2ee17c0610df6e00929dc9c1df1b7755fd55aa518f98fca4d9b9
|
data/lib/periphery/runner.rb
CHANGED
@@ -13,6 +13,7 @@ module Periphery
|
|
13
13
|
|
14
14
|
def scan(options)
|
15
15
|
arguments = [binary_path, 'scan'] + scan_arguments(options)
|
16
|
+
|
16
17
|
stdout, stderr, status = Open3.capture3(*arguments)
|
17
18
|
raise "error: #{arguments} exited with status code #{status.exitstatus}. #{stderr}" unless status.success?
|
18
19
|
|
@@ -20,22 +21,26 @@ module Periphery
|
|
20
21
|
end
|
21
22
|
|
22
23
|
def scan_arguments(options)
|
23
|
-
|
24
|
+
args = []
|
25
|
+
options.each do |key, value|
|
24
26
|
next unless value
|
25
27
|
|
28
|
+
next if key == :build_args
|
29
|
+
|
26
30
|
value = nil if value.is_a?(TrueClass)
|
31
|
+
args << "--#{key.to_s.tr('_', '-')}"
|
27
32
|
if value.is_a?(Array)
|
28
33
|
if Gem::Version.new(version) >= Gem::Version.new('2.18.0')
|
29
|
-
|
30
|
-
new_options.push(*value.map(&:to_s))
|
31
|
-
next
|
34
|
+
args.push(*value.map(&:to_s))
|
32
35
|
else
|
33
|
-
|
36
|
+
args << value.join(',')
|
34
37
|
end
|
38
|
+
elsif value
|
39
|
+
args << value&.to_s
|
35
40
|
end
|
36
|
-
new_options << "--#{key.to_s.tr('_', '-')}"
|
37
|
-
new_options << value&.to_s if value
|
38
41
|
end
|
42
|
+
args += ['--', options[:build_args]] if options[:build_args]
|
43
|
+
args
|
39
44
|
end
|
40
45
|
|
41
46
|
def version
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-periphery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryosuke Ito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
|
-
rubygems_version: 3.
|
77
|
+
rubygems_version: 3.5.14
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
80
|
summary: A Danger plugin to detect unused codes.
|