Sha256: eb9c23c66ff65e6224b5788ea8e3391c1f05aa74a7cc7b789bd3f2bbe4aa6a2d
Contents?: true
Size: 761 Bytes
Versions: 46
Compression:
Stored size: 761 Bytes
Contents
#!/usr/bin/env ruby code_file = ARGV[0] output = ARGV[1] require 'rbbt-util' code = case when (code_file.nil? or code_file == '-') STDIN.read else Open.read(code_file) end begin if code_file.nil? data = instance_eval code else data = instance_eval code, code_file end rescue Exception puts "#:rbbt_exec Error" puts $!.message puts $!.backtrace * "\n" exit(-1) end data = data.to_s(:sort, true) if TSV === data data = data * "\n" if Array === data case when (output.nil? or output == '-') puts data when output == "file" if Misc.filename? data tmpfile = data else tmpfile = TmpFile.tmp_file Open.write(tmpfile, data) end puts tmpfile else Open.write(output, data) end
Version data entries
46 entries across 46 versions & 1 rubygems