Last active
November 18, 2020 10:38
-
-
Save timabell/3672e1b2850aab8a73d2697977de4492 to your computer and use it in GitHub Desktop.
Load a json file into an interactive ruby session https://twitter.com/tim_abell/status/1329010829874827265?s=20
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 "pry" | |
def load_json filename | |
puts "parsing #{filename} ..." | |
file = File.read filename | |
json = JSON.load file | |
puts "#{json.length} records loaded" | |
return json | |
end | |
data = load_json "data.json" | |
# drop to interactive ruby console for fast experimental analysis | |
binding.pry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When run:
boom