Method: CouchShell::CorePlugin#lookup_uuid

Defined in:
lib/couch-shell-plugin/core.rb

#lookup_uuidObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/couch-shell-plugin/core.rb', line 10

def lookup_uuid
  shell.execute "uuids"
  if shell.responses.current(&:ok?)
    json = shell.responses.current.json_value
    if json && (uuids = json["uuids"]) && uuids.array? && uuids.length > 0
      uuids[0]
    else
      raise ShellError, "unkown json structure"
    end
  else
    raise ShellError, "uuids request failed"
  end
end