require 'pp' require 'yaml' require 'json' require 'optparse' argv_options = ARGV.getopts('f:', 'file:') file_path = argv_options['f'] || argv_options['file'] yaml = YAML.load_file(file_path) puts JSON.pretty_generate(yaml) $ ruby yaml_to_json_print.rb -f sample.yml { "default": { "host": "10.0.0.1", "port": 8080, "content_type": "application/json", "account": { "name": "default", "password": "def
