librarian-puppet 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -86,8 +86,7 @@ module Librarian
86
86
  # Specifying the version in the gemspec would force people to upgrade puppet while it's still usable for git
87
87
  # So we do some more clever checking
88
88
  #
89
- # Executing older versions or via puppet-module tool gives an exit status = 0 .
90
- # Therefore we check the available options via the help page
89
+ # Executing older versions or via puppet-module tool gives an exit status = 0 .
91
90
  #
92
91
  check_puppet_module_options
93
92
 
@@ -109,19 +108,11 @@ module Librarian
109
108
  end
110
109
 
111
110
  def check_puppet_module_options
112
- command = "puppet help module install"
113
- options = [ '--target-dir', '--modulepath','--ignore-dependencies' ]
114
- output = `#{command}`
111
+ min_version = Gem::Version.create('2.7.13')
112
+ puppet_version = Gem::Version.create(`puppet --version`.strip)
115
113
 
116
- # Check puppet module for used options
117
- has_options = true
118
- options.each do |option|
119
- unless output.include?(option)
120
- has_options = false
121
- end
122
- end
123
- unless has_options
124
- raise Error, "To get modules from the forge, we use the puppet faces module command. Your current version does not support the options #{options.join(',')} . For this you need at least puppet version 2.7.13"
114
+ if puppet_version < min_version
115
+ raise Error, "To get modules from the forge, we use the puppet faces module command. Your current version does not support the options #{options.join(',')} . For this you need at least puppet version 2.7.13 and you have #{puppet_version}"
125
116
  end
126
117
  end
127
118
 
@@ -271,7 +262,7 @@ module Librarian
271
262
  Dependency.new(k, v, nil)
272
263
  end
273
264
  end
274
-
265
+
275
266
  def manifests(name)
276
267
  repo(name).manifests
277
268
  end
@@ -22,7 +22,8 @@ module Librarian
22
22
  raise Error, "Unable to find module '#{source.uri}' on https://github.com"
23
23
  end
24
24
 
25
- data.map { |r| r['name'] }.sort.reverse
25
+ all_versions = data.map { |r| r['name'] }.sort.reverse
26
+ all_versions.reject { |version| version =~ /^v/ }.compact
26
27
  end
27
28
 
28
29
  def manifests
@@ -85,11 +86,19 @@ module Librarian
85
86
  end
86
87
 
87
88
  def vendor_cache(name, version)
89
+ clean_up_old_cached_versions(name)
90
+
88
91
  url = "https://api.github.com/repos/#{name}/tarball/#{version}"
89
92
  url << "?access_token=#{ENV['GITHUB_API_TOKEN']}" if ENV['GITHUB_API_TOKEN']
90
93
  `curl #{url} -o #{vendored_path(name, version).to_s} -L 2>&1`
91
94
  end
92
95
 
96
+ def clean_up_old_cached_versions(name)
97
+ Dir["#{environment.vendor_cache}/#{name.sub('/', '-')}*.tar.gz"].each do |old_version|
98
+ FileUtils.rm old_version
99
+ end
100
+ end
101
+
93
102
  private
94
103
 
95
104
  def api_call(path)
@@ -1,5 +1,5 @@
1
1
  module Librarian
2
2
  module Puppet
3
- VERSION = "0.9.6"
3
+ VERSION = "0.9.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,121 +1,108 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: librarian-puppet
3
- version: !ruby/object:Gem::Version
4
- version: 0.9.6
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 9
8
+ - 7
9
+ version: 0.9.7
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Tim Sharpe
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2012-10-03 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
16
+
17
+ date: 2012-10-12 00:00:00 +11:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: thor
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: '0.15'
22
- type: :runtime
23
22
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
27
25
  - - ~>
28
- - !ruby/object:Gem::Version
29
- version: '0.15'
30
- - !ruby/object:Gem::Dependency
31
- name: json_pure
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 15
30
+ version: "0.15"
38
31
  type: :runtime
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: json
39
35
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
- - !ruby/object:Gem::Dependency
47
- name: puppet
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
36
+ requirement: &id002 !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 0
42
+ version: "0"
54
43
  type: :runtime
44
+ version_requirements: *id002
45
+ - !ruby/object:Gem::Dependency
46
+ name: puppet
55
47
  prerelease: false
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
48
+ requirement: &id003 !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ segments:
53
+ - 0
54
+ version: "0"
55
+ type: :runtime
56
+ version_requirements: *id003
57
+ - !ruby/object:Gem::Dependency
63
58
  name: rake
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
- type: :development
71
59
  prerelease: false
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
79
- name: cucumber
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ! '>='
84
- - !ruby/object:Gem::Version
85
- version: '0'
60
+ requirement: &id004 !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ segments:
65
+ - 0
66
+ version: "0"
86
67
  type: :development
68
+ version_requirements: *id004
69
+ - !ruby/object:Gem::Dependency
70
+ name: cucumber
87
71
  prerelease: false
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
95
- name: aruba
96
- requirement: !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
99
- - - ! '>='
100
- - !ruby/object:Gem::Version
101
- version: '0'
72
+ requirement: &id005 !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ segments:
77
+ - 0
78
+ version: "0"
102
79
  type: :development
80
+ version_requirements: *id005
81
+ - !ruby/object:Gem::Dependency
82
+ name: aruba
103
83
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ! '>='
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
- description: ! "Simplify deployment of your Puppet infrastructure by\n automatically
111
- pulling in modules from the forge and git repositories with\n a single command."
112
- email:
84
+ requirement: &id006 !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ segments:
89
+ - 0
90
+ version: "0"
91
+ type: :development
92
+ version_requirements: *id006
93
+ description: |-
94
+ Simplify deployment of your Puppet infrastructure by
95
+ automatically pulling in modules from the forge and git repositories with
96
+ a single command.
97
+ email:
113
98
  - tim@sharpe.id.au
114
- executables:
99
+ executables:
115
100
  - librarian-puppet
116
101
  extensions: []
102
+
117
103
  extra_rdoc_files: []
118
- files:
104
+
105
+ files:
119
106
  - .gitignore
120
107
  - LICENSE
121
108
  - README.md
@@ -230,28 +217,35 @@ files:
230
217
  - vendor/librarian/spec/unit/resolver_spec.rb
231
218
  - vendor/librarian/spec/unit/source/git_spec.rb
232
219
  - vendor/librarian/spec/unit/spec_change_set_spec.rb
220
+ has_rdoc: true
233
221
  homepage: https://github.com/rodjek/librarian-puppet
234
222
  licenses: []
223
+
235
224
  post_install_message:
236
225
  rdoc_options: []
237
- require_paths:
226
+
227
+ require_paths:
238
228
  - lib
239
- required_ruby_version: !ruby/object:Gem::Requirement
240
- none: false
241
- requirements:
242
- - - ! '>='
243
- - !ruby/object:Gem::Version
244
- version: '0'
245
- required_rubygems_version: !ruby/object:Gem::Requirement
246
- none: false
247
- requirements:
248
- - - ! '>='
249
- - !ruby/object:Gem::Version
250
- version: '0'
229
+ required_ruby_version: !ruby/object:Gem::Requirement
230
+ requirements:
231
+ - - ">="
232
+ - !ruby/object:Gem::Version
233
+ segments:
234
+ - 0
235
+ version: "0"
236
+ required_rubygems_version: !ruby/object:Gem::Requirement
237
+ requirements:
238
+ - - ">="
239
+ - !ruby/object:Gem::Version
240
+ segments:
241
+ - 0
242
+ version: "0"
251
243
  requirements: []
244
+
252
245
  rubyforge_project:
253
- rubygems_version: 1.8.23
246
+ rubygems_version: 1.3.6
254
247
  signing_key:
255
248
  specification_version: 3
256
249
  summary: Bundler for your Puppet modules
257
250
  test_files: []
251
+