Skip to content

Instantly share code, notes, and snippets.

Created July 24, 2015 15:02
Show Gist options
  • Save anonymous/0a2b8c540e528b3dc69e to your computer and use it in GitHub Desktop.
Save anonymous/0a2b8c540e528b3dc69e to your computer and use it in GitHub Desktop.
Dir.glob('Modified/*.json').each do |item|
file = File.open(item, "w+")
hash = JSON.parse(file.read)
hash['version'] += 1
file.write(JSON.generate(hash))
file.close
end
# is giving me this error: `initialize': A JSON text must at least contain two octets! (JSON::ParserError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment