Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ruby script to convert JSON to XML.
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'activesupport'
gem 'builder'
end
require 'active_support/core_ext/array/conversions'
require 'active_support/core_ext/hash/conversions'
require 'json'
puts(
JSON.parse(
STDIN.read
).to_xml(dasherize: false)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment