Skip to content

Instantly share code, notes, and snippets.

@ringods
Created April 22, 2010 10:06
Show Gist options
  • Save ringods/375053 to your computer and use it in GitHub Desktop.
Save ringods/375053 to your computer and use it in GitHub Desktop.
{
"network" : "value"
}
require 'rubygems'
require 'json/pure'
buffer = open('test.json').read
node = JSON.parse(buffer)
puts node[:network]
@ringods
Copy link
Author

ringods commented Apr 22, 2010

$ ruby test.rb
/opt/local/lib/ruby/gems/1.8/gems/json-1.2.4/lib/json/pure/parser.rb:143:in parse': source 'test.json' not in JSON! (JSON::ParserError) from /opt/local/lib/ruby/gems/1.8/gems/json-1.2.4/lib/json/common.rb:132:inparse'
from test.rb:4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment