Sha256: ba2219a1ae6bca65501414e8682195cdbe3cf22fd70483b079cb2b633be8ac0c
Contents?: true
Size: 422 Bytes
Versions: 47
Compression:
Stored size: 422 Bytes
Contents
require 'json' require 'msgpack' def gen_tsv(time) "#{time}\ttag1\tok" end def gen_json(time) {'tag' => 'tag1', 'time' => time, 'k1' => 'ok'}.to_json end def gen_msgpack(time) {'tagger' => 'tag1', 'datetime' => time, 'k1' => 'ok'}.to_msgpack end time = ARGV.first time = Integer(time) rescue time case ARGV.last.to_i when 0 puts gen_tsv(time) when 1 puts gen_json(time) when 2 print gen_msgpack(time) end
Version data entries
47 entries across 47 versions & 1 rubygems