Skip to content

Instantly share code, notes, and snippets.

@bensonk
Created March 12, 2012 21:49
Show Gist options
  • Save bensonk/2024937 to your computer and use it in GitHub Desktop.
Save bensonk/2024937 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'json'
my_hash = JSON.load(File.open('my_hash.json'))
puts my_hash
source :rubygems
gem 'json'
#!/usr/bin/env ruby
require 'json'
my_hash = { :foo => 'bar', :baz => 'bat', :blargh => 42 }
JSON.dump my_hash, File.open('my_hash.json', 'w')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment