diffend 0.2.25 → 0.2.26
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 +0 -0
- data.tar.gz.sig +0 -0
- data/.github/workflows/ci.yml +2 -0
- data/CHANGELOG.md +7 -1
- data/Gemfile.lock +1 -1
- data/lib/diffend.rb +30 -13
- data/lib/diffend/voting.rb +4 -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: f22ef308037176744a8795a6371eb3340f01d597b706c66e45b8355dbf2d41a9
|
4
|
+
data.tar.gz: 1e5734925c51663f20e804ecef8d329f7b24a05dfce891b33366f1e867edbf78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8930d5dfc0e3c8438515069ab5c472ae93aaf934c6d16c595c70b9167384347d7c0358c4c50fc49d18b1a4024ed959be4fff00485731c9e622b8c8e89f7c1a98
|
7
|
+
data.tar.gz: e9741f2fe2db83a7650dd2272b9f79cfa7e5bc4b3c2989cae0d8390215459a386a545f23eb0163e350e6e32a7dca7963c9a9bfcdb65496dfa062051a2c023aad
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.github/workflows/ci.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
## [Unreleased][master]
|
4
4
|
|
5
|
+
## [0.2.26] (2020-09-10)
|
6
|
+
- introduce DIFFEND_DEVELOPMENT environment variable ([#36](https://github.com/diffend-io/diffend-ruby/pull/36))
|
7
|
+
- adjust message for allow verdict ([#37](https://github.com/diffend-io/diffend-ruby/pull/37))
|
8
|
+
- do not run the plugin when it is not enabled ([#38](https://github.com/diffend-io/diffend-ruby/pull/38))
|
9
|
+
|
5
10
|
## [0.2.25] (2020-09-09)
|
6
11
|
- add support for a warn verdict ([#34](https://github.com/diffend-io/diffend-ruby/pull/34))
|
7
12
|
|
@@ -50,7 +55,8 @@
|
|
50
55
|
|
51
56
|
- initial release
|
52
57
|
|
53
|
-
[master]: https://github.com/diffend-io/diffend-ruby/compare/v0.2.
|
58
|
+
[master]: https://github.com/diffend-io/diffend-ruby/compare/v0.2.26...HEAD
|
59
|
+
[0.2.26]: https://github.com/diffend-io/diffend-ruby/compare/v0.2.25...v0.2.26
|
54
60
|
[0.2.25]: https://github.com/diffend-io/diffend-ruby/compare/v0.2.24...v0.2.25
|
55
61
|
[0.2.24]: https://github.com/diffend-io/diffend-ruby/compare/v0.2.23...v0.2.24
|
56
62
|
[0.2.23]: https://github.com/diffend-io/diffend-ruby/compare/v0.2.22...v0.2.23
|
data/Gemfile.lock
CHANGED
data/lib/diffend.rb
CHANGED
@@ -27,7 +27,7 @@
|
|
27
27
|
# Diffend main namespace
|
28
28
|
module Diffend
|
29
29
|
# Current plugin version
|
30
|
-
VERSION = '0.2.
|
30
|
+
VERSION = '0.2.26'
|
31
31
|
# Diffend homepage
|
32
32
|
HOMEPAGE = 'https://diffend.io'
|
33
33
|
|
@@ -41,7 +41,9 @@ module Diffend
|
|
41
41
|
|
42
42
|
# Execute diffend plugin
|
43
43
|
def execute
|
44
|
-
|
44
|
+
return unless enabled?
|
45
|
+
|
46
|
+
verify_version
|
45
47
|
|
46
48
|
config = fetch_config
|
47
49
|
|
@@ -63,7 +65,8 @@ module Diffend
|
|
63
65
|
)
|
64
66
|
end
|
65
67
|
|
66
|
-
def
|
68
|
+
def verify_version
|
69
|
+
return if ENV['DIFFEND_DEVELOPMENT'] == 'true'
|
67
70
|
return if installed_version == VERSION
|
68
71
|
|
69
72
|
build_outdated_version_message(installed_version)
|
@@ -72,16 +75,6 @@ module Diffend
|
|
72
75
|
exit 1
|
73
76
|
end
|
74
77
|
|
75
|
-
# @param version [Hash] installed version
|
76
|
-
#
|
77
|
-
# @return [String]
|
78
|
-
def build_outdated_version_message(version)
|
79
|
-
<<~MSG
|
80
|
-
\nYou are running an outdated version (#{version}) of the plugin, which will lead to issues.
|
81
|
-
\nPlease upgrade to the latest one (#{VERSION}) by executing "rm -rf .bundle/plugin".\n
|
82
|
-
MSG
|
83
|
-
end
|
84
|
-
|
85
78
|
# @return [String] installed plugin version
|
86
79
|
def installed_version
|
87
80
|
Bundler::Plugin
|
@@ -93,6 +86,30 @@ module Diffend
|
|
93
86
|
.last
|
94
87
|
end
|
95
88
|
|
89
|
+
# Checks if plugin is enabled
|
90
|
+
#
|
91
|
+
# @return [Boolean] true if enabled, false otherwise
|
92
|
+
def enabled?
|
93
|
+
Bundler
|
94
|
+
.default_gemfile
|
95
|
+
.read
|
96
|
+
.split("\n")
|
97
|
+
.reject(&:empty?)
|
98
|
+
.map(&:strip)
|
99
|
+
.select { |line| line.start_with?('plugin') }
|
100
|
+
.any? { |line| line.include?('diffend') }
|
101
|
+
end
|
102
|
+
|
103
|
+
# @param version [Hash] installed version
|
104
|
+
#
|
105
|
+
# @return [String]
|
106
|
+
def build_outdated_version_message(version)
|
107
|
+
<<~MSG
|
108
|
+
\nYou are running an outdated version (#{version}) of the plugin, which will lead to issues.
|
109
|
+
\nPlease upgrade to the latest one (#{VERSION}) by executing "rm -rf .bundle/plugin".\n
|
110
|
+
MSG
|
111
|
+
end
|
112
|
+
|
96
113
|
# Command that was run with bundle
|
97
114
|
#
|
98
115
|
# @return [String]
|
data/lib/diffend/voting.rb
CHANGED
@@ -84,7 +84,7 @@ module Diffend
|
|
84
84
|
def build_allow_message(command, response)
|
85
85
|
<<~MSG
|
86
86
|
#{build_message_header('an allow', command)}
|
87
|
-
#{build_message_info(response)}
|
87
|
+
#{build_message_info(response)}\n
|
88
88
|
#{response['review_url']}\n
|
89
89
|
MSG
|
90
90
|
end
|
@@ -96,7 +96,7 @@ module Diffend
|
|
96
96
|
def build_warn_message(command, response)
|
97
97
|
<<~MSG
|
98
98
|
#{build_message_header('a warn', command)}
|
99
|
-
#{build_message_info(response)}
|
99
|
+
#{build_message_info(response)} Please go to the url below and review the issues.\n
|
100
100
|
#{response['review_url']}\n
|
101
101
|
MSG
|
102
102
|
end
|
@@ -108,7 +108,7 @@ module Diffend
|
|
108
108
|
def build_deny_message(command, response)
|
109
109
|
<<~MSG
|
110
110
|
#{build_message_header('a deny', command)}
|
111
|
-
#{build_message_info(response)}
|
111
|
+
#{build_message_info(response)} Please go to the url below and review the issues.\n
|
112
112
|
#{response['review_url']}\n
|
113
113
|
MSG
|
114
114
|
end
|
@@ -125,7 +125,7 @@ module Diffend
|
|
125
125
|
#
|
126
126
|
# @return [String]
|
127
127
|
def build_message_info(response)
|
128
|
-
"\nQuality score: #{response['quality_score']}, allows: #{response['allows_count']}, warnings: #{response['warns_count']}, denies: #{response['denies_count']}.
|
128
|
+
"\nQuality score: #{response['quality_score']}, allows: #{response['allows_count']}, warnings: #{response['warns_count']}, denies: #{response['denies_count']}."
|
129
129
|
end
|
130
130
|
end
|
131
131
|
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.26
|
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-10 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: bundler
|
metadata.gz.sig
CHANGED
Binary file
|