Class: S3crets::Cli

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/s3crets/cli.rb

Overview

The ‘s3crets` binay/thor application main class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCli

Returns a new instance of Cli.



16
17
18
19
20
21
22
23
24
# File 'lib/s3crets/cli.rb', line 16

def initialize(*)
  super
  the_shell = (options['no-color'] ? Thor::Shell::Basic.new : shell)
  @ui = Shell.new(the_shell)
  @ui.be_quiet! if options['quiet']
  @ui.debug! if options['verbose']

  debug_header
end

Instance Attribute Details

#uiObject

Returns the value of attribute ui.



14
15
16
# File 'lib/s3crets/cli.rb', line 14

def ui
  @ui
end

Instance Method Details

#bundleObject Also known as: plunder, install



49
50
51
# File 'lib/s3crets/cli.rb', line 49

def bundle
  run_action { bundle! }
end

#get(key) ⇒ Object



74
75
76
# File 'lib/s3crets/cli.rb', line 74

def get(key)
  run_action { get! key }
end

#initObject



43
44
45
# File 'lib/s3crets/cli.rb', line 43

def init
  run_action { init! }
end

#updateObject



62
63
64
# File 'lib/s3crets/cli.rb', line 62

def update
  run_action { update! }
end

#versionObject



27
28
29
# File 'lib/s3crets/cli.rb', line 27

def version
  say "#{APPLICATION_NAME} Version: #{VERSION}"
end