class RubyHelm::Commands::Base

Attributes

binary[R]

Public Class Methods

new(binary: nil) click to toggle source
# File lib/ruby_helm/commands/base.rb, line 8
def initialize(binary: nil)
  @binary = binary || RubyHelm.configuration.binary
end

Public Instance Methods

configure_command(builder, opts) click to toggle source
# File lib/ruby_helm/commands/base.rb, line 46
def configure_command(builder, opts)
end
do_after(opts) click to toggle source
# File lib/ruby_helm/commands/base.rb, line 49
def do_after(opts)
end
do_before(opts) click to toggle source
# File lib/ruby_helm/commands/base.rb, line 43
def do_before(opts)
end
execute(opts = {}) click to toggle source
# File lib/ruby_helm/commands/base.rb, line 24
def execute(opts = {})
  builder = instantiate_builder

  do_before(opts)
  configure_command(builder, opts)
      .build
      .execute(
          stdin: stdin,
          stdout: stdout,
          stderr: stderr)
  do_after(opts)
end
instantiate_builder() click to toggle source
# File lib/ruby_helm/commands/base.rb, line 37
def instantiate_builder
  Lino::CommandLineBuilder
      .for_command(binary)
      .with_option_separator('=')
end
stderr() click to toggle source
# File lib/ruby_helm/commands/base.rb, line 20
def stderr
  $stderr
end
stdin() click to toggle source
# File lib/ruby_helm/commands/base.rb, line 12
def stdin
  ''
end
stdout() click to toggle source
# File lib/ruby_helm/commands/base.rb, line 16
def stdout
  $stdout
end