librarian-puppet-maestrodev 0.9.11.2 → 0.9.11.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,16 +1,33 @@
1
1
  require 'librarian'
2
2
  require 'fileutils'
3
+ require 'open3'
4
+ require 'open3_backport' if RUBY_VERSION < '1.9'
5
+
6
+ status = nil
7
+ out = nil
8
+ error = nil
3
9
 
4
10
  begin
5
- require 'puppet'
6
- rescue LoadError
11
+ Open3.popen3('puppet --version') {|stdin, stdout, stderr, wait_thr|
12
+ pid = wait_thr.pid # pid of the started process.
13
+ out = stdout.read
14
+ status = wait_thr.value # Process::Status object returned.
15
+ }
16
+ rescue => e
17
+ error = e
18
+ end
19
+
20
+ if status.nil? or status.exitstatus != 0
7
21
  $stderr.puts <<-EOF
8
- Unable to load puppet. Either install it using native packages for your
9
- platform (eg .deb, .rpm, .dmg, etc) or as a gem (gem install puppet).
22
+ Unable to load puppet. Please install it using native packages for your platform (eg .deb, .rpm, .dmg, etc).
23
+ #{out.nil? or out.empty? ? "puppet --version returned #{status.exitstatus}" : out}
24
+ #{error.message unless error.nil?}
10
25
  EOF
11
26
  exit 1
12
27
  end
13
28
 
29
+ PUPPET_VERSION=out.split(' ').first.strip
30
+
14
31
  require 'librarian/puppet/extension'
15
32
  require 'librarian/puppet/version'
16
33
 
@@ -28,14 +28,6 @@ module Librarian
28
28
  vendor_path.join('source')
29
29
  end
30
30
 
31
- def cache_path
32
- project_path.join(".tmp/librarian/cache")
33
- end
34
-
35
- def scratch_path
36
- project_path.join(".tmp/librarian/scratch")
37
- end
38
-
39
31
  def vendor!
40
32
  vendor_cache.mkpath unless vendor_cache.exist?
41
33
  vendor_source.mkpath unless vendor_source.exist?
@@ -32,6 +32,13 @@ module Librarian
32
32
  end.flatten
33
33
  end
34
34
  end
35
+
36
+ alias :eql? :==
37
+
38
+ def hash
39
+ self.to_s.hash
40
+ end
41
+
35
42
  end
36
43
 
37
44
  # Fixes for librarian not yet released in their gem
@@ -107,7 +107,7 @@ module Librarian
107
107
 
108
108
  def check_puppet_module_options
109
109
  min_version = Gem::Version.create('2.7.13')
110
- puppet_version = Gem::Version.create(`puppet --version`.split(' ').first.strip.gsub('-', '.'))
110
+ puppet_version = Gem::Version.create(PUPPET_VERSION.gsub('-', '.'))
111
111
 
112
112
  if puppet_version < min_version
113
113
  raise Error, "To get modules from the forge, we use the puppet faces module command. For this you need at least puppet version 2.7.13 and you have #{puppet_version}"
@@ -1,5 +1,6 @@
1
1
  require 'librarian/source/git'
2
2
  require 'librarian/puppet/source/local'
3
+ require 'puppet'
3
4
 
4
5
  module Librarian
5
6
  module Source
@@ -67,7 +68,7 @@ module Librarian
67
68
  end
68
69
 
69
70
  def fetch_dependencies(name, version, extra)
70
- dependencies = []
71
+ dependencies = Set.new
71
72
 
72
73
  if modulefile?
73
74
  metadata = ::Puppet::ModuleTool::Metadata.new
@@ -75,16 +76,16 @@ module Librarian
75
76
  ::Puppet::ModuleTool::ModulefileReader.evaluate(metadata, modulefile)
76
77
 
77
78
  metadata.dependencies.each do |dependency|
78
- name = dependency.instance_variable_get(:@full_module_name)
79
+ dependency_name = dependency.instance_variable_get(:@full_module_name)
79
80
  version = dependency.instance_variable_get(:@version_requirement)
80
81
  gem_requirement = Requirement.new(version).gem_requirement
81
- dependencies.push Dependency.new(name, gem_requirement, forge_source)
82
+ dependencies << Dependency.new(dependency_name, gem_requirement, forge_source)
82
83
  end
83
84
  end
84
85
 
85
86
  if specfile?
86
87
  spec = environment.dsl(Pathname(specfile))
87
- dependencies.concat spec.dependencies
88
+ dependencies.merge spec.dependencies
88
89
  end
89
90
 
90
91
  dependencies
@@ -1,5 +1,5 @@
1
1
  module Librarian
2
2
  module Puppet
3
- VERSION = "0.9.11.2"
3
+ VERSION = "0.9.11.3"
4
4
  end
5
5
  end
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.11.2
4
+ version: 0.9.11.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-03 00:00:00.000000000 Z
12
+ date: 2014-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: librarian
16
- requirement: &9016520 !ruby/object:Gem::Requirement
16
+ requirement: &21733960 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.1.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *9016520
24
+ version_requirements: *21733960
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &9016000 !ruby/object:Gem::Requirement
27
+ requirement: &21730100 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *9016000
35
+ version_requirements: *21730100
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &9015400 !ruby/object:Gem::Requirement
38
+ requirement: &21728140 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *9015400
46
+ version_requirements: *21728140
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &9014940 !ruby/object:Gem::Requirement
49
+ requirement: &21740560 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *9014940
57
+ version_requirements: *21740560
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: cucumber
60
- requirement: &9014460 !ruby/object:Gem::Requirement
60
+ requirement: &21735820 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *9014460
68
+ version_requirements: *21735820
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: aruba
71
- requirement: &9013760 !ruby/object:Gem::Requirement
71
+ requirement: &21750980 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *9013760
79
+ version_requirements: *21750980
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: puppet
82
- requirement: &9029000 !ruby/object:Gem::Requirement
82
+ requirement: &21749380 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *9029000
90
+ version_requirements: *21749380
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: minitest
93
- requirement: &9027820 !ruby/object:Gem::Requirement
93
+ requirement: &21744980 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '5'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *9027820
101
+ version_requirements: *21744980
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: mocha
104
- requirement: &9026840 !ruby/object:Gem::Requirement
104
+ requirement: &21758580 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *9026840
112
+ version_requirements: *21758580
113
113
  description: ! "Simplify deployment of your Puppet infrastructure by\n automatically
114
114
  pulling in modules from the forge and git repositories with\n a single command."
115
115
  email:
@@ -153,7 +153,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
153
153
  version: '0'
154
154
  segments:
155
155
  - 0
156
- hash: 1603487387827623136
156
+ hash: 1390188008599857275
157
157
  required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  none: false
159
159
  requirements:
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  version: '0'
163
163
  segments:
164
164
  - 0
165
- hash: 1603487387827623136
165
+ hash: 1390188008599857275
166
166
  requirements: []
167
167
  rubyforge_project:
168
168
  rubygems_version: 1.8.9