Class: CLI
Instance Attribute Summary collapse
-
#app_name ⇒ Object
Returns the value of attribute app_name.
Instance Method Summary collapse
- #init(path) ⇒ Object
- #log ⇒ Object
- #record(*command_words) ⇒ Object
- #report(name = 'default') ⇒ Object
Instance Attribute Details
#app_name ⇒ Object
Returns the value of attribute app_name.
11 12 13 |
# File 'lib/testament/cli.rb', line 11 def app_name @app_name end |
Instance Method Details
#init(path) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/testament/cli.rb', line 14 def init(path) self.app_name = File.basename File.(path) self.destination_root = path directory ".testament", ".testament" require 'testament/database' database = Testament::Database.new adapter: :sqlite, database: "#{path}/.testament/db.sqlite" database.create_schema end |
#log ⇒ Object
32 33 34 35 |
# File 'lib/testament/cli.rb', line 32 def log project = Testament::Project.load puts project.log end |
#record(*command_words) ⇒ Object
25 26 27 28 29 |
# File 'lib/testament/cli.rb', line 25 def record(*command_words) project = Testament::Project.load record = project.record command_words exit record[:exit_status] end |
#report(name = 'default') ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/testament/cli.rb', line 44 def report(name='default') require 'terminal-table' project = Testament::Project.load report = project.report name table = Terminal::Table.new :headings => report.headers, :rows => report.rows puts table end |