Class: SSHKit::Configuration
- Inherits:
-
Object
- Object
- SSHKit::Configuration
- Defined in:
- lib/sshkit/configuration.rb
Instance Attribute Summary collapse
- #backend ⇒ Object
- #default_env ⇒ Object
- #default_runner ⇒ Object
- #output ⇒ Object
-
#output_verbosity ⇒ Object
Returns the value of attribute output_verbosity.
-
#umask ⇒ Object
Returns the value of attribute umask.
Instance Method Summary collapse
- #command_map ⇒ Object
- #command_map=(value) ⇒ Object
- #deprecation_logger ⇒ Object
- #deprecation_output=(out) ⇒ Object
-
#format=(format) ⇒ Object
TODO: deprecate in favor of ‘use_format`.
-
#use_format(formatter, *args) ⇒ Object
Tell SSHKit to use the specified ‘formatter` for stdout.
Instance Attribute Details
#backend ⇒ Object
29 30 31 |
# File 'lib/sshkit/configuration.rb', line 29 def backend @backend ||= SSHKit::Backend::Netssh end |
#default_env ⇒ Object
21 22 23 |
# File 'lib/sshkit/configuration.rb', line 21 def default_env @default_env ||= {} end |
#default_runner ⇒ Object
25 26 27 |
# File 'lib/sshkit/configuration.rb', line 25 def default_runner @default_runner ||= :parallel end |
#output ⇒ Object
8 9 10 |
# File 'lib/sshkit/configuration.rb', line 8 def output @output ||= use_format(:pretty) end |
#output_verbosity ⇒ Object
Returns the value of attribute output_verbosity.
5 6 7 |
# File 'lib/sshkit/configuration.rb', line 5 def output_verbosity @output_verbosity end |
#umask ⇒ Object
Returns the value of attribute umask.
5 6 7 |
# File 'lib/sshkit/configuration.rb', line 5 def umask @umask end |
Instance Method Details
#command_map ⇒ Object
66 67 68 |
# File 'lib/sshkit/configuration.rb', line 66 def command_map @command_map ||= SSHKit::CommandMap.new end |
#command_map=(value) ⇒ Object
70 71 72 |
# File 'lib/sshkit/configuration.rb', line 70 def command_map=(value) @command_map = SSHKit::CommandMap.new(value) end |
#deprecation_logger ⇒ Object
12 13 14 15 |
# File 'lib/sshkit/configuration.rb', line 12 def deprecation_logger self.deprecation_output = $stderr if @deprecation_logger.nil? @deprecation_logger end |
#deprecation_output=(out) ⇒ Object
17 18 19 |
# File 'lib/sshkit/configuration.rb', line 17 def deprecation_output=(out) @deprecation_logger = DeprecationLogger.new(out) end |
#format=(format) ⇒ Object
TODO: deprecate in favor of ‘use_format`
42 43 44 |
# File 'lib/sshkit/configuration.rb', line 42 def format=(format) use_format(format) end |
#use_format(formatter, *args) ⇒ Object
Tell SSHKit to use the specified ‘formatter` for stdout. The formatter can be the name of a built-in SSHKit formatter, like `:pretty`, a formatter class, like `SSHKit::Formatter::Pretty`, or a custom formatter class you’ve written yourself.
Additional arguments will be passed to the formatter’s constructor.
Example:
config.use_format(:pretty)
Is equivalent to:
config.output = SSHKit::Formatter::Pretty.new($stdout)
61 62 63 64 |
# File 'lib/sshkit/configuration.rb', line 61 def use_format(formatter, *args) klass = formatter.is_a?(Class) ? formatter : formatter_class(formatter) self.output = klass.new($stdout, *args) end |