Class: SportDb::Toolii
- Inherits:
-
Object
- Object
- SportDb::Toolii
- Extended by:
- GLI::App
- Defined in:
- lib/sportdb/cli/main.rb
Class Method Summary collapse
- .connect_to_db(options) ⇒ Object
- .logger ⇒ Object
- .logger=(value) ⇒ Object
- .opts ⇒ Object
-
.opts=(value) ⇒ Object
todo: find a better name e.g.
Instance Method Summary collapse
-
#verbose ⇒ Object
todo: use -w for short form? check ruby interpreter if in use too?.
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( ) puts "working directory: #{Dir.pwd}" SportDb.connect( adapter: 'sqlite3', database: "#{.db_path}/#{.db_name}" ) LogDb.setup # start logging to db (that is, save logs in logs table in db) end |
.logger ⇒ Object
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 |
.opts ⇒ Object
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
#verbose ⇒ Object
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 |