librarian-puppet-maestrodev 0.9.9.1 → 0.9.9.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,9 +14,11 @@ module Librarian
14
14
  def initialize(source, name)
15
15
  self.source = source
16
16
  self.name = name
17
+ @dependencies = {}
17
18
  end
18
19
 
19
20
  def versions
21
+ return @versions if @versions
20
22
  data = api_call("#{name}.json")
21
23
  if data.nil?
22
24
  raise Error, "Unable to find module '#{name}' on #{source}"
@@ -24,12 +26,16 @@ module Librarian
24
26
 
25
27
  versions = data['releases'].map { |r| r['version'] }.sort.reverse
26
28
  versions.select { |v| ! Gem::Version.correct? v }.each { |v| debug { "Ignoring invalid version '#{v}' for module #{name}" } }
27
- versions.select { |v| Gem::Version.correct? v }
29
+ @versions = versions.select { |v| Gem::Version.correct? v }
28
30
  end
29
31
 
30
32
  def dependencies(version)
33
+ return @dependencies[version] if @dependencies[version]
31
34
  data = api_call("api/v1/releases.json?module=#{name}&version=#{version}")
32
- data[name].first['dependencies']
35
+ if data.nil?
36
+ raise Error, "Unable to find version #{version} for module '#{name}' on #{source}"
37
+ end
38
+ @dependencies[version] = data[name].first['dependencies']
33
39
  end
34
40
 
35
41
  def manifests
@@ -158,11 +164,14 @@ module Librarian
158
164
  def api_call(path)
159
165
  base_url = source.uri
160
166
  resp = Net::HTTP.get_response(URI.parse("#{base_url}/#{path}"))
161
- if resp.code.to_i != 200
167
+ case resp.code.to_i
168
+ when 404,410
162
169
  nil
163
- else
170
+ when 200
164
171
  data = resp.body
165
172
  JSON.parse(data)
173
+ else
174
+ raise Error, "Error requesting #{base_url}/#{path}: [#{resp.code}] #{resp.body}"
166
175
  end
167
176
  end
168
177
  end
@@ -1,5 +1,5 @@
1
1
  module Librarian
2
2
  module Puppet
3
- VERSION = "0.9.9.1"
3
+ VERSION = "0.9.9.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,107 +1,137 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: librarian-puppet-maestrodev
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.9.2
4
5
  prerelease:
5
- version: 0.9.9.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Tim Sharpe
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2013-05-02 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2013-05-12 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: librarian
17
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
18
17
  none: false
19
- requirements:
20
- - - ">="
21
- - !ruby/object:Gem::Version
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
22
21
  version: 0.1.0
23
22
  type: :runtime
24
23
  prerelease: false
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.1.0
30
+ - !ruby/object:Gem::Dependency
27
31
  name: thor
28
- requirement: &id002 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
29
33
  none: false
30
- requirements:
34
+ requirements:
31
35
  - - ~>
32
- - !ruby/object:Gem::Version
33
- version: "0.15"
36
+ - !ruby/object:Gem::Version
37
+ version: '0.15'
34
38
  type: :runtime
35
39
  prerelease: false
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '0.15'
46
+ - !ruby/object:Gem::Dependency
38
47
  name: json
39
- requirement: &id003 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
40
49
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- version: "0"
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
45
54
  type: :runtime
46
55
  prerelease: false
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
49
63
  name: rake
50
- requirement: &id004 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
51
65
  none: false
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- version: "0"
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
56
70
  type: :development
57
71
  prerelease: false
58
- version_requirements: *id004
59
- - !ruby/object:Gem::Dependency
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
60
79
  name: rspec
61
- requirement: &id005 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
62
81
  none: false
63
- requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: "0"
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
67
86
  type: :development
68
87
  prerelease: false
69
- version_requirements: *id005
70
- - !ruby/object:Gem::Dependency
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
71
95
  name: cucumber
72
- requirement: &id006 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
73
97
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- version: "0"
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
78
102
  type: :development
79
103
  prerelease: false
80
- version_requirements: *id006
81
- - !ruby/object:Gem::Dependency
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
82
111
  name: aruba
83
- requirement: &id007 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
84
113
  none: false
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- version: "0"
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
89
118
  type: :development
90
119
  prerelease: false
91
- version_requirements: *id007
92
- description: |-
93
- Simplify deployment of your Puppet infrastructure by
94
- automatically pulling in modules from the forge and git repositories with
95
- a single command.
96
- email:
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ description: ! "Simplify deployment of your Puppet infrastructure by\n automatically
127
+ pulling in modules from the forge and git repositories with\n a single command."
128
+ email:
97
129
  - tim@sharpe.id.au
98
- executables:
130
+ executables:
99
131
  - librarian-puppet
100
132
  extensions: []
101
-
102
133
  extra_rdoc_files: []
103
-
104
- files:
134
+ files:
105
135
  - .gitignore
106
136
  - LICENSE
107
137
  - README.md
@@ -123,36 +153,32 @@ files:
123
153
  - lib/librarian/puppet/source/local.rb
124
154
  homepage: https://github.com/rodjek/librarian-puppet
125
155
  licenses: []
126
-
127
156
  post_install_message:
128
157
  rdoc_options: []
129
-
130
- require_paths:
158
+ require_paths:
131
159
  - lib
132
- required_ruby_version: !ruby/object:Gem::Requirement
160
+ required_ruby_version: !ruby/object:Gem::Requirement
133
161
  none: false
134
- requirements:
135
- - - ">="
136
- - !ruby/object:Gem::Version
137
- hash: 286545709670238438
138
- segments:
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ segments:
139
167
  - 0
140
- version: "0"
141
- required_rubygems_version: !ruby/object:Gem::Requirement
168
+ hash: -3047912209138248583
169
+ required_rubygems_version: !ruby/object:Gem::Requirement
142
170
  none: false
143
- requirements:
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- hash: 286545709670238438
147
- segments:
171
+ requirements:
172
+ - - ! '>='
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ segments:
148
176
  - 0
149
- version: "0"
177
+ hash: -3047912209138248583
150
178
  requirements: []
151
-
152
179
  rubyforge_project:
153
180
  rubygems_version: 1.8.25
154
181
  signing_key:
155
182
  specification_version: 3
156
183
  summary: Bundler for your Puppet modules
157
184
  test_files: []
158
-