Skip to content

Instantly share code, notes, and snippets.

@burtlo
Created November 18, 2015 00:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save burtlo/0726166e41481c286ede to your computer and use it in GitHub Desktop.
Save burtlo/0726166e41481c286ede to your computer and use it in GitHub Desktop.
Find all the JSON files in the local directory and any subdirectories and attempt to parse them with a Ruby JSON parser. If any of them fail to load an error message will be displayed.
require 'json'
Dir["**/*.json"].each do |json_file|
JSON.parse(File.read(json_file))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment