puppet-strings 1.2.0 → 1.2.1
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 +9 -1
- data/lib/puppet/face/strings.rb +4 -0
- data/spec/acceptance/emit_json_options.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82ad70b526cc76afc1aa63fe94f18525f3a88ed5
|
4
|
+
data.tar.gz: 11c0250595f96c209f17625cdf7a8a41feee39c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55047d29045ebd5f26f52f0f26331b0b602d6d98c7e231b512052e87537664aba1f1b5c00613e07435d5b885683ba3a941941f382b104c3a89270cddbd836794
|
7
|
+
data.tar.gz: 71a37b237fd792a7c3c94acc72514068e24c87a75db75af5cd2f83196b7b100bbd9ab1682ccc54fb8b7d889412bfa806a75542a8cf77d0fc8d5ae87ae4d55803
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).
|
4
4
|
|
5
|
+
## [1.2.1](https://github.com/puppetlabs/puppet-strings/tree/1.2.1) (2018-03-01)
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/1.2.0...1.2.1)
|
8
|
+
|
9
|
+
### Fixed
|
10
|
+
|
11
|
+
- (PDOC-224) Handle --emit-json(-stdout) again [\#162](https://github.com/puppetlabs/puppet-strings/pull/162) ([ekohl](https://github.com/ekohl))
|
12
|
+
|
5
13
|
## [1.2.0](https://github.com/puppetlabs/puppet-strings/tree/1.2.0) (2018-02-26)
|
6
14
|
|
7
15
|
[Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/1.1.1...1.2.0)
|
@@ -186,4 +194,4 @@ All related tickets can be found under the [PDOC][PDOC JIRA] JIRA project with t
|
|
186
194
|
- Strings will no longer crash when documenting 3x functions with less than two arguments passed into newfunction **(PDOC-27)**
|
187
195
|
|
188
196
|
|
189
|
-
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
197
|
+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
data/lib/puppet/face/strings.rb
CHANGED
@@ -116,9 +116,13 @@ Puppet::Face.define(:strings, '0.0.1') do
|
|
116
116
|
generate_options[:markdown] = true
|
117
117
|
elsif format.casecmp('json').zero? || options[:emit_json] || options[:emit_json_stdout]
|
118
118
|
generate_options[:json] = true
|
119
|
+
generate_options[:path] ||= options[:emit_json] if options[:emit_json]
|
119
120
|
else
|
120
121
|
raise RuntimeError, "Invalid format #{options[:format]}. Please select 'json' or 'markdown'."
|
121
122
|
end
|
123
|
+
elsif options[:emit_json] || options[:emit_json_stdout]
|
124
|
+
generate_options[:json] = true
|
125
|
+
generate_options[:path] ||= options[:emit_json] if options[:emit_json]
|
122
126
|
end
|
123
127
|
end
|
124
128
|
generate_options
|
@@ -52,4 +52,20 @@ describe 'Emitting JSON' do
|
|
52
52
|
output = read_file_on(master, tmpfile)
|
53
53
|
expect(JSON.parse(output)).to eq(expected)
|
54
54
|
end
|
55
|
+
|
56
|
+
it 'should emit JSON to stdout when using --emit-json-stdout' do
|
57
|
+
test_module_path = get_test_module_path(master, /Module test/)
|
58
|
+
on master, puppet('strings', 'generate', '--emit-json-stdout', "#{test_module_path}/lib/puppet/parser/functions/function3x.rb") do
|
59
|
+
output = stdout.chomp
|
60
|
+
expect(JSON.parse(output)).to eq(expected)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'should write JSON to a file when using --emit-json' do
|
65
|
+
test_module_path = get_test_module_path(master, /Module test/)
|
66
|
+
tmpfile = master.tmpfile('json_output.json')
|
67
|
+
on master, puppet('strings', 'generate', '--emit-json', tmpfile, "#{test_module_path}/lib/puppet/parser/functions/function3x.rb")
|
68
|
+
output = read_file_on(master, tmpfile)
|
69
|
+
expect(JSON.parse(output)).to eq(expected)
|
70
|
+
end
|
55
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-strings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|