Module: Lockness

Defined in:
lib/lockness.rb,
lib/lockness/edit.rb,
lib/lockness/help.rb,
lib/lockness/show.rb,
lib/lockness/setup.rb,
lib/lockness/content.rb,
lib/lockness/decrypt.rb,
lib/lockness/version.rb,
lib/lockness/master_key.rb,
lib/lockness/path_builder.rb,
lib/lockness/encrypted_file.rb,
lib/lockness/ensure_master_key_git_ignored.rb

Defined Under Namespace

Modules: Help, PathBuilder, Setup Classes: Content, Decrypt, Edit, EncryptedFile, EnsureMasterKeyGitIgnored, MasterKey, Show

Constant Summary collapse

VERSION =
'0.2.0'

Class Method Summary collapse

Class Method Details

.decrypt(path) ⇒ Object



20
21
22
# File 'lib/lockness.rb', line 20

def self.decrypt(path)
  Decrypt.new(path: path).decrypt
end

.startObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/lockness.rb', line 3

def self.start
  EnsureMasterKeyGitIgnored.new.ensure_master_key_git_ignored

  if ARGV.first == 'init' && ARGV.count == 1
    MasterKey.new.generate
  elsif ARGV.first == 'edit' && ARGV.count == 2
    Edit.new.edit
  elsif ARGV.first == 'show' && ARGV.count == 2
    Show.new.show
  elsif ARGV.first == 'help' && ARGV.count == 1 || ARGV.none?
    Help.show
  else
    puts "Unable to process arguments: '#{ARGV.join(' ')}'"
    exit 1
  end
end