Skip to content

Instantly share code, notes, and snippets.

@mmasashi
Created April 30, 2015 16:31
Show Gist options
  • Save mmasashi/e896ffe797c92fe5fc3d to your computer and use it in GitHub Desktop.
Save mmasashi/e896ffe797c92fe5fc3d to your computer and use it in GitHub Desktop.
require 'msgpack'
require 'json'
fpath = ARGV[0]
io = if fpath
File.open(fpath)
else
$stdin
end
u = MessagePack::Unpacker.new(io)
u.each do |obj|
puts obj.to_json
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment