Class: RubyEasyRSA::Commands::Base
- Inherits:
-
Object
- Object
- RubyEasyRSA::Commands::Base
show all
- Defined in:
- lib/ruby_easy_rsa/commands/base.rb
Direct Known Subclasses
BuildCA, BuildClientFull, BuildClientServerFull, BuildServerFull, ExportP12, ExportP7, GenCRL, GenDH, GenReq, ImportReq, InitPKI, Renew, Revoke, SetECPass, SetRSAPass, ShowCA, ShowCert, ShowReq, SignReq, UpdateDB, Upgrade
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(binary: nil) ⇒ Base
Returns a new instance of Base.
10
11
12
|
# File 'lib/ruby_easy_rsa/commands/base.rb', line 10
def initialize(binary: nil)
@binary = binary || RubyEasyRSA.configuration.binary
end
|
Instance Attribute Details
#binary ⇒ Object
Returns the value of attribute binary.
8
9
10
|
# File 'lib/ruby_easy_rsa/commands/base.rb', line 8
def binary
@binary
end
|
Instance Method Details
46
47
48
|
# File 'lib/ruby_easy_rsa/commands/base.rb', line 46
def configure_command(builder, _opts)
builder
end
|
#do_after(_) ⇒ Object
50
|
# File 'lib/ruby_easy_rsa/commands/base.rb', line 50
def do_after(_); end
|
#do_before(_) ⇒ Object
44
|
# File 'lib/ruby_easy_rsa/commands/base.rb', line 44
def do_before(_); end
|
#execute(opts = {}) ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/ruby_easy_rsa/commands/base.rb', line 26
def execute(opts = {})
do_before(opts)
configure_command(instantiate_builder, opts)
.build
.execute(
stdin: stdin,
stdout: stdout,
stderr: stderr
)
do_after(opts)
end
|
#instantiate_builder ⇒ Object
38
39
40
41
42
|
# File 'lib/ruby_easy_rsa/commands/base.rb', line 38
def instantiate_builder
Lino::CommandLineBuilder
.for_command(binary)
.with_option_separator('=')
end
|
#stderr ⇒ Object
22
23
24
|
# File 'lib/ruby_easy_rsa/commands/base.rb', line 22
def stderr
$stderr
end
|
#stdin ⇒ Object
14
15
16
|
# File 'lib/ruby_easy_rsa/commands/base.rb', line 14
def stdin
''
end
|
#stdout ⇒ Object
18
19
20
|
# File 'lib/ruby_easy_rsa/commands/base.rb', line 18
def stdout
$stdout
end
|