Class: Shh::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/shh/cli.rb

Class Method Summary collapse

Class Method Details

.execute(*args) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/shh/cli.rb', line 10

def self.execute *args
  prompt = Prompt.new
  passphrase = prompt.ask('Enter your passphrase', :silent => true)
  path = args.shift || '~'
  Dir.chdir(File.expand_path(path)) do
    serialiser = BlowfishSerialiser.new(FlatHash::Serialiser.new, passphrase)
    EntriesMenu.new(prompt, FlatHash::Repository.new(serialiser, '.secret')).push
  end
end