Class: DnsMadeEasy::CLI::Launcher
- Inherits:
-
Object
- Object
- DnsMadeEasy::CLI::Launcher
- Defined in:
- lib/dnsmadeeasy/cli/launcher.rb
Overview
Entrypoint used by the executable and in-process CLI specs.
Instance Attribute Summary collapse
-
#argv ⇒ Object
readonly
Returns the value of attribute argv.
-
#kernel ⇒ Object
readonly
Returns the value of attribute kernel.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdin ⇒ Object
readonly
Returns the value of attribute stdin.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(argv, stdin = $stdin, stdout = $stdout, stderr = $stderr, kernel = Kernel) ⇒ Launcher
constructor
A new instance of Launcher.
Constructor Details
#initialize(argv, stdin = $stdin, stdout = $stdout, stderr = $stderr, kernel = Kernel) ⇒ Launcher
Returns a new instance of Launcher.
14 15 16 17 18 19 20 |
# File 'lib/dnsmadeeasy/cli/launcher.rb', line 14 def initialize(argv, stdin = $stdin, stdout = $stdout, stderr = $stderr, kernel = Kernel) @argv = argv @stdin = stdin @stdout = stdout @stderr = stderr @kernel = kernel end |
Instance Attribute Details
#argv ⇒ Object (readonly)
Returns the value of attribute argv.
12 13 14 |
# File 'lib/dnsmadeeasy/cli/launcher.rb', line 12 def argv @argv end |
#kernel ⇒ Object (readonly)
Returns the value of attribute kernel.
12 13 14 |
# File 'lib/dnsmadeeasy/cli/launcher.rb', line 12 def kernel @kernel end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
12 13 14 |
# File 'lib/dnsmadeeasy/cli/launcher.rb', line 12 def stderr @stderr end |
#stdin ⇒ Object (readonly)
Returns the value of attribute stdin.
12 13 14 |
# File 'lib/dnsmadeeasy/cli/launcher.rb', line 12 def stdin @stdin end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
12 13 14 |
# File 'lib/dnsmadeeasy/cli/launcher.rb', line 12 def stdout @stdout end |
Instance Method Details
#execute! ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/dnsmadeeasy/cli/launcher.rb', line 22 def execute! return print_account_operation_help if account_operation_help? Input.stdin = stdin command.call(arguments: argv, out: stdout, err: stderr) rescue SystemExit => e e.status rescue StandardError => e stderr.puts(e.) 1 end |