We're a place where coders share, stay up-to-date and grow their careers.
Ruby is still one of the most pretty languages! Maybe you can use the open(url).read from require 'open-uri' instead of curl to allow it to run on other systems 🙂
open(url).read
require 'open-uri'
curl
Alernatively could look like this:
CSV.open "#{Date.today.strftime '%Y%m%d'}.csv", 'w' do |csv| JSON.parse(open(ARGV[0]).read).each { |x| csv << x if x['creditcard'] } end
Oh, I like that!
open-uri
Ruby is still one of the most pretty languages!
Maybe you can use the
open(url).read
fromrequire 'open-uri'
instead ofcurl
to allow it to run on other systems 🙂Alernatively could look like this:
Oh, I like that!
open-uri
built-in. Also awesome.