Created
December 2, 2015 13:07
-
-
Save Moligaloo/f241f1a81ece6c3da8ec to your computer and use it in GitHub Desktop.
Convert JSON source file to MessagePack file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'json' | |
require 'msgpack' | |
if ARGV.length < 2 | |
puts "#{$PROGRAM_NAME} <json file> <msgpack file>" | |
exit 1 | |
end | |
json_file = ARGV[0] | |
msgpack_file = ARGV[1] | |
IO.write msgpack_file, (JSON.parse IO.read json_file).to_msgpack |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment