puppet-module 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.markdown +5 -0
- data/README.markdown +18 -11
- data/VERSION +1 -1
- data/lib/puppet/module/tool.rb +1 -1
- data/lib/puppet/module/tool/applications/installer.rb +1 -1
- data/lib/puppet/module/tool/metadata.rb +55 -1
- data/lib/puppet/module/tool/modulefile.rb +29 -0
- data/lib/puppet/module/tool/repository.rb +6 -2
- data/templates/generator/Modulefile.erb +6 -0
- metadata +36 -4
data/CHANGES.markdown
CHANGED
data/README.markdown
CHANGED
@@ -29,22 +29,20 @@ Running
|
|
29
29
|
|
30
30
|
There are a number of ways to run the `puppet-module` program:
|
31
31
|
|
32
|
-
1.
|
33
|
-
directory, run:
|
32
|
+
1. **From an official gem:** Install it by running:
|
34
33
|
|
35
|
-
|
34
|
+
sudo gem install puppet-module
|
36
35
|
|
37
|
-
2.
|
38
|
-
directory, run:
|
36
|
+
2. **From a locally-built gem:** Checkout the source code and from the checkout directory, run:
|
39
37
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
38
|
+
# Build the gem
|
39
|
+
rake gem
|
40
|
+
# Install the file produced by the above command, e.g.:
|
41
|
+
sudo gem install pkg/puppet-module-0.3.0.gem
|
44
42
|
|
45
|
-
3.
|
43
|
+
3. **From a source code checkout:** Checkout the source code and from the checkout directory, run:
|
46
44
|
|
47
|
-
|
45
|
+
alias puppet-module=$PWD/bin/puppet-module
|
48
46
|
|
49
47
|
Basics
|
50
48
|
------
|
@@ -174,6 +172,15 @@ Deleting a module
|
|
174
172
|
The tool does not keep track of what modules you have installed. TO delete a
|
175
173
|
module just delete the directory the module was extracted into.
|
176
174
|
|
175
|
+
Developing or submitting patches
|
176
|
+
--------------------------------
|
177
|
+
|
178
|
+
You need the following RubyGems to run the test suite: `mocha`, `rspec`.
|
179
|
+
|
180
|
+
You can run the tests with:
|
181
|
+
|
182
|
+
rake spec
|
183
|
+
|
177
184
|
Get involved
|
178
185
|
------------
|
179
186
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
data/lib/puppet/module/tool.rb
CHANGED
@@ -46,7 +46,7 @@ module Puppet
|
|
46
46
|
@repository ||= Repository.new(Puppet.settings[:puppet_module_repository])
|
47
47
|
end
|
48
48
|
|
49
|
-
FULL_NAME_PATTERN = /\A(
|
49
|
+
FULL_NAME_PATTERN = /\A([^-\/|.]+)[-|\/](.+)\z/
|
50
50
|
|
51
51
|
# Return the +username+ and +modname+ for a given +full_name+, or raise an
|
52
52
|
# ArgumentError if the argument isn't parseable.
|
@@ -39,6 +39,54 @@ module Puppet::Module::Tool
|
|
39
39
|
return @dependencies ||= []
|
40
40
|
end
|
41
41
|
|
42
|
+
def author
|
43
|
+
@author || @username
|
44
|
+
end
|
45
|
+
|
46
|
+
def author=(author)
|
47
|
+
@author = author
|
48
|
+
end
|
49
|
+
|
50
|
+
def source
|
51
|
+
@source || 'UNKNOWN'
|
52
|
+
end
|
53
|
+
|
54
|
+
def source=(source)
|
55
|
+
@source = source
|
56
|
+
end
|
57
|
+
|
58
|
+
def license
|
59
|
+
@license || 'UNKNOWN'
|
60
|
+
end
|
61
|
+
|
62
|
+
def license=(license)
|
63
|
+
@license = license
|
64
|
+
end
|
65
|
+
|
66
|
+
def summary
|
67
|
+
@summary || 'UNKNOWN'
|
68
|
+
end
|
69
|
+
|
70
|
+
def summary=(summary)
|
71
|
+
@summary = summary
|
72
|
+
end
|
73
|
+
|
74
|
+
def description
|
75
|
+
@description || 'UNKNOWN'
|
76
|
+
end
|
77
|
+
|
78
|
+
def description=(description)
|
79
|
+
@description = description
|
80
|
+
end
|
81
|
+
|
82
|
+
def project_page
|
83
|
+
@project_page || 'UNKNOWN'
|
84
|
+
end
|
85
|
+
|
86
|
+
def project_page=(project_page)
|
87
|
+
@project_page = project_page
|
88
|
+
end
|
89
|
+
|
42
90
|
# Return an array of the module's Puppet types, each one is a hash
|
43
91
|
# containing :name and :doc.
|
44
92
|
# TODO Shouldn't this be it's own class?
|
@@ -69,6 +117,12 @@ module Puppet::Module::Tool
|
|
69
117
|
return {
|
70
118
|
:name => @full_name,
|
71
119
|
:version => @version,
|
120
|
+
:source => source,
|
121
|
+
:author => author,
|
122
|
+
:license => license,
|
123
|
+
:summary => summary,
|
124
|
+
:description => description,
|
125
|
+
:project_page => project_page,
|
72
126
|
:dependencies => dependencies,
|
73
127
|
:types => types,
|
74
128
|
:checksums => checksums
|
@@ -76,5 +130,5 @@ module Puppet::Module::Tool
|
|
76
130
|
end
|
77
131
|
|
78
132
|
end
|
79
|
-
|
133
|
+
|
80
134
|
end
|
@@ -42,6 +42,35 @@ module Puppet::Module::Tool
|
|
42
42
|
@metadata.dependencies << Dependency.new(name, version_requirement, repository)
|
43
43
|
end
|
44
44
|
|
45
|
+
# Set the source
|
46
|
+
def source(source)
|
47
|
+
@metadata.source = source
|
48
|
+
end
|
49
|
+
|
50
|
+
# Set the author or default to +username+
|
51
|
+
def author(author)
|
52
|
+
@metadata.author = author
|
53
|
+
end
|
54
|
+
|
55
|
+
# Set the license
|
56
|
+
def license(license)
|
57
|
+
@metadata.license = license
|
58
|
+
end
|
59
|
+
|
60
|
+
# Set the summary
|
61
|
+
def summary(summary)
|
62
|
+
@metadata.summary = summary
|
63
|
+
end
|
64
|
+
|
65
|
+
# Set the description
|
66
|
+
def description(description)
|
67
|
+
@metadata.description = description
|
68
|
+
end
|
69
|
+
|
70
|
+
# Set the project page
|
71
|
+
def project_page(project_page)
|
72
|
+
@metadata.project_page = project_page
|
73
|
+
end
|
45
74
|
end
|
46
75
|
|
47
76
|
end
|
@@ -35,8 +35,12 @@ module Puppet::Module::Tool
|
|
35
35
|
|
36
36
|
# Return a Net::HTTPResponse read from this HTTPRequest +request+.
|
37
37
|
def read_contact(request)
|
38
|
-
|
39
|
-
|
38
|
+
begin
|
39
|
+
Net::HTTP.start(@uri.host, @uri.port) do |http|
|
40
|
+
http.request(request)
|
41
|
+
end
|
42
|
+
rescue Errno::ECONNREFUSED, SocketError
|
43
|
+
abort "Could not reach remote repository"
|
40
44
|
end
|
41
45
|
end
|
42
46
|
|
@@ -1,5 +1,11 @@
|
|
1
1
|
name '<%= metadata.full_name %>'
|
2
2
|
version '0.0.1'
|
3
|
+
source '<%= metadata.source %>'
|
4
|
+
author '<%= metadata.author %>'
|
5
|
+
license '<%= metadata.license %>'
|
6
|
+
summary '<%= metadata.summary %>'
|
7
|
+
description '<%= metadata.description %>'
|
8
|
+
project_page '<%= metadata.project_page %>'
|
3
9
|
|
4
10
|
## Add dependencies, if any:
|
5
11
|
# dependency 'username/name', '>= 1.2.0'
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-module
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
9
|
+
- 2
|
10
|
+
version: 0.3.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Igal Koshevoy
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-12-31 00:00:00 +11:00
|
18
19
|
default_executable:
|
19
20
|
dependencies: []
|
20
21
|
|
@@ -158,6 +159,33 @@ files:
|
|
158
159
|
- vendor/thor-852190ae/lib/thor/parser.rb
|
159
160
|
- vendor/thor-852190ae/lib/thor/shell/basic.rb
|
160
161
|
- vendor/thor-852190ae/lib/thor/shell/color.rb
|
162
|
+
- spec/fixtures/releases/jamtur01-apache/metadata.json
|
163
|
+
- spec/fixtures/releases/jamtur01-apache/tests/dev.pp
|
164
|
+
- spec/fixtures/releases/jamtur01-apache/tests/vhost.pp
|
165
|
+
- spec/fixtures/releases/jamtur01-apache/tests/php.pp
|
166
|
+
- spec/fixtures/releases/jamtur01-apache/tests/apache.pp
|
167
|
+
- spec/fixtures/releases/jamtur01-apache/tests/ssl.pp
|
168
|
+
- spec/fixtures/releases/jamtur01-apache/tests/init.pp
|
169
|
+
- spec/fixtures/releases/jamtur01-apache/files/httpd
|
170
|
+
- spec/fixtures/releases/jamtur01-apache/files/test.vhost
|
171
|
+
- spec/fixtures/releases/jamtur01-apache/Modulefile
|
172
|
+
- spec/fixtures/releases/jamtur01-apache/templates/vhost-default.conf.erb
|
173
|
+
- spec/fixtures/releases/jamtur01-apache/lib/puppet/provider/a2mod/debian.rb
|
174
|
+
- spec/fixtures/releases/jamtur01-apache/lib/puppet/type/a2mod.rb
|
175
|
+
- spec/fixtures/releases/jamtur01-apache/manifests/dev.pp
|
176
|
+
- spec/fixtures/releases/jamtur01-apache/manifests/vhost.pp
|
177
|
+
- spec/fixtures/releases/jamtur01-apache/manifests/params.pp
|
178
|
+
- spec/fixtures/releases/jamtur01-apache/manifests/php.pp
|
179
|
+
- spec/fixtures/releases/jamtur01-apache/manifests/ssl.pp
|
180
|
+
- spec/fixtures/releases/jamtur01-apache/manifests/init.pp
|
181
|
+
- spec/spec_helper.rb
|
182
|
+
- spec/spec.opts
|
183
|
+
- spec/support/stub_http_support.rb
|
184
|
+
- spec/support/output_support.rb
|
185
|
+
- spec/support/testdir_support.rb
|
186
|
+
- spec/unit/application_spec.rb
|
187
|
+
- spec/unit/repository_spec.rb
|
188
|
+
- spec/integration/cli_spec.rb
|
161
189
|
has_rdoc: true
|
162
190
|
homepage: http://github.com/puppetlabs/puppet-module-tool
|
163
191
|
licenses: []
|
@@ -179,23 +207,27 @@ rdoc_options:
|
|
179
207
|
require_paths:
|
180
208
|
- lib
|
181
209
|
required_ruby_version: !ruby/object:Gem::Requirement
|
210
|
+
none: false
|
182
211
|
requirements:
|
183
212
|
- - ">="
|
184
213
|
- !ruby/object:Gem::Version
|
214
|
+
hash: 3
|
185
215
|
segments:
|
186
216
|
- 0
|
187
217
|
version: "0"
|
188
218
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
219
|
+
none: false
|
189
220
|
requirements:
|
190
221
|
- - ">="
|
191
222
|
- !ruby/object:Gem::Version
|
223
|
+
hash: 3
|
192
224
|
segments:
|
193
225
|
- 0
|
194
226
|
version: "0"
|
195
227
|
requirements: []
|
196
228
|
|
197
229
|
rubyforge_project:
|
198
|
-
rubygems_version: 1.3.
|
230
|
+
rubygems_version: 1.3.7
|
199
231
|
signing_key:
|
200
232
|
specification_version: 3
|
201
233
|
summary: The Puppet Module Tool manages Puppet modules
|