diffend 0.2.24 → 0.2.25
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 +4 -4
- checksums.yaml.gz.sig +2 -2
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +1 -1
- data/lib/diffend.rb +1 -1
- data/lib/diffend/voting.rb +34 -4
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6f2f5188a60431f6125d9b82e75f6edb661bf9c805ff13f685b962555c2cdb2
|
4
|
+
data.tar.gz: 3b4161909c2c494a37b3e8e3f9839f2fb86dd7c5712ca200cfb40e3c77e6bba6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a305d14cb1c2fe8166de8a830a465ed0647b690aec10ec917cf31348944a6f8f3867b75053f2817ab04153a27bc141064bc2ecc46dc73a77f68850011592c11c
|
7
|
+
data.tar.gz: f279c3f69cfcd07706a4c4652741d7ebc9423d222724d2c0093fa363f3be25970216d5adcaf156825db1edde6a8d6fb3d990f31a8d7480b656ff23e2a23490bc
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
d�^.'�QU���6����>K^�k�LI�� �If�q-�Pmӂ��F��t_ ��r켣�k����i^�䛧aÀ+Ǖ��Gp<��r���
|
2
|
+
>[�����Yj��g筎��ܤ��%eR�Y֦9d������W�bê�
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
## [Unreleased][master]
|
4
4
|
|
5
|
+
## [0.2.25] (2020-09-09)
|
6
|
+
- add support for a warn verdict ([#34](https://github.com/diffend-io/diffend-ruby/pull/34))
|
7
|
+
|
5
8
|
## [0.2.24] (2020-09-08)
|
6
9
|
- better error handling of response ([#28](https://github.com/diffend-io/diffend-ruby/pull/28))
|
7
10
|
- fix jruby specs ([#29](https://github.com/diffend-io/diffend-ruby/pull/29))
|
@@ -47,7 +50,8 @@
|
|
47
50
|
|
48
51
|
- initial release
|
49
52
|
|
50
|
-
[master]: https://github.com/diffend-io/diffend-ruby/compare/v0.2.
|
53
|
+
[master]: https://github.com/diffend-io/diffend-ruby/compare/v0.2.25...HEAD
|
54
|
+
[0.2.25]: https://github.com/diffend-io/diffend-ruby/compare/v0.2.24...v0.2.25
|
51
55
|
[0.2.24]: https://github.com/diffend-io/diffend-ruby/compare/v0.2.23...v0.2.24
|
52
56
|
[0.2.23]: https://github.com/diffend-io/diffend-ruby/compare/v0.2.22...v0.2.23
|
53
57
|
[0.2.22]: https://github.com/diffend-io/diffend-ruby/compare/v0.2.21...v0.2.22
|
data/Gemfile.lock
CHANGED
data/lib/diffend.rb
CHANGED
data/lib/diffend/voting.rb
CHANGED
@@ -49,6 +49,9 @@ module Diffend
|
|
49
49
|
when 'allow'
|
50
50
|
build_allow_message(command, response)
|
51
51
|
.tap(&Bundler.ui.method(:confirm))
|
52
|
+
when 'warn'
|
53
|
+
build_warn_message(command, response)
|
54
|
+
.tap(&Bundler.ui.method(:warn))
|
52
55
|
when 'deny'
|
53
56
|
build_deny_message(command, response)
|
54
57
|
.tap(&Bundler.ui.method(:error))
|
@@ -80,8 +83,20 @@ module Diffend
|
|
80
83
|
# @return [String]
|
81
84
|
def build_allow_message(command, response)
|
82
85
|
<<~MSG
|
83
|
-
|
84
|
-
|
86
|
+
#{build_message_header('an allow', command)}
|
87
|
+
#{build_message_info(response)}
|
88
|
+
#{response['review_url']}\n
|
89
|
+
MSG
|
90
|
+
end
|
91
|
+
|
92
|
+
# @param command [String] either install or update
|
93
|
+
# @param response [Hash] response from diffend API
|
94
|
+
#
|
95
|
+
# @return [String]
|
96
|
+
def build_warn_message(command, response)
|
97
|
+
<<~MSG
|
98
|
+
#{build_message_header('a warn', command)}
|
99
|
+
#{build_message_info(response)}
|
85
100
|
#{response['review_url']}\n
|
86
101
|
MSG
|
87
102
|
end
|
@@ -92,11 +107,26 @@ module Diffend
|
|
92
107
|
# @return [String]
|
93
108
|
def build_deny_message(command, response)
|
94
109
|
<<~MSG
|
95
|
-
|
96
|
-
#{response
|
110
|
+
#{build_message_header('a deny', command)}
|
111
|
+
#{build_message_info(response)}
|
97
112
|
#{response['review_url']}\n
|
98
113
|
MSG
|
99
114
|
end
|
115
|
+
|
116
|
+
# @param type [String] verdict type
|
117
|
+
# @param command [String] either install or update
|
118
|
+
#
|
119
|
+
# @return [String]
|
120
|
+
def build_message_header(type, command)
|
121
|
+
"\nDiffend reported #{type} verdict for #{command} command for this project."
|
122
|
+
end
|
123
|
+
|
124
|
+
# @param response [Hash] response from diffend API
|
125
|
+
#
|
126
|
+
# @return [String]
|
127
|
+
def build_message_info(response)
|
128
|
+
"\nQuality score: #{response['quality_score']}, allows: #{response['allows_count']}, warnings: #{response['warns_count']}, denies: #{response['denies_count']}. Please go to the url below and review the issues.\n"
|
129
|
+
end
|
100
130
|
end
|
101
131
|
end
|
102
132
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diffend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomasz Pajor
|
@@ -34,7 +34,7 @@ cert_chain:
|
|
34
34
|
9MmF6uCQa1EjK2p8tYT0MnbHrFkoehxdX4VO9y99GAkhZyJNKPYPtyAUFV27sT2V
|
35
35
|
LfCJRk4ifKIN/FUCwDSn8Cz0m6oH265q0p6wdzI6qrWOjP8tGOMBTA==
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date: 2020-09-
|
37
|
+
date: 2020-09-09 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: bundler
|
metadata.gz.sig
CHANGED
Binary file
|