Class: Cartos::CLI

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

Instance Method Summary collapse

Instance Method Details

#exportObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/cartos/cli.rb', line 15

def export
  entries = if (options[:file])
              Cartos.load_from_file File.absolute_path(options[:file])
            else
              Cartos.load_from_cashbase
            end
  entries.filter_by_year options[:year]
  spread_sheet = Cartos::Spreadsheet::CartosSpreadsheet.new Cartos.config.google_spreadsheet.key
  spread_sheet.monthly entries
  spread_sheet.summary entries
end

#initObject



8
9
10
# File 'lib/cartos/cli.rb', line 8

def init
  Cartos::Generators::Config.start
end