Class: CouchShell::CoreDesignsPlugin

Inherits:
Plugin
  • Object
show all
Defined in:
lib/couch-shell-plugin/core_designs.rb

Instance Method Summary collapse

Methods inherited from Plugin

inherited, #initialize, #plugin_info, #plugin_initialization, #plugin_name, #shell, #variables_object

Methods included from PluginUtils

#continue?, #dbname!, #editfile!, #edittext!, #ensure_at_database, #request!

Constructor Details

This class inherits a constructor from CouchShell::Plugin

Instance Method Details

#all_designs_urlObject



9
10
11
# File 'lib/couch-shell-plugin/core_designs.rb', line 9

def all_designs_url
  '/' + dbname! + '/_all_docs?startkey="_design/"&endkey="_design0"'
end

#execute_designs(argstr) ⇒ Object

Raises:



14
15
16
17
18
19
20
# File 'lib/couch-shell-plugin/core_designs.rb', line 14

def execute_designs(argstr)
  raise ShellError, "argument not allowed" if argstr
  res = request!("GET", all_designs_url, nil, false)
  res.json["rows"].each { |row|
    shell.stdout.puts row["key"].sub(%r{\A_design/}, '')
  }
end