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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bc33803e8086ca502424fae528475182c196daf3b5971200a7988fca0936822
4
- data.tar.gz: 138b0750cff7e555d62f82ca8716b4d21dbd32fd5c6de898fd7c7653d7c56501
3
+ metadata.gz: e6f2f5188a60431f6125d9b82e75f6edb661bf9c805ff13f685b962555c2cdb2
4
+ data.tar.gz: 3b4161909c2c494a37b3e8e3f9839f2fb86dd7c5712ca200cfb40e3c77e6bba6
5
5
  SHA512:
6
- metadata.gz: bf6b14a1ca18e978b709905159b17caacb5cc5a2812ecb1b655961041e44134eed33d840ac3679b451aa49b33f2dcf7f96ffa6e5535a102f7799cf927fb8e9af
7
- data.tar.gz: 39e1f326632af4f2f658d027ebb8277fd1b24262a9e1fd90a10747c8d85e1bf7ead72c65c44716af7a4d4f06a746d0be008b1a76fb82ba88034c1b1c6cdcf04f
6
+ metadata.gz: a305d14cb1c2fe8166de8a830a465ed0647b690aec10ec917cf31348944a6f8f3867b75053f2817ab04153a27bc141064bc2ecc46dc73a77f68850011592c11c
7
+ data.tar.gz: f279c3f69cfcd07706a4c4652741d7ebc9423d222724d2c0093fa363f3be25970216d5adcaf156825db1edde6a8d6fb3d990f31a8d7480b656ff23e2a23490bc
@@ -1,2 +1,2 @@
1
- �,J����~\�ܶ�L䵣7��������ZՉ���v/��8$��"�� ����4�`iJ���G&�w������O<qSfqL$����:p@q4�j�ɮ��<CB�`��.UYC{{�.\�n@�z���);��HV*�P+�����~�sw0_��:Q,�>�lt� ���}� ����
2
- <>O����[hW��7Et���b��F-�?��)7�|�ѿ L͇}�X���Ky;�fe��bJ1bG�™�*��WT3Ut8O&?��3��R#��iɅTfo��!s��}�B|���k��A��mI����[y
1
+ d�^.'QU���6����>K^�kLI�� Ifq-�Pmӂ��F��t_ ��r켣�k����i^�䛧aÀ+Ǖ��Gp<��r���
2
+ >[�����Yj��g筎��ܤ��%eRY֦9d������Wbê�
data.tar.gz.sig CHANGED
Binary file
@@ -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.24...HEAD
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- diffend (0.2.24)
4
+ diffend (0.2.25)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -27,7 +27,7 @@
27
27
  # Diffend main namespace
28
28
  module Diffend
29
29
  # Current plugin version
30
- VERSION = '0.2.24'
30
+ VERSION = '0.2.25'
31
31
  # Diffend homepage
32
32
  HOMEPAGE = 'https://diffend.io'
33
33
 
@@ -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
- \nDiffend reported an allow verdict for #{command} command for this project.\n
84
- All of our #{response['allows_count'] + response['denies_count']} checks succeeded.\n
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
- \nDiffend reported a deny verdict for #{command} command for this project.\n
96
- #{response['denies_count']} out of our #{response['allows_count'] + response['denies_count']} checks failed. Please go to the url below and review the issues.\n
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.24
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-08 00:00:00.000000000 Z
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