Class: Brew::Commands::Info
- Inherits:
-
Object
- Object
- Brew::Commands::Info
- Defined in:
- lib/brew/commands/info.rb
Instance Attribute Summary collapse
-
#brew_path ⇒ Object
readonly
Returns the value of attribute brew_path.
-
#formulae ⇒ Object
readonly
Returns the value of attribute formulae.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#system_runner ⇒ Object
readonly
Returns the value of attribute system_runner.
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(brew_path, *formulae, **kwargs) ⇒ Info
constructor
A new instance of Info.
Constructor Details
#initialize(brew_path, *formulae, **kwargs) ⇒ Info
Returns a new instance of Info.
11 12 13 14 15 16 |
# File 'lib/brew/commands/info.rb', line 11 def initialize(brew_path, *formulae, **kwargs) @brew_path = brew_path @formulae = formulae.join(' ') @options = parse_args(kwargs) @system_runner = SystemRunner.new end |
Instance Attribute Details
#brew_path ⇒ Object (readonly)
Returns the value of attribute brew_path.
9 10 11 |
# File 'lib/brew/commands/info.rb', line 9 def brew_path @brew_path end |
#formulae ⇒ Object (readonly)
Returns the value of attribute formulae.
9 10 11 |
# File 'lib/brew/commands/info.rb', line 9 def formulae @formulae end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/brew/commands/info.rb', line 9 def @options end |
#system_runner ⇒ Object (readonly)
Returns the value of attribute system_runner.
9 10 11 |
# File 'lib/brew/commands/info.rb', line 9 def system_runner @system_runner end |
Instance Method Details
#execute! ⇒ Object
18 19 20 21 22 23 |
# File 'lib/brew/commands/info.rb', line 18 def execute! info_command = "#{brew_path} info #{} #{formulae}".squish system_runner.print_output(info_command) rescue StandardError => e raise Brew::ExecutionError, e end |