generate-puppetfile 0.9.10 → 0.9.11

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: 74c325d7f762e47f55fba2f375beb89d3290dba6
4
- data.tar.gz: f9ce877a4bb8767f929087ef88a12dafb76800ab
3
+ metadata.gz: b6cfe094ce5b85bfe42cc9d3322df42e66e7114a
4
+ data.tar.gz: 5b6d91785f56a5371a33c138bcad94e534768f88
5
5
  SHA512:
6
- metadata.gz: e704859f2f28ec656203052abf78164ef957e3486598d5427dcb4d5510ae206ac8718606d5da217ea97b995630e055bd4288b2c5b14e80ff9028e9bda68ea44b
7
- data.tar.gz: 298d3dee5228f34fa838f46835a71f142e922bf2da4e85641806ae82130da387aa43f94b40da74944b3e52e64bad41a0cd6ac3e0f3343797bd13622bd0b22315
6
+ metadata.gz: 3f2ccf87f37078a07a0b2643e0caa735537f8038585f86ff4de90d7b666d21fa1ac712011cfcbe0719a0da37d2adbd6d917901eb71076d1b4831b796bcbf357e
7
+ data.tar.gz: 366bb61416ed9f2aaa4d2b66e2d0f93dbc112074672e66df88ea827ca1d2d21c1c21fdca6065a696f2cc2e6698b1941a992ae9de609927cf7435da0769ce11b7
data/README.md CHANGED
@@ -1,3 +1,4 @@
1
+ [![Build Status](https://travis-ci.org/rnelson0/puppet-generate-puppetfile.png?branch=master)](https://travis-ci.org/rnelson0/puppet-generate-puppetfile)
1
2
  [![Gem Version](https://badge.fury.io/rb/generate-puppetfile.svg)](https://badge.fury.io/rb/generate-puppetfile)
2
3
 
3
4
  Tired of searching for dependencies on the forge and hoping you got everything? Have an existing Puppetfile that's getting long in the tooth? Use generate-puppetfile to generate a list of modules and their dependencies, at the latest version, in Puppetfile format for use with r10k or librarian-puppet.
@@ -11,9 +11,10 @@ module GeneratePuppetfile
11
11
  # Internal: The Bin class contains the logic for calling generate_puppetfile at the command line
12
12
  class Bin
13
13
  Module_Regex = Regexp.new("mod ['\"]([a-z0-9_]+\/[a-z0-9_]+)['\"](, ['\"](\\d\.\\d\.\\d)['\"])?", Regexp::IGNORECASE)
14
- @options = {} # Options hash
15
- @workspace = nil # Working directory for module download and inspection
16
- @module_data = {} # key: modulename, value: version number
14
+ @options = {} # Options hash
15
+ @workspace = nil # Working directory for module download and inspection
16
+ @module_data = {} # key: modulename, value: version number
17
+ @download_errors = '' # A list of errors encountered while downloading modules. Should remain empty.
17
18
  Silence = ('>' + File::NULL.to_str + ' 2>&1 ').freeze
18
19
  Puppetfile_Header = '# Modules discovered by generate-puppetfile'.freeze
19
20
  Extras_Note = '# Discovered elements from existing Puppetfile'.freeze
@@ -84,17 +85,22 @@ module GeneratePuppetfile
84
85
  @module_data = generate_module_data
85
86
  puppetfile_contents = generate_puppetfile_contents(extras)
86
87
 
87
- create_puppetfile(puppetfile_contents) if @options[:create_puppetfile]
88
+ if @download_errors == ''
89
+ create_puppetfile(puppetfile_contents) if @options[:create_puppetfile]
90
+ display_puppetfile(puppetfile_contents) unless @options[:silent]
88
91
 
89
- display_puppetfile(puppetfile_contents) unless @options[:silent]
92
+ if @options[:create_fixtures]
93
+ fixtures_data = generate_fixtures_data
94
+ write_fixtures_data(fixtures_data)
95
+ end
90
96
 
91
- if @options[:create_fixtures]
92
- fixtures_data = generate_fixtures_data
93
- write_fixtures_data(fixtures_data)
97
+ cleanup_workspace
98
+ else
99
+ $stderr.puts @download_errors
100
+ display_puppetfile(puppetfile_contents) unless @options[:silent]
101
+ return 2
94
102
  end
95
103
 
96
- cleanup_workspace
97
-
98
104
  0
99
105
  end
100
106
 
@@ -183,11 +189,16 @@ Your Puppetfile has been generated. Copy and paste between the markers:
183
189
  # module_list is an array of forge module names to be downloaded
184
190
  def download_modules(module_list)
185
191
  puts "\nInstalling modules. This may take a few minutes.\n\n" unless @options[:silent]
192
+
193
+ @download_errors = ''
186
194
  module_list.each do |name|
187
195
  next if _download_module(name)
188
- $stderr.puts "There was a problem with the module name '#{name}'.".red
189
- $stderr.puts ' Check that module exists as you spelled it and/or your connectivity to the puppet forge.'.red
190
- return 2
196
+ @download_errors << "There was a problem with the module name '#{name}'.".red + "\n"
197
+ end
198
+
199
+ if @download_errors != ''
200
+ @download_errors << ' Check that modules exist as under the listed name, and/or your connectivity to the puppet forge.'.red + "\n\n"
201
+ @download_errors << 'Here is the PARTIAL Puppetfile that would have been generated.'.red + "\n\n\n"
191
202
  end
192
203
  end
193
204
 
@@ -1,3 +1,3 @@
1
1
  module GeneratePuppetfile
2
- VERSION = '0.9.10'.freeze
2
+ VERSION = '0.9.11'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: generate-puppetfile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.10
4
+ version: 0.9.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Nelson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-26 00:00:00.000000000 Z
12
+ date: 2016-07-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize