Class: Trellodon::CLI

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

Defined Under Namespace

Classes: Config, Prompt

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



104
105
106
107
108
# File 'lib/trellodon/cli.rb', line 104

def initialize
  @config = Config.new
  @scheduler = Schedulers::Inline.new
  @logger = Config.logger
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



121
122
123
# File 'lib/trellodon/cli.rb', line 121

def logger
  @logger
end

#schedulerObject (readonly)

Returns the value of attribute scheduler.



121
122
123
# File 'lib/trellodon/cli.rb', line 121

def scheduler
  @scheduler
end

Instance Method Details

#runObject



110
111
112
113
114
115
116
117
118
119
# File 'lib/trellodon/cli.rb', line 110

def run
  check_command!

  need_to_fill_config = config.to_h[:api_key].nil?
  executor = Trellodon::Executor.new(executor_options)

  ask_save_credentials if need_to_fill_config

  executor.download(config.board)
end