module MicroFlip::CLI
Public Class Methods
display_changes(hash, io = STDOUT)
click to toggle source
# File lib/micro_flip.rb, line 52 def self.display_changes(hash, io = STDOUT) hash.each do |key, value| io.puts "Flip: #{key} set to #{value}" end end
parse_args(argv)
click to toggle source
# File lib/micro_flip.rb, line 44 def self.parse_args(argv) args = argv.dup #TODO handle case where we get default= and set the 2nd bit to empty string #TODO maybe use optparser for this? hashes = args.flat_map { |a| Hash[*a.split('=') ] } hashes.reduce(&:merge) end