knife-changelog 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/knife-changelog.gemspec +1 -1
- data/lib/knife/changelog/policyfile.rb +8 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac3be8ff1b8cf7b08329253913b46a0ff46f5c1d997093f00e06f2142ee9f236
|
4
|
+
data.tar.gz: f7ab4788ef5381e77f46ef47f3f54e194f50674e663c2b901109db0755f85ca3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2317057716149eef467ab3ea30d6a34d58515d6dcb8af7b3309e25a238888384f4f0b44f7671df8cbb2d8f656fca1a433a06561866d70de3f5976368e36fcf5
|
7
|
+
data.tar.gz: f1ce18ea422aef699f9bf9475299b6324bda6bf492197aa066dd61ab2c956235d9983629395bfbc3c85130cc72723eb4c96671fe5a5bddd79b5a49bfc8f4a96e
|
data/knife-changelog.gemspec
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'knife-changelog'
|
8
|
-
spec.version = '1.4.
|
8
|
+
spec.version = '1.4.1'
|
9
9
|
spec.authors = ['Gregoire Seux']
|
10
10
|
spec.email = ['kamaradclimber@gmail.com']
|
11
11
|
spec.summary = 'Facilitate access to cookbooks changelog'
|
@@ -11,6 +11,9 @@ require 'rest-client'
|
|
11
11
|
|
12
12
|
class PolicyChangelog
|
13
13
|
TMP_PREFIX = 'knife-changelog'
|
14
|
+
# Regex matching Chef cookbook version syntax
|
15
|
+
# See https://docs.chef.io/cookbook_versioning.html#syntax
|
16
|
+
VERSION_REGEX = /^[1-9]*[0-9](\.[0-9]+){1,2}$/
|
14
17
|
|
15
18
|
# Initialzes Helper class
|
16
19
|
#
|
@@ -178,7 +181,11 @@ class PolicyChangelog
|
|
178
181
|
|
179
182
|
# Search for cookbook downgrade and raise an error if any
|
180
183
|
def validate_downgrade!(data)
|
181
|
-
downgrade = data.select
|
184
|
+
downgrade = data.select do |_, ck|
|
185
|
+
# Do not try to validate downgrade on non-sementic versions (e.g. git revision)
|
186
|
+
ck['target_version'] =~ VERSION_REGEX && ck['current_version'] =~ VERSION_REGEX &&
|
187
|
+
::Gem::Version.new(ck['target_version']) < ::Gem::Version.new(ck['current_version'])
|
188
|
+
end
|
182
189
|
|
183
190
|
return if downgrade.empty?
|
184
191
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-changelog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregoire Seux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|