librarian-puppet-maestrodev 0.9.9.7 → 0.9.9.8
Sign up to get free protection for your applications and to get access to all the features.
@@ -7,22 +7,22 @@ module Librarian
|
|
7
7
|
class Forge
|
8
8
|
class Repo
|
9
9
|
|
10
|
-
attr_accessor :source, :name
|
11
|
-
private :source=, :name
|
10
|
+
attr_accessor :source, :name
|
11
|
+
private :source=, :name=
|
12
12
|
|
13
13
|
def initialize(source, name)
|
14
14
|
self.source = source
|
15
15
|
self.name = name
|
16
|
+
@api_data = nil
|
17
|
+
end
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
-
if api_data.nil?
|
20
|
-
raise Error, "Unable to find module '#{name}' on #{source}"
|
21
|
-
end
|
19
|
+
def versions
|
20
|
+
return @versions if @versions
|
22
21
|
versions = api_data[name].map { |r| r['version'] }.reverse
|
23
22
|
debug { " Module #{name} found versions: #{versions.join(", ")}" }
|
24
23
|
versions.select { |v| ! Gem::Version.correct? v }.each { |v| debug { "Ignoring invalid version '#{v}' for module #{name}" } }
|
25
|
-
|
24
|
+
@versions = versions.select { |v| Gem::Version.correct? v }
|
25
|
+
@versions
|
26
26
|
end
|
27
27
|
|
28
28
|
def dependencies(version)
|
@@ -95,6 +95,7 @@ module Librarian
|
|
95
95
|
|
96
96
|
|
97
97
|
command = "puppet module install --version #{version} --target-dir '#{path}' --module_repository '#{source}' --modulepath '#{path}' --ignore-dependencies '#{target}'"
|
98
|
+
debug { "Executing puppet module install for #{name} #{version}" }
|
98
99
|
output = `#{command}`
|
99
100
|
|
100
101
|
# Check for bad exit code
|
@@ -138,8 +139,18 @@ module Librarian
|
|
138
139
|
end
|
139
140
|
|
140
141
|
private
|
142
|
+
def api_data
|
143
|
+
return @api_data if @api_data
|
144
|
+
# call API and cache data
|
145
|
+
@api_data = api_call(name)
|
146
|
+
if @api_data.nil?
|
147
|
+
raise Error, "Unable to find module '#{name}' on #{source}"
|
148
|
+
end
|
149
|
+
@api_data
|
150
|
+
end
|
141
151
|
|
142
152
|
def api_call(module_name)
|
153
|
+
debug { "Querying Forge API for module #{name}" }
|
143
154
|
base_url = source.uri
|
144
155
|
begin
|
145
156
|
data = open("#{base_url}/api/v1/releases.json?module=#{module_name}") {|f| f.read}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: librarian-puppet-maestrodev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.9.
|
4
|
+
version: 0.9.9.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -149,7 +149,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
149
149
|
version: '0'
|
150
150
|
segments:
|
151
151
|
- 0
|
152
|
-
hash: -
|
152
|
+
hash: -1093121364581452316
|
153
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
154
|
none: false
|
155
155
|
requirements:
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
version: '0'
|
159
159
|
segments:
|
160
160
|
- 0
|
161
|
-
hash: -
|
161
|
+
hash: -1093121364581452316
|
162
162
|
requirements: []
|
163
163
|
rubyforge_project:
|
164
164
|
rubygems_version: 1.8.25
|