module Flydata module Helpers module_function def parse_command(cmd) klass = Flydata::Command::Base method = cmd if cmd.include?(':') class_name, method = cmd.split(':') klass = to_command_class(class_name) end [klass, method] end def to_command_class(class_name) eval("Flydata::Command::#{class_name.camelcase}") end def home_directory ENV['HOME'] || Dir.pwd end end end