Class: FluentCommandBuilder::BackticksExecutor

Inherits:
ExecutorBase
  • Object
show all
Defined in:
lib/fluent_command_builder/command_executors/backticks_executor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ExecutorBase

#execute, #will_fail_on_error?, #will_print_on_execute?

Constructor Details

#initializeBackticksExecutor

Returns a new instance of BackticksExecutor.



8
9
10
11
# File 'lib/fluent_command_builder/command_executors/backticks_executor.rb', line 8

def initialize
  @password_formatter = FluentCommandBuilder.password_formatter
  @passwords = []
end

Instance Attribute Details

#password_formatterObject

Returns the value of attribute password_formatter.



6
7
8
# File 'lib/fluent_command_builder/command_executors/backticks_executor.rb', line 6

def password_formatter
  @password_formatter
end

#passwordsObject

Returns the value of attribute passwords.



6
7
8
# File 'lib/fluent_command_builder/command_executors/backticks_executor.rb', line 6

def passwords
  @passwords
end

Instance Method Details

#do_execute(command) ⇒ Object



13
14
15
16
# File 'lib/fluent_command_builder/command_executors/backticks_executor.rb', line 13

def do_execute(command)
  output = `#{command}`
  @password_formatter.format output, @passwords
end