librarian-puppet 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc346f2177b53715db49807f07d06f48159669b5
4
- data.tar.gz: 26ce629378954d0971ecb98232f826e6539e99e4
3
+ metadata.gz: 4c591126a06c111f5516e60e9096e0420f9f63c6
4
+ data.tar.gz: dce4f65b9e264206e5d939d5bba055a63062b3f1
5
5
  SHA512:
6
- metadata.gz: 362ea152db680bd68ce4082ffbf39ba25132be50fb529a169ec7514779e66790ff92bec2c1e1d4c15752d9d4ee50cd35f88f62f26697b0c6ebb739574515089f
7
- data.tar.gz: a14c13c99aeaab3f74b4ecadcece3654a37975fcf509808e6797c14aa8df07b18b3ff08b078a21000cfc44e70e237c328db796970e1c3072a167964d657f13df
6
+ metadata.gz: 02a25ae82756062838af2a150af49a0bbee01e19842dce6f0c4c6e5ee77125a72db8ee39c18c4699342832894edbe9ee1612405894acea633eb05f32d91a7cf8
7
+ data.tar.gz: 67f612d163c8b3af0479ac1338b2ff7df17b836628de0973d41fd4a233742b6eb43e9f399d05fb527ce7661eb9c39d488e0a5040e9be0cc9053508fca0b1bbec
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  Librarian-puppet is a bundler for your puppet infrastructure. You can use
8
8
  librarian-puppet to manage the puppet modules your infrastructure depends on,
9
9
  whether the modules come from the [Puppet Forge](https://forge.puppetlabs.com/),
10
- Git repositories or a just a path.
10
+ Git repositories or just a path.
11
11
 
12
12
  * Librarian-puppet can reuse the dependencies listed in your `Modulefile` or `metadata.json`
13
13
  * Forge modules can be installed from [Puppetlabs Forge](https://forge.puppetlabs.com/) or an internal Forge such as [Pulp](http://www.pulpproject.org/)
@@ -6,6 +6,8 @@ module Librarian
6
6
  module Puppet
7
7
  class Dsl < Librarian::Dsl
8
8
 
9
+ FORGE_URL = "http://forge.puppetlabs.com"
10
+
9
11
  dependency :mod
10
12
 
11
13
  source :forge => Source::Forge
@@ -20,7 +22,7 @@ module Librarian
20
22
  if specfile.kind_of?(Pathname) and !File.exists?(specfile)
21
23
  debug { "Specfile not found, using defaults: #{specfile}" }
22
24
  specfile = Proc.new do
23
- forge "http://forge.puppetlabs.com"
25
+ forge FORGE_URL
24
26
  metadata
25
27
  end
26
28
  end
@@ -33,6 +35,10 @@ module Librarian
33
35
  receiver = Receiver.new(target)
34
36
  receiver.run(specfile)
35
37
 
38
+ # save the default forge defined
39
+ default_forge = target.sources.select {|s| s.is_a? Librarian::Puppet::Source::Forge}.first
40
+ Librarian::Puppet::Source::Forge.default = default_forge || Librarian::Puppet::Source::Forge.from_lock_options(environment, :remote => FORGE_URL)
41
+
36
42
  debug_named_source_cache("Post-Cached Sources", target)
37
43
  end.to_spec
38
44
  end
@@ -70,7 +76,12 @@ module Librarian
70
76
  raise Error, msg
71
77
  end
72
78
  end
73
- dependencyList = JSON.parse(File.read(f))['dependencies']
79
+ begin
80
+ json = JSON.parse(File.read(f))
81
+ rescue JSON::ParserError => e
82
+ raise Error, "Unable to parse json file #{f}: #{e}"
83
+ end
84
+ dependencyList = json['dependencies']
74
85
  dependencyList.each do |d|
75
86
  mod(d['name'], d['version_requirement'])
76
87
  end
@@ -12,6 +12,14 @@ module Librarian
12
12
  class << self
13
13
  LOCK_NAME = 'FORGE'
14
14
 
15
+ def default=(source)
16
+ @@default = source
17
+ end
18
+
19
+ def default
20
+ @@default
21
+ end
22
+
15
23
  def lock_name
16
24
  LOCK_NAME
17
25
  end
@@ -55,7 +55,7 @@ module Librarian
55
55
  end
56
56
 
57
57
  def forge_source
58
- Forge.from_lock_options(environment, :remote => "https://forge.puppetlabs.com")
58
+ Forge.default
59
59
  end
60
60
 
61
61
  private
@@ -105,7 +105,11 @@ module Librarian
105
105
  def parsed_metadata
106
106
  if @metadata.nil?
107
107
  @metadata = if metadata?
108
- JSON.parse(File.read(metadata))
108
+ begin
109
+ JSON.parse(File.read(metadata))
110
+ rescue JSON::ParserError => e
111
+ raise Error, "Unable to parse json file #{metadata}: #{e}"
112
+ end
109
113
  elsif modulefile?
110
114
  # translate Modulefile to metadata.json
111
115
  evaluated = evaluate_modulefile(modulefile)
@@ -159,8 +163,8 @@ module Librarian
159
163
  return true if path.join('manifests').exist?
160
164
  return true if path.join('lib').join('puppet').exist?
161
165
  return true if path.join('lib').join('facter').exist?
162
- debug { "Could not find manifests, lib/puppet or lib/facter under #{path}, assuming is not a puppet module" }
163
- false
166
+ debug { "Could not find manifests, lib/puppet or lib/facter under #{path}, maybe it is not a puppet module" }
167
+ true
164
168
  end
165
169
  end
166
170
  end
@@ -30,7 +30,7 @@ module Librarian
30
30
  else
31
31
  begin
32
32
  FileUtils.cp_r(src, dest, :preserve => true)
33
- rescue Errno::ENOENT
33
+ rescue Errno::ENOENT, Errno::EACCES
34
34
  debug { "Failed to copy from #{src} to #{dest} preserving file types, trying again without preserving them" }
35
35
  FileUtils.rm_rf(dest)
36
36
  FileUtils.cp_r(src, dest)
@@ -1,5 +1,5 @@
1
1
  module Librarian
2
2
  module Puppet
3
- VERSION = "1.4.0"
3
+ VERSION = "1.4.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: librarian-puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Sharpe
@@ -9,160 +9,160 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-14 00:00:00.000000000 Z
12
+ date: 2014-12-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: librarian
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: 0.1.2
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: 0.1.2
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rsync
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: json
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rake
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - '>='
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rspec
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - '>='
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - '>='
81
+ - - ">="
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: cucumber
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '>='
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - '>='
95
+ - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: aruba
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - '>='
102
+ - - ">="
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - '>='
109
+ - - ">="
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: puppet
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - '>='
116
+ - - ">="
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  type: :development
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - '>='
123
+ - - ">="
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: minitest
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - ~>
130
+ - - "~>"
131
131
  - !ruby/object:Gem::Version
132
132
  version: '5'
133
133
  type: :development
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - ~>
137
+ - - "~>"
138
138
  - !ruby/object:Gem::Version
139
139
  version: '5'
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: mocha
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - '>='
144
+ - - ">="
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  type: :development
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
- - - '>='
151
+ - - ">="
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: simplecov
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
- - - '>='
158
+ - - ">="
159
159
  - !ruby/object:Gem::Version
160
160
  version: 0.9.0
161
161
  type: :development
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
- - - '>='
165
+ - - ">="
166
166
  - !ruby/object:Gem::Version
167
167
  version: 0.9.0
168
168
  description: |-
@@ -177,7 +177,7 @@ executables:
177
177
  extensions: []
178
178
  extra_rdoc_files: []
179
179
  files:
180
- - .gitignore
180
+ - ".gitignore"
181
181
  - LICENSE
182
182
  - README.md
183
183
  - bin/librarian-puppet
@@ -214,17 +214,17 @@ require_paths:
214
214
  - lib
215
215
  required_ruby_version: !ruby/object:Gem::Requirement
216
216
  requirements:
217
- - - '>='
217
+ - - ">="
218
218
  - !ruby/object:Gem::Version
219
219
  version: '0'
220
220
  required_rubygems_version: !ruby/object:Gem::Requirement
221
221
  requirements:
222
- - - '>='
222
+ - - ">="
223
223
  - !ruby/object:Gem::Version
224
224
  version: '0'
225
225
  requirements: []
226
226
  rubyforge_project:
227
- rubygems_version: 2.2.2
227
+ rubygems_version: 2.2.0
228
228
  signing_key:
229
229
  specification_version: 4
230
230
  summary: Bundler for your Puppet modules