Class: Zanzibar::Cli
- Inherits:
-
Thor
- Object
- Thor
- Zanzibar::Cli
- Includes:
- Thor::Actions
- Defined in:
- lib/zanzibar/cli.rb
Overview
The ‘zanzibar` binary/thor application main class. See whatisthor.com/ for information on syntax.
Instance Attribute Summary collapse
-
#ui ⇒ Object
The stream to which we are writing messages (usually stdout).
Instance Method Summary collapse
-
#bundle ⇒ Object
(also: #plunder, #install)
Fetch secrets declared in a local Zanzifle.
-
#get(scrt_id) ⇒ Object
Fetch a single secret specified on the commandline.
-
#init ⇒ Object
Generate a new blank Zanzifile.
-
#initialize ⇒ Cli
constructor
Initialize the application and set some logging defaults.
-
#update ⇒ Object
Redownload Zazifile secrets.
-
#version ⇒ Object
Print the version of the application.
Constructor Details
#initialize ⇒ Cli
Initialize the application and set some logging defaults
23 24 25 26 27 28 29 30 31 |
# File 'lib/zanzibar/cli.rb', line 23 def initialize(*) super the_shell = (['no-color'] ? Thor::Shell::Basic.new : shell) @ui = Shell.new(the_shell) @ui.be_quiet! if ['quiet'] @ui.debug! if ['verbose'] debug_header end |
Instance Attribute Details
#ui ⇒ Object
The stream to which we are writing messages (usually stdout)
19 20 21 |
# File 'lib/zanzibar/cli.rb', line 19 def ui @ui end |
Instance Method Details
#bundle ⇒ Object Also known as: plunder, install
Fetch secrets declared in a local Zanzifle
62 |
# File 'lib/zanzibar/cli.rb', line 62 desc 'bundle', "Fetch secrets declared in your #{ZANZIFILE_NAME}" |
#get(scrt_id) ⇒ Object
Fetch a single secret specified on the commandline
103 104 105 |
# File 'lib/zanzibar/cli.rb', line 103 def get(scrt_id) run_action { get! scrt_id } end |
#init ⇒ Object
Generate a new blank Zanzifile
42 |
# File 'lib/zanzibar/cli.rb', line 42 desc 'init', "Create an empty #{ZANZIFILE_NAME} in the current directory." |
#update ⇒ Object
Redownload Zazifile secrets
79 |
# File 'lib/zanzibar/cli.rb', line 79 desc 'update', "Redownload all secrets in your #{ZANZIFILE_NAME}" |
#version ⇒ Object
Print the version of the application
35 |
# File 'lib/zanzibar/cli.rb', line 35 desc 'version', 'Display your Zanzibar verion' |