Skip to content

Instantly share code, notes, and snippets.

Created July 24, 2015 15:28
Show Gist options
  • Save anonymous/5a75172626e2f7d3f2e5 to your computer and use it in GitHub Desktop.
Save anonymous/5a75172626e2f7d3f2e5 to your computer and use it in GitHub Desktop.
Dir.glob('Modified/*.json').each do |item|
file = File.open(item, "r+")
puts item
hash = JSON.parse(file.read)
file.rewind
hash['version'] += 1
file.write(JSON.generate(hash))
file.close
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment