librarian-puppet-maestrodev 0.9.11.4 → 0.9.11.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MDM5ZTU0ZTljMjZmY2M3MjljOTZjOTY5YzUzNDVhOWQ4ZGJhMDFkYw==
5
+ data.tar.gz: !binary |-
6
+ Zjk3ZWQxNjhlMzg4MWFiYTlmYjMxOGQ1ZjYxMjg1YmU3ZmQ3ZDE5NA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ YmI4NDRmM2U2NWJhOTM5NzM4OTYzYmM4N2UxY2YwYTg4MWVhMmJlMWRlMzJi
10
+ NzhhODdkZWZiYTIxMjY5OGYwMDM1ZTI3ZjA5Nzc4NThmN2EwOGY1MzFlZjQ3
11
+ N2U1YmM1NzAxNDJkZjkzNzkwNzgyMjYyZWU1YzkwNDMyMWJmYTE=
12
+ data.tar.gz: !binary |-
13
+ YTU1NmQ1NTMyYWE5M2U4YTJkODkxMmMzZDNmZWQ5ZjZlYmFkNjg3MGFmZWNl
14
+ NGNmYzlmY2JiNGQ5Y2VkOGNjZmFlMzYzZjdkYjY4YjEyZTY4MGUzMDNkOGQ0
15
+ Y2NkOTJjZTIxMDY2YTQ5ZWEzYTFkNzZkZDg0YTMyNjJjYTZiMDc=
@@ -1,7 +1,18 @@
1
1
  require 'librarian'
2
2
  require 'fileutils'
3
3
  require 'open3'
4
- require 'open3_backport' if RUBY_VERSION < '1.9'
4
+
5
+ # require open3_backport in ruby 1.8 and install if not present
6
+ # https://github.com/rodjek/librarian-puppet/issues/167
7
+ if RUBY_VERSION < '1.9'
8
+ begin
9
+ require 'open3_backport'
10
+ rescue LoadError
11
+ require 'rubygems/dependency_installer.rb'
12
+ Gem::DependencyInstaller.new.install 'open3_backport'
13
+ require 'open3_backport'
14
+ end
15
+ end
5
16
 
6
17
  status = nil
7
18
  out = nil
@@ -5,11 +5,8 @@ module Librarian
5
5
  module Puppet
6
6
  extend self
7
7
  extend Librarian
8
-
9
8
  end
10
- end
11
9
 
12
- module Librarian
13
10
  class Dependency
14
11
  class Requirement
15
12
  def initialize(*args)
@@ -38,7 +35,6 @@ module Librarian
38
35
  def hash
39
36
  self.to_s.hash
40
37
  end
41
-
42
38
  end
43
39
 
44
40
  # Fixes for librarian not yet released in their gem
@@ -71,189 +67,6 @@ module Librarian
71
67
  end
72
68
  end
73
69
 
74
-
75
- module Action
76
- class Install < Base
77
-
78
- private
79
-
80
- def create_install_path
81
- install_path.rmtree if install_path.exist? && destructive?
82
- install_path.mkpath
83
- end
84
-
85
- def destructive?
86
- environment.config_db.local['destructive'] == 'true'
87
- end
88
- end
89
- end
90
-
91
- class ManifestSet
92
- private
93
-
94
- # Check if module doesn't exist and fail fast
95
- def dependencies_of(names)
96
- names = Array === names ? names.dup : names.to_a
97
- assert_strings!(names)
98
-
99
- deps = Set.new
100
- until names.empty?
101
- name = names.shift
102
- next if deps.include?(name)
103
-
104
- deps << name
105
- raise(Error, "Unable to find module #{name}") if index[name].nil?
106
- names.concat index[name].dependencies.map(&:name)
107
- end
108
- deps.to_a
109
- end
110
- end
111
-
112
- class Manifest
113
-
114
- class PreReleaseVersion
115
-
116
- # Compares pre-release component ids using Semver 2.0.0 spec
117
- def self.compare_components(this_id,other_id)
118
- case # Strings have higher precedence than numbers
119
- when (this_id.is_a?(Integer) and other_id.is_a?(String))
120
- -1
121
- when (this_id.is_a?(String) and other_id.is_a?(Integer))
122
- 1
123
- else
124
- this_id <=> other_id
125
- end
126
- end
127
-
128
- # Parses pre-release components `a.b.c` into an array ``[a,b,c]`
129
- # Converts numeric components into +Integer+
130
- def self.parse(prerelease)
131
- if prerelease.nil?
132
- []
133
- else
134
- prerelease.split('.').collect do |id|
135
- id = Integer(id) if /^[0-9]+$/ =~ id
136
- id
137
- end
138
- end
139
- end
140
-
141
- include Comparable
142
-
143
- attr_reader :components
144
-
145
- def initialize(prerelease)
146
- @prerelease = prerelease
147
- @components = PreReleaseVersion.parse(prerelease)
148
- end
149
-
150
- def to_s
151
- @prerelease
152
- end
153
-
154
- def <=>(other)
155
- # null-fill zip array to prevent loss of components
156
- z = Array.new([components.length,other.components.length])
157
-
158
- # Compare each component against the other
159
- comp = z.zip(components,other.components).collect do |ids|
160
- case # All components being equal, the version with more of them takes precedence
161
- when ids[1].nil? # Self has less elements, other wins
162
- -1
163
- when ids[2].nil? # Other has less elements, self wins
164
- 1
165
- else
166
- PreReleaseVersion.compare_components(ids[1],ids[2])
167
- end
168
- end
169
- # Chose the first non-zero comparison or return 0
170
- comp.delete_if {|c| c == 0}[0] || 0
171
- end
172
- end
173
- class Version
174
- @@SEMANTIC_VERSION_PATTERN = /^([0-9]+\.[0-9]+(?:\.[0-9]+)?)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/
175
- def self.parse_semver(version_string)
176
- parsed = @@SEMANTIC_VERSION_PATTERN.match(version_string.strip)
177
- if parsed
178
- {
179
- :full_version => parsed[0],
180
- :version => parsed[1],
181
- :prerelease => (PreReleaseVersion.new(parsed[2]) if parsed[2]),
182
- :build => parsed[3]
183
- }
184
- end
185
- end
186
-
187
- attr_reader :prerelease
188
-
189
- def initialize(*args)
190
- args = initialize_normalize_args(args)
191
- semver = Version.parse_semver(*args)
192
- if semver
193
- self.backing = Gem::Version.new(semver[:version])
194
- @prerelease = semver[:prerelease]
195
- @full_version = semver[:full_version]
196
- else
197
- self.backing = Gem::Version.new(*args)
198
- @full_version = to_gem_version.to_s
199
- end
200
- end
201
-
202
- def <=>(other)
203
- cmp = to_gem_version <=> other.to_gem_version
204
-
205
- # Should compare pre-release versions?
206
- if cmp == 0 and not (prerelease.nil? and other.prerelease.nil?)
207
- case # Versions without prerelease take precedence
208
- when (prerelease.nil? and not other.prerelease.nil?)
209
- 1
210
- when (not prerelease.nil? and other.prerelease.nil?)
211
- -1
212
- else
213
- prerelease <=> other.prerelease
214
- end
215
- else
216
- cmp
217
- end
218
- end
219
-
220
- def to_s
221
- @full_version
222
- end
223
- end
224
- end
225
-
226
- # Fixes for librarian not yet released in their gem
227
- module Mock
228
- module Source
229
- class Mock
230
- alias :eql? :==
231
-
232
- def hash
233
- self.to_s.hash
234
- end
235
- end
236
- end
237
- end
238
- module Source
239
- class Git
240
- alias :eql? :==
241
-
242
- def hash
243
- self.to_s.hash
244
- end
245
- end
246
-
247
- class Path
248
- alias :eql? :==
249
-
250
- def hash
251
- self.to_s.hash
252
- end
253
- end
254
- end
255
-
256
-
257
70
  module Action
258
71
  class Install < Base
259
72
 
@@ -19,7 +19,11 @@ module Librarian
19
19
  def versions
20
20
  return @versions if @versions
21
21
  @versions = api_data[name].map { |r| r['version'] }.reverse
22
- debug { " Module #{name} found versions: #{@versions.join(", ")}" }
22
+ if @versions.empty?
23
+ info { "No versions found for module #{name}" }
24
+ else
25
+ debug { " Module #{name} found versions: #{@versions.join(", ")}" }
26
+ end
23
27
  @versions
24
28
  end
25
29
 
@@ -136,6 +140,9 @@ module Librarian
136
140
  def debug(*args, &block)
137
141
  environment.logger.debug(*args, &block)
138
142
  end
143
+ def info(*args, &block)
144
+ environment.logger.info(*args, &block)
145
+ end
139
146
 
140
147
  private
141
148
  def api_data
@@ -1,5 +1,6 @@
1
1
  require 'uri'
2
2
  require 'net/https'
3
+ require 'open-uri'
3
4
  require 'json'
4
5
 
5
6
  require 'librarian/puppet/version'
@@ -98,7 +99,20 @@ module Librarian
98
99
 
99
100
  url = "https://api.github.com/repos/#{name}/tarball/#{version}"
100
101
  url << "?access_token=#{ENV['GITHUB_API_TOKEN']}" if ENV['GITHUB_API_TOKEN']
101
- `curl #{url} -o #{vendored_path(name, version).to_s} -L 2>&1`
102
+
103
+ File.open(vendored_path(name, version).to_s, 'wb') do |f|
104
+ begin
105
+ debug { "Downloading <#{url}> to <#{f.path}>" }
106
+ open(url,
107
+ "User-Agent" => "librarian-puppet v#{Librarian::Puppet::VERSION}") do |res|
108
+ while buffer = res.read(8192)
109
+ f.write(buffer)
110
+ end
111
+ end
112
+ rescue OpenURI::HTTPError => e
113
+ raise e, "Error requesting <#{url}>: #{e.to_s}"
114
+ end
115
+ end
102
116
  end
103
117
 
104
118
  def clean_up_old_cached_versions(name)
@@ -107,6 +121,10 @@ module Librarian
107
121
  end
108
122
  end
109
123
 
124
+ def debug(*args, &block)
125
+ environment.logger.debug(*args, &block)
126
+ end
127
+
110
128
  private
111
129
 
112
130
  def api_call(path)
@@ -1,5 +1,5 @@
1
1
  module Librarian
2
2
  module Puppet
3
- VERSION = "0.9.11.4"
3
+ VERSION = "0.9.11.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,104 +1,127 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: librarian-puppet-maestrodev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.11.4
5
- prerelease:
4
+ version: 0.9.11.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Tim Sharpe
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-01-09 00:00:00.000000000 Z
11
+ date: 2014-01-27 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: librarian
16
- requirement: &13791080 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.1.1
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *13791080
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.1.1
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: rake
27
- requirement: &13790320 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ! '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *13790320
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: rspec
38
- requirement: &13789840 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
45
  - - ! '>='
42
46
  - !ruby/object:Gem::Version
43
47
  version: '0'
44
48
  type: :development
45
49
  prerelease: false
46
- version_requirements: *13789840
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
47
55
  - !ruby/object:Gem::Dependency
48
56
  name: cucumber
49
- requirement: &13789160 !ruby/object:Gem::Requirement
50
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
51
58
  requirements:
52
59
  - - ! '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  type: :development
56
63
  prerelease: false
57
- version_requirements: *13789160
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: aruba
60
- requirement: &13788500 !ruby/object:Gem::Requirement
61
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
62
72
  requirements:
63
73
  - - ! '>='
64
74
  - !ruby/object:Gem::Version
65
75
  version: '0'
66
76
  type: :development
67
77
  prerelease: false
68
- version_requirements: *13788500
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: puppet
71
- requirement: &13787560 !ruby/object:Gem::Requirement
72
- none: false
85
+ requirement: !ruby/object:Gem::Requirement
73
86
  requirements:
74
87
  - - ! '>='
75
88
  - !ruby/object:Gem::Version
76
89
  version: '0'
77
90
  type: :development
78
91
  prerelease: false
79
- version_requirements: *13787560
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
80
97
  - !ruby/object:Gem::Dependency
81
98
  name: minitest
82
- requirement: &13786380 !ruby/object:Gem::Requirement
83
- none: false
99
+ requirement: !ruby/object:Gem::Requirement
84
100
  requirements:
85
101
  - - ~>
86
102
  - !ruby/object:Gem::Version
87
103
  version: '5'
88
104
  type: :development
89
105
  prerelease: false
90
- version_requirements: *13786380
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: '5'
91
111
  - !ruby/object:Gem::Dependency
92
112
  name: mocha
93
- requirement: &13785900 !ruby/object:Gem::Requirement
94
- none: false
113
+ requirement: !ruby/object:Gem::Requirement
95
114
  requirements:
96
115
  - - ! '>='
97
116
  - !ruby/object:Gem::Version
98
117
  version: '0'
99
118
  type: :development
100
119
  prerelease: false
101
- version_requirements: *13785900
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ! '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
102
125
  description: ! "Simplify deployment of your Puppet infrastructure by\n automatically
103
126
  pulling in modules from the forge and git repositories with\n a single command."
104
127
  email:
@@ -113,49 +136,42 @@ files:
113
136
  - README.md
114
137
  - bin/librarian-puppet
115
138
  - lib/librarian/puppet.rb
116
- - lib/librarian/puppet/dsl.rb
117
- - lib/librarian/puppet/source.rb
118
- - lib/librarian/puppet/lockfile/parser.rb
119
139
  - lib/librarian/puppet/cli.rb
140
+ - lib/librarian/puppet/dsl.rb
120
141
  - lib/librarian/puppet/environment.rb
121
- - lib/librarian/puppet/requirement.rb
122
- - lib/librarian/puppet/version.rb
123
- - lib/librarian/puppet/templates/Puppetfile
124
142
  - lib/librarian/puppet/extension.rb
143
+ - lib/librarian/puppet/lockfile/parser.rb
144
+ - lib/librarian/puppet/requirement.rb
145
+ - lib/librarian/puppet/source.rb
125
146
  - lib/librarian/puppet/source/forge.rb
126
- - lib/librarian/puppet/source/githubtarball.rb
127
147
  - lib/librarian/puppet/source/git.rb
128
- - lib/librarian/puppet/source/path.rb
148
+ - lib/librarian/puppet/source/githubtarball.rb
129
149
  - lib/librarian/puppet/source/local.rb
150
+ - lib/librarian/puppet/source/path.rb
151
+ - lib/librarian/puppet/templates/Puppetfile
152
+ - lib/librarian/puppet/version.rb
130
153
  homepage: https://github.com/rodjek/librarian-puppet
131
154
  licenses:
132
155
  - MIT
156
+ metadata: {}
133
157
  post_install_message:
134
158
  rdoc_options: []
135
159
  require_paths:
136
160
  - lib
137
161
  required_ruby_version: !ruby/object:Gem::Requirement
138
- none: false
139
162
  requirements:
140
163
  - - ! '>='
141
164
  - !ruby/object:Gem::Version
142
165
  version: '0'
143
- segments:
144
- - 0
145
- hash: 1121016427067357910
146
166
  required_rubygems_version: !ruby/object:Gem::Requirement
147
- none: false
148
167
  requirements:
149
168
  - - ! '>='
150
169
  - !ruby/object:Gem::Version
151
170
  version: '0'
152
- segments:
153
- - 0
154
- hash: 1121016427067357910
155
171
  requirements: []
156
172
  rubyforge_project:
157
- rubygems_version: 1.8.9
173
+ rubygems_version: 2.2.1
158
174
  signing_key:
159
- specification_version: 3
175
+ specification_version: 4
160
176
  summary: Bundler for your Puppet modules
161
177
  test_files: []