14 lines
255 B
Ruby
Executable File
14 lines
255 B
Ruby
Executable File
#!/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)
|