Class: Crusoe::CLI

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

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



14
15
16
17
18
# File 'lib/crusoe/cli.rb', line 14

def initialize(...)
  @configuration = Configuration.new
  @interface = Interface.new
  super(...)
end

Instance Method Details

#journalObject



24
25
26
27
28
29
# File 'lib/crusoe/cli.rb', line 24

def journal
  fetch_remote_repo
  date = parse_date_option(options[:date])
  write(date)
  update_remote_repo
end

#readObject



33
34
35
36
37
# File 'lib/crusoe/cli.rb', line 33

def read
  update_remote_repo
  date = parse_date_option(options[:date])
  read_dates(date)
end

#reportObject



40
41
42
43
44
45
46
# File 'lib/crusoe/cli.rb', line 40

def report
  update_remote_repo
  today = Date.today
  days_to_last_monday = (today.wday - 1) % 7
  last_monday = today - days_to_last_monday
  read_dates(last_monday..today)
end

#update_tocObject



50
51
52
# File 'lib/crusoe/cli.rb', line 50

def update_toc
  puts "TODO: Add GitCommit"
end