class Muchkeys::CLI

Public Instance Methods

__version() click to toggle source
# File lib/muchkeys/cli.rb, line 70
def __version
  Muchkeys.configure { |c| c.consul_url = options[:consul_url] }
  say Muchkeys::VERSION
end
check(app_name) click to toggle source
# File lib/muchkeys/cli.rb, line 27
def check(app_name)
  Muchkeys.configure { |c| c.consul_url = options[:consul_url] }
  say MuchkeysExecutor.check(app_name)
end
decrypt(consul_key) click to toggle source
# File lib/muchkeys/cli.rb, line 21
def decrypt(consul_key)
  Muchkeys.configure { |c| c.consul_url = options[:consul_url] }
  say MuchkeysExecutor.decrypt(consul_key, options[:public_key], options[:private_key])
end
delete(key) click to toggle source
# File lib/muchkeys/cli.rb, line 64
def delete(key)
  Muchkeys.configure { |c| c.consul_url = options[:consul_url] }
  say MuchkeysExecutor.delete(key)
end
encrypt(file) click to toggle source
# File lib/muchkeys/cli.rb, line 13
def encrypt(file)
  Muchkeys.configure { |c| c.consul_url = options[:consul_url] }
  say MuchkeysExecutor.encrypt(file, options[:public_key])
end
fetch(consul_key) click to toggle source
# File lib/muchkeys/cli.rb, line 39
def fetch(consul_key)
  Muchkeys.configure { |c| c.consul_url = options[:consul_url] }
  say MuchkeysExecutor.fetch(consul_key)
end
list(app_name) click to toggle source
# File lib/muchkeys/cli.rb, line 33
def list(app_name)
  Muchkeys.configure { |c| c.consul_url = options[:consul_url] }
  say MuchkeysExecutor.list(app_name)
end
store(data, consul_key) click to toggle source
# File lib/muchkeys/cli.rb, line 47
def store(data, consul_key)
  Muchkeys.configure { |c| c.consul_url = options[:consul_url] }
  say MuchkeysExecutor.store(consul_key, data, public_key: options[:public_key], private_key: options[:private_key])
end
wipeout() click to toggle source
# File lib/muchkeys/cli.rb, line 54
def wipeout
  Muchkeys.configure { |c| c.consul_url = options[:consul_url] }
  unless yes?("Really clear consul instance at #{Muchkeys.config.consul_url}?", Thor::Shell::Color::RED)
    say "Nothing done!"
  else
    say MuchkeysExecutor.wipeout(app_name: options[:app_name])
  end
end