puppetfile_editor 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/bin/pfile +3 -0
- data/lib/puppetfile_editor/cli.rb +2 -2
- data/lib/puppetfile_editor/module.rb +2 -2
- data/lib/puppetfile_editor/puppetfile.rb +4 -4
- data/lib/puppetfile_editor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a347a0fee5e0a6c168996c2ff509d9af68ee1995638c35bc13d4d903a8d5093
|
4
|
+
data.tar.gz: 3dc080184ab3152eac00a5664a965f88b0ca8abd99da2242900ebe1764e0129b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33463d2cda5d3627e9e5f8bdb1a7b7d4755dadd7d19e5893c6c355e45ab6f7bdb0b12885809117d802dcf8b4b251be71db5b7a75f99ef50b5a1a7cc4f889be70
|
7
|
+
data.tar.gz: 32c2cce8cf5f554b662a90ea0ccac29d606fc79fb7e312b1436ddfea932689e714538622831e7c46507413b09e784cd282c9c6eb09ccf048f7126cb76d9ee77e
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.1.0] - 2019-10-16
|
10
|
+
### Added
|
11
|
+
- [GH-3](https://github.com/pegasd/puppetfile_editor/issues/3): Ability to write local modules in legacy format using
|
12
|
+
`pfile format --legacy-local`.
|
13
|
+
|
9
14
|
## [1.0.0] - 2019-10-16
|
10
15
|
### Changed
|
11
16
|
- [GH-3](https://github.com/pegasd/puppetfile_editor/issues/3): Write local modules in non-legacy format: `, local: true`.
|
data/bin/pfile
CHANGED
@@ -23,6 +23,9 @@ subcommands = {
|
|
23
23
|
end,
|
24
24
|
'format' => OptionParser.new do |parser|
|
25
25
|
parser.banner = "Usage: #{filename} format"
|
26
|
+
parser.on('--legacy-local', 'Use legacy format for local modules') do |setting|
|
27
|
+
options[:legacy_local] = setting
|
28
|
+
end
|
26
29
|
end,
|
27
30
|
'delete' => OptionParser.new do |parser|
|
28
31
|
parser.banner = "Usage: #{filename} format -m MODULENAME"
|
@@ -117,7 +117,7 @@ module PuppetfileEditor
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
-
def dump(
|
120
|
+
def dump(args = {})
|
121
121
|
output = []
|
122
122
|
case @type
|
123
123
|
when :hg, :git
|
@@ -132,7 +132,7 @@ module PuppetfileEditor
|
|
132
132
|
output.push " #{param} #{value}"
|
133
133
|
end
|
134
134
|
when :local
|
135
|
-
if legacy_local
|
135
|
+
if args[:legacy_local]
|
136
136
|
output.push("mod '#{full_title}', :local")
|
137
137
|
else
|
138
138
|
output.push("mod '#{full_title}', local: true")
|
@@ -49,7 +49,7 @@ module PuppetfileEditor
|
|
49
49
|
@loaded = true
|
50
50
|
end
|
51
51
|
|
52
|
-
def generate_puppetfile
|
52
|
+
def generate_puppetfile(args = {})
|
53
53
|
raise StandardError, 'File is not loaded' unless @loaded
|
54
54
|
|
55
55
|
contents = []
|
@@ -62,7 +62,7 @@ module PuppetfileEditor
|
|
62
62
|
|
63
63
|
contents.push "# #{module_comment}"
|
64
64
|
module_list.values.sort_by(&:name).each do |mod|
|
65
|
-
contents.push mod.dump
|
65
|
+
contents.push mod.dump(args)
|
66
66
|
end
|
67
67
|
contents.push ''
|
68
68
|
end
|
@@ -70,8 +70,8 @@ module PuppetfileEditor
|
|
70
70
|
contents.join("\n")
|
71
71
|
end
|
72
72
|
|
73
|
-
def dump
|
74
|
-
File.write(@puppetfile_path, generate_puppetfile) if @loaded
|
73
|
+
def dump(args = {})
|
74
|
+
File.write(@puppetfile_path, generate_puppetfile(args)) if @loaded
|
75
75
|
end
|
76
76
|
|
77
77
|
def update_module(name, param, value)
|