#!/usr/bin/env ruby require "json" object = { "name" => "default", "source" => "" } script_name = ARGV[0] filename = ARGV[1] object["name"] = script_name object["source"] = File.open(filename).readlines.join("\r\n") puts JSON.pretty_generate(object)