Module: Clandestine::Commands

Defined in:
lib/clandestine/commands.rb,
lib/clandestine/commands/add.rb,
lib/clandestine/commands/get.rb,
lib/clandestine/commands/delete.rb,
lib/clandestine/commands/update.rb

Defined Under Namespace

Classes: Add, Delete, Get, Update

Class Method Summary collapse

Class Method Details

.add(key, password = nil) ⇒ Object



13
14
15
16
# File 'lib/clandestine/commands.rb', line 13

def self.add(key, password = nil)
  password = IO.get_password unless password
  Add.new(password, key).add
end

.delete(key, password = nil) ⇒ Object



25
26
27
28
# File 'lib/clandestine/commands.rb', line 25

def self.delete(key, password = nil)
  password = IO.get_password unless password
  Delete.new(password, key).delete
end

.get(key = nil, password = nil) ⇒ Object



18
19
20
21
22
23
# File 'lib/clandestine/commands.rb', line 18

def self.get(key = nil, password = nil)
  if key && password.nil?
    password = IO.get_password
  end
  Get.new(password, key).get
end

.help(options) ⇒ Object



48
49
50
# File 'lib/clandestine/commands.rb', line 48

def self.help(options)
  options
end

.locationObject



35
36
37
# File 'lib/clandestine/commands.rb', line 35

def self.location
  ENV['CLANDESTINE_SAFE'] || SAFE_LOCATION
end

.remove(password = nil) ⇒ Object



39
40
41
42
# File 'lib/clandestine/commands.rb', line 39

def self.remove(password = nil)
  password = IO.get_password unless password
  RemoveSafe.new(password).remove
end

.update(key = nil, password = nil) ⇒ Object



30
31
32
33
# File 'lib/clandestine/commands.rb', line 30

def self.update(key = nil, password = nil)
  password = IO.get_password unless password
  Update.new(password, key).update
end

.versionObject



44
45
46
# File 'lib/clandestine/commands.rb', line 44

def self.version
  Clandestine::VERSION
end