Skip to content

Instantly share code, notes, and snippets.

View csv2esjson.rb
#!/usr/bin/env ruby
require 'csv'
require 'json'
require 'securerandom'
line = STDIN.gets.chomp
csv = CSV.new(line)
header = csv.to_a[0]
View test.yml.erb
- aaa
- <%= var1 %>
- ccc_<%= var2 %>: eee
View ymlerb2yml.rb
require 'erb'
require 'yaml'
# VARIABLE DEFINITION
var1 = 'bbb'
var2 = 'ddd'
# FORMAT TRANSLATION
yml_erb = ARGF.read()
ruby_data_type = ERB.new(yml_erb).result(binding)
You can’t perform that action at this time.