Module: Keystorage

Included in:
CLI, Manager
Defined in:
lib/keystorage.rb,
lib/keystorage/cli.rb,
lib/keystorage/manager.rb

Defined Under Namespace

Classes: CLI, FormatNotSupport, Manager, NoRootGroup, NoSecret, RejectGroupName, SecretMissMatch

Constant Summary collapse

DEFAULT_SECRET =
"3Qw9EtWE"
DEFAULT_FILE =
File.join(ENV["HOME"],".keystorage")

Instance Method Summary collapse

Instance Method Details

#render(out, format = :text) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/keystorage.rb', line 18

def render out,format =:text
  case format
  when :text then
    render_text out
  else
    raise FormatNotSupport.new(format.to_s)
  end
end

#render_text(out) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/keystorage.rb', line 27

def render_text out
  if out.kind_of?(Array)
    out.join("\n")
  else
    out.to_s
  end
end