puppet-strings 1.2.0 → 1.2.1

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: e0b022bc727dcda3a4a796595059fa42a79815f2
4
- data.tar.gz: 00aebdc79f8e40a6149940a6e495e2cf3b2e356d
3
+ metadata.gz: 82ad70b526cc76afc1aa63fe94f18525f3a88ed5
4
+ data.tar.gz: 11c0250595f96c209f17625cdf7a8a41feee39c3
5
5
  SHA512:
6
- metadata.gz: c52b785c39bf5e539934a64aea7af0b9f1fe192f0caf6eb327e6c43926d1a9d943ef1ec4c1dec30ebacd779d2694d8bf8f55fc90472f37beb9d7d3dc15b84b3d
7
- data.tar.gz: 89ee514938a2f69a69705c79b52598e5b9144a984dcf7ab6a5304dfab6a372fc3686b548936517cd135f7dc8ea13b8ef1951ebb1f430e6dab740384a5f26a191
6
+ metadata.gz: 55047d29045ebd5f26f52f0f26331b0b602d6d98c7e231b512052e87537664aba1f1b5c00613e07435d5b885683ba3a941941f382b104c3a89270cddbd836794
7
+ data.tar.gz: 71a37b237fd792a7c3c94acc72514068e24c87a75db75af5cd2f83196b7b100bbd9ab1682ccc54fb8b7d889412bfa806a75542a8cf77d0fc8d5ae87ae4d55803
@@ -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)*
@@ -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.0
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-02-28 00:00:00.000000000 Z
11
+ date: 2018-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard