Class: Toggl::Jobcan::Cli

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

Overview

CLI provider

Constant Summary collapse

DEFAULT_JOBCAN_CREDENTIAL_FILE_PATH =
"#{ENV['HOME']}/.jobcan"
DEFAULT_TOGGL_WORKTIME_CONFIG_FILE_PATH =
"#{ENV['HOME']}/.toggl_worktime"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/toggl/jobcan/cli.rb', line 11

def self.exit_on_failure?
  true
end

Instance Method Details

#main(*args) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/toggl/jobcan/cli.rb', line 47

def main(*args)
  parse_args(args)
  puts '*** DRYRUN MODE ***' if options[:dryrun]

  show_target_days
  return if options[:days]

  prepare_jobcan

  puts 'Driver ready'
  register_days

  jobcan.driver.quit
  puts 'All Input finished'
end

#versionObject



65
66
67
# File 'lib/toggl/jobcan/cli.rb', line 65

def version
  puts "Version #{Toggl::Jobcan::VERSION}"
end