Class: Spacialdb::Command::Db
Overview
manage databases (list, create, destroy)
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#create ⇒ Object
db:create.
-
#destroy ⇒ Object
db:destroy.
-
#index ⇒ Object
db.
Methods inherited from Base
#initialize, namespace, #spacialdb
Methods included from Helpers
#ask, #confirm_command, #display, #echo_off, #echo_on, #error, #home_directory, #json_decode, #json_encode, #longest, #redisplay
Constructor Details
This class inherits a constructor from Spacialdb::Command::Base
Instance Method Details
#create ⇒ Object
db:create
create a new database
21 22 23 |
# File 'lib/spacialdb/command/db.rb', line 21 def create display spacialdb.create end |
#destroy ⇒ Object
db:destroy
permanently destroy a database
31 32 33 34 35 36 37 38 |
# File 'lib/spacialdb/command/db.rb', line 31 def destroy db = extract_db if confirm_command(db) redisplay "Destroying #{db} ... " spacialdb.destroy(db) display "done" end end |
#index ⇒ Object
db
list your databases
11 12 13 |
# File 'lib/spacialdb/command/db.rb', line 11 def index display spacialdb.list.join("\n") end |