module HerokuCLI

Constants

VALID_HEROKU_CLI_PATHS

Public Class Methods

cmd(arg, app_name) click to toggle source

Invokes a command using the Heroku CLI @param {string} arg @param {string} app_name @return nil

# File lib/heroku_cli.rb, line 12
def HerokuCLI.cmd(arg, app_name)
  system("#{HerokuCLI.path} #{arg} --app #{app_name}")
end

Private Class Methods

path() click to toggle source

Searches for the Heroku CLI and returns a string containing the found path, otherwise it raises an error @return {string}

# File lib/heroku_cli.rb, line 21
def HerokuCLI.path
  path = nil
  VALID_HEROKU_CLI_PATHS.each { |p| path = p if File.exist?(p) }
  if path.nil?
    raise "Heroku cli not found. Install the heroku-cli and ensure the path is set properly"
  end
  path
end