Class: Cask::Cmd::ExternalRubyCommand

Inherits:
Object
  • Object
show all
Defined in:
brew/Library/Homebrew/cask/cmd.rb

Instance Method Summary collapse

Constructor Details

#initialize(command, path) ⇒ ExternalRubyCommand

Returns a new instance of ExternalRubyCommand.



207
208
209
210
# File 'brew/Library/Homebrew/cask/cmd.rb', line 207

def initialize(command, path)
  @command_name = command.to_s.capitalize.to_sym
  @path = path
end

Instance Method Details

#run(*args) ⇒ Object



212
213
214
215
216
217
218
219
220
221
222
# File 'brew/Library/Homebrew/cask/cmd.rb', line 212

def run(*args)
  require @path

  klass = begin
    Cmd.const_get(@command_name)
  rescue NameError
    return
  end

  klass.run(*args)
end