Class: Augury::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/augury/cli.rb

Instance Method Summary collapse

Instance Method Details

#generate(username, *path) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/augury/cli.rb', line 61

def generate(username, *path)
  path = File.expand_path(path[0] || username)
  augury = Augury::Fortune.new(username, path, options)
  augury.twitter_setup
  augury.retrieve_tweets
  augury.write_fortune
  say "Fortune written out to #{path}"
rescue StandardError => e
  say 'There was an error running the command. Details below:'
  say e.message
  puts e.backtrace if options[:debug]
  exit 1
end