lib/omnibus/cli.rb in omnibus-5.3.0 vs lib/omnibus/cli.rb in omnibus-5.4.0
- old
+ new
@@ -14,10 +14,11 @@
# limitations under the License.
#
require 'thor'
require 'omnibus'
+require "ffi_yajl"
module Omnibus
class CLI < Command::Base
# This is the main entry point for the CLI. It exposes the method
# {#execute!} to start the CLI.
@@ -83,11 +84,11 @@
project.build
if @options[:output_manifest]
FileUtils.mkdir_p('pkg')
File.open(::File.join('pkg', 'version-manifest.json'), 'w') do |f|
- f.write(project.built_manifest.to_json)
+ f.write(FFI_Yajl::Encoder.encode(project.built_manifest.to_hash))
end
end
end
@@ -119,10 +120,10 @@
Ohai['os'] = @options[:os] if @options[:os]
Ohai['platform_family'] = @options[:platform_family] if @options[:platform_family]
Ohai['platform'] = @options[:platform] if @options[:platform]
Ohai['platform_version'] = @options[:platform_version] if @options[:platform_version]
Ohai['kernel']['machine'] = @options[:architecture] if @options[:architecture]
- puts JSON.pretty_generate(Project.load(name).built_manifest.to_hash)
+ puts FFI_Yajl::Encoder.encode(Project.load(name).built_manifest.to_hash, pretty: true)
end
#
# Perform cache management functions.
#