Class: SportDb::Toolii

Inherits:
Object
  • Object
show all
Extended by:
GLI::App
Defined in:
lib/sportdb/cli/main.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.connect_to_db(options) ⇒ Object



31
32
33
34
35
36
37
38
# File 'lib/sportdb/cli/main.rb', line 31

def self.connect_to_db( options )
  puts "working directory: #{Dir.pwd}"

  SportDb.connect( adapter: 'sqlite3',
                   database: "#{options.db_path}/#{options.db_name}" )

  LogDb.setup  # start logging to db (that is, save logs in logs table in db)
end

.loggerObject



25
# File 'lib/sportdb/cli/main.rb', line 25

def self.logger()       @@logger; end

.logger=(value) ⇒ Object



24
# File 'lib/sportdb/cli/main.rb', line 24

def self.logger=(value) @@logger=value; end

.optsObject



29
# File 'lib/sportdb/cli/main.rb', line 29

def self.opts()        @@opts; end

.opts=(value) ⇒ Object

todo: find a better name e.g. change to settings? config? safe_opts? why? why not?



28
# File 'lib/sportdb/cli/main.rb', line 28

def self.opts=(value)  @@opts = value; end

Instance Method Details

#verboseObject

todo: use -w for short form? check ruby interpreter if in use too?



81
# File 'lib/sportdb/cli/main.rb', line 81

switch [:verbose], negatable: false