Class: Couchup::Commands::Show

Inherits:
Object
  • Object
show all
Includes:
Couchup::CommandExtensions
Defined in:
lib/couchup/commands/show.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Couchup::CommandExtensions

included, #needs_db!

Class Method Details

.describeObject



15
16
17
18
19
20
21
# File 'lib/couchup/commands/show.rb', line 15

def self.describe
  {
    :description => "show databases or views on the current instance/database",
    :details => "show [:databases | :views], [:design]",
    :examples => ["show", "show :databases", "show :views"]
  }
end

Instance Method Details

#run(*param) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/couchup/commands/show.rb', line 5

def run(*param)
  option = param.first.to_s
  if(option.blank? || option == 'databases' )
    ap Couchup.databases
  else
    needs_db!
    ap Couchup.views(param.second)
  end
end