librarian-puppet 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -101,7 +101,7 @@ stored as a directory under our `puppet-modules` git repos.
101
101
 
102
102
  Install librarian-puppet:
103
103
 
104
- $ gem install --pre librarian-puppet
104
+ $ gem install librarian-puppet
105
105
 
106
106
  Prepare your puppet infrastructure repository:
107
107
 
@@ -162,6 +162,26 @@ Please include:
162
162
  * Please run the `librarian-puppet` commands in verbose mode by using the
163
163
  `--verbose` flag, and include the verbose output in the bug report as well.
164
164
 
165
+ ## Changelog
166
+
167
+ ### 0.9.0
168
+
169
+ * Initial release
170
+
171
+ ### 0.9.1
172
+
173
+ * Proper error message when a module that is sourced from the forge does not
174
+ exist.
175
+ * Added support for annotated tags as git references.
176
+ * `librarian-puppet init` adds `.tmp/` to gitignore instead of `tmp/`.
177
+ * Fixed syntax error in the template Puppetfile created by `librarian-puppet
178
+ init`.
179
+ * Checks for `lib/puppet` as well as `manifests/` when checking if the git
180
+ repository is a valid module.
181
+ * When a user specifies `<foo>/<bar>` as the name of a module sources from a
182
+ git repository, assume the module name is actually `<bar>`.
183
+ * Fixed gem description and summary in gemspec.
184
+
165
185
  ## License
166
186
  Please see the [LICENSE](https://github.com/rodjek/librarian-puppet/blob/master/LICENSE)
167
187
  file.
@@ -2,6 +2,6 @@ require 'librarian/puppet/extension'
2
2
 
3
3
  module Librarian
4
4
  module Puppet
5
- VERSION = "0.9.0"
5
+ VERSION = "0.9.1"
6
6
  end
7
7
  end
@@ -27,7 +27,7 @@ module Librarian
27
27
  gitignore = []
28
28
  end
29
29
 
30
- gitignore << "tmp/" unless gitignore.include? "tmp/"
30
+ gitignore << ".tmp/" unless gitignore.include? ".tmp/"
31
31
  gitignore << "modules/" unless gitignore.include? "modules/"
32
32
 
33
33
  File.open(".gitignore", 'w') do |f|
@@ -21,6 +21,10 @@ module Librarian
21
21
 
22
22
  def versions
23
23
  data = api_call("#{name}.json")
24
+ if data.nil?
25
+ raise Error, "Unable to find module '#{name}' on #{source}"
26
+ end
27
+
24
28
  data['releases'].map { |r| r['version'] }.sort.reverse
25
29
  end
26
30
 
@@ -79,9 +83,12 @@ module Librarian
79
83
  def api_call(path)
80
84
  base_url = source.to_s
81
85
  resp = Net::HTTP.get_response(URI.parse("#{base_url}/#{path}"))
82
- data = resp.body
83
-
84
- JSON.parse(data)
86
+ if resp.code.to_i != 200
87
+ nil
88
+ else
89
+ data = resp.body
90
+ JSON.parse(data)
91
+ end
85
92
  end
86
93
  end
87
94
 
@@ -2,6 +2,22 @@ require 'librarian/source/git'
2
2
  require 'librarian/puppet/source/local'
3
3
 
4
4
  module Librarian
5
+ module Source
6
+ class Git
7
+ class Repository
8
+ def hash_from(remote, reference)
9
+ branch_names = remote_branch_names[remote]
10
+ if branch_names.include?(reference)
11
+ reference = "#{remote}/#{reference}"
12
+ end
13
+
14
+ command = %W(rev-parse #{reference}^{commit} --quiet)
15
+ run!(command, :chdir => true).strip
16
+ end
17
+ end
18
+ end
19
+ end
20
+
5
21
  module Puppet
6
22
  module Source
7
23
  class Git < Librarian::Source::Git
@@ -11,6 +11,12 @@ module Librarian
11
11
  name, version = manifest.name, manifest.version
12
12
  found_path = found_path(name)
13
13
 
14
+ if name.include? '/'
15
+ new_name = name.split('/').last
16
+ debug { "Invalid module name '#{name}', guessing you meant '#{new_name}'" }
17
+ name = new_name
18
+ end
19
+
14
20
  install_path = environment.install_path.join(name)
15
21
  if install_path.exist?
16
22
  debug { "Deleting #{relative_path_to(install_path)}" }
@@ -38,7 +44,9 @@ module Librarian
38
44
  end
39
45
 
40
46
  def manifest?(name, path)
41
- path.join('manifests').exist?
47
+ return true if path.join('manifests').exist?
48
+ return true if path.join('lib').join('puppet').exist?
49
+ false
42
50
  end
43
51
  end
44
52
  end
@@ -1,5 +1,9 @@
1
- # mod 'stdlib'
2
- # :git => 'git://github.com/puppetlabs/puppetlabs-stdlib.git
1
+ forge "http://forge.puppetlabs.com"
2
+
3
+ # mod 'puppetlabs/stdlib'
4
+
5
+ # mod 'ntp',
6
+ # :git => 'git://github.com/puppetlabs/puppetlabs-ntp.git'
3
7
 
4
8
  # mod 'apt',
5
9
  # :git => 'https://github.com/puppetlabs/puppetlabs-apt.git',
@@ -9,8 +9,10 @@ Gem::Specification.new do |s|
9
9
  s.authors = ['Tim Sharpe']
10
10
  s.email = ['tim@sharpe.id.au']
11
11
  s.homepage = 'https://github.com/rodjek/librarian-puppet'
12
- s.summary = 'placeholder'
13
- s.description = 'another placeholder!'
12
+ s.summary = 'Bundler for your Puppet modules'
13
+ s.description = 'Simplify deployment of your Puppet infrastructure by
14
+ automatically pulling in modules from the forge and git repositories with
15
+ a single command.'
14
16
 
15
17
  s.files = [
16
18
  '.gitignore',
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: 0.9.0
4
+ version: 0.9.1
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: 2012-06-07 00:00:00.000000000 Z
12
+ date: 2012-06-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &70190725563440 !ruby/object:Gem::Requirement
16
+ requirement: &70127102525360 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0.15'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70190725563440
24
+ version_requirements: *70127102525360
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &70190725562580 !ruby/object:Gem::Requirement
27
+ requirement: &70127102524860 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,8 +32,9 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70190725562580
36
- description: another placeholder!
35
+ version_requirements: *70127102524860
36
+ description: ! "Simplify deployment of your Puppet infrastructure by\n automatically
37
+ pulling in modules from the forge and git repositories with\n a single command."
37
38
  email:
38
39
  - tim@sharpe.id.au
39
40
  executables:
@@ -171,5 +172,5 @@ rubyforge_project:
171
172
  rubygems_version: 1.8.11
172
173
  signing_key:
173
174
  specification_version: 3
174
- summary: placeholder
175
+ summary: Bundler for your Puppet modules
175
176
  test_files: []