Sha256: 403b925262ede3009ba4f66f7c2c98a0ae83722f7c9d023d0b42cfbfbfcb6783
Contents?: true
Size: 406 Bytes
Versions: 26
Compression:
Stored size: 406 Bytes
Contents
#!/usr/bin/env ruby counter = 0 STDIN.each_line do |line| counter += 1 key, value = line.split(' : ') prefix = key.scan(/(^\s+)(.*)/)[0][0] key.gsub!(/^\s+/, '') value.gsub!(/^\s+/, '') value.gsub!(/,$/, '') puts prefix + "#{('dir_' + counter.to_s).inspect} : {" puts prefix + ' "source" : ' + "#{key.chomp}," puts prefix + ' "target" : ' + "#{value.chomp}" puts prefix + '},' end
Version data entries
26 entries across 26 versions & 1 rubygems