knife-changelog 0.5.12 → 0.5.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/knife/changelog/changelog.rb +9 -14
- data/lib/knife/changelog/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42b8ebdc6c1d371430a8d3c9d9623fd42a5e24f3
|
4
|
+
data.tar.gz: c09025a1ea5804c850431e08fb7a221d3f4dad4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bdf31349f11854ddad60c1deeb1c28c091ebc055b22c530bd2aceddcf63aa56176ca224f39de0633b8c40ae7531235c789cc7822ce6b00ab0e2903c18cec111
|
7
|
+
data.tar.gz: 11731016efb77bd4645c34bfc614cd97e6e84b016ddaf1a444ebc20397fc6a2432adc65608326eddb7b077e363a85f29df47b10beedd8e92276dce1044fc018a
|
@@ -105,7 +105,7 @@ class KnifeChangelog
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def get_from_supermarket_sources(name)
|
108
|
-
|
108
|
+
@sources.map do |s|
|
109
109
|
begin
|
110
110
|
RestClient::Request.execute(
|
111
111
|
url: "#{s.uri}/api/v1/cookbooks/#{name}",
|
@@ -115,20 +115,15 @@ class KnifeChangelog
|
|
115
115
|
rescue
|
116
116
|
nil
|
117
117
|
end
|
118
|
-
}.compact.map do |json|
|
119
|
-
ck = JSON.parse(json)
|
120
|
-
ck['source_url'] || ck ['external_url']
|
121
|
-
end.uniq
|
122
|
-
case urls.size
|
123
|
-
when 0
|
124
|
-
Chef::Log.warn "No external url for #{name}"
|
125
|
-
raise "Canot find any changelog source for #{name}"
|
126
|
-
when 1
|
127
|
-
urls.first
|
128
|
-
else
|
129
|
-
Chef::Log.warn "#{name} has different urls on various sources ??"
|
130
|
-
raise "Cannot decide which source to choose for #{name}"
|
131
118
|
end
|
119
|
+
.compact
|
120
|
+
.map { |json| JSON.parse(json) }
|
121
|
+
.sort_by { |ck| Gem::Version.new(ck['latest_version'].split('/').last) }
|
122
|
+
.map { |ck| ck['source_url'] || ck ['external_url'] }
|
123
|
+
.last
|
124
|
+
.tap do |source|
|
125
|
+
raise "Canot find any changelog source for #{name}" unless source
|
126
|
+
end
|
132
127
|
end
|
133
128
|
|
134
129
|
def handle_source(name, dep)
|
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: 0.5.
|
4
|
+
version: 0.5.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregoire Seux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|