diff --git a/lib/puppet_x/puppetlabs/strings/util.rb b/lib/puppet_x/puppetlabs/strings/util.rb index 35aec88..d550927 100644 --- a/lib/puppet_x/puppetlabs/strings/util.rb +++ b/lib/puppet_x/puppetlabs/strings/util.rb @@ -21,6 +21,11 @@ module PuppetX::PuppetLabs::Strings::Util # and ruby files to parse. yard_args = (args.empty? ? MODULE_SOURCEFILES : args) + # If json is going to be emitted to stdout, suppress statistics. + if options[:emit_json_stdout] + yard_args.push('--no-stats') + end + # This line monkeypatches yard's progress indicator so it doesn't write # all over the terminal. This should definitely not be in real code, but # it's very handy for debugging with pry diff --git a/lib/puppet_x/puppetlabs/strings/yard/json_registry_store.rb b/lib/puppet_x/puppetlabs/strings/yard/json_registry_store.rb index 6d62666..22729c4 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/json_registry_store.rb +++ b/lib/puppet_x/puppetlabs/strings/yard/json_registry_store.rb @@ -71,7 +71,7 @@ module YARD def serialize(data) if YARD::Config.options[:emit_json] - path = File.join(basepath, YARD::Config.options[:emit_json]) + path = YARD::Config.options[:emit_json] log.debug "Serializing json to #{path}" File.open!(path, "wb") {|f| f.write data } end