lib/cli/command.rb in factor-0.0.6 vs lib/cli/command.rb in factor-0.0.7

- old
+ new

@@ -7,14 +7,24 @@ module Factor module CLI class Command < Thor CONFIG_FILE_DIR = File.expand_path("~/.factor") + + no_tasks do + + def initialize(*vals) + @client = Factor::Client::Client.new + @client.login_token(get_config[:token]) + super(*vals) + end + def save_config(config) File.open(CONFIG_FILE_DIR,'w') do |file| YAML::dump(config,file) end + @client.login_token(get_config[:token]) end def get_config File.exists?(CONFIG_FILE_DIR) ? YAML::load_file(CONFIG_FILE_DIR) : {} end \ No newline at end of file