Skip to content

Instantly share code, notes, and snippets.

View AlexLarra's full-sized avatar

AlexLarra AlexLarra

View GitHub Profile
@AlexLarra
AlexLarra / unify_google_music.rb
Last active February 8, 2016 21:43
pass downloaded folders from google music to a uniq folder
#!/usr/bin/env ruby -w
require 'pathname'
require 'fileutils'
unless ARGV.size == 2
abort 'Usage: ruby music.rb google_folder_route new_folder'
end
def prepare_files
unless File.exists?('original') && File.file?('original') && File.readable?('original')
abort('There is not `original` file in current directory.')
end
File.delete('yaml') if File.exists?('yaml')
[File.open('original'), File.new('yaml', 'w+')]
end
def translate_to_yml(original, yaml)
original.each_line do |line|