Class: HerokuCLI::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/heroku_cli/base.rb

Direct Known Subclasses

Maintenance, PG, ProcessStatus

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(application) ⇒ Base

Returns a new instance of Base.



5
6
7
# File 'lib/heroku_cli/base.rb', line 5

def initialize(application)
  @application = application.is_a?(String) ? Application.new(application) : application
end

Instance Attribute Details

#applicationObject (readonly)

Returns the value of attribute application.



3
4
5
# File 'lib/heroku_cli/base.rb', line 3

def application
  @application
end

Instance Method Details

#heroku(cmd, args = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/heroku_cli/base.rb', line 9

def heroku(cmd, args=nil)
  if !args || args.strip.empty?
    puts "heroku #{cmd} -a #{application.name}"
    %x{ heroku #{cmd} -a #{application.name} }
  else
    puts "heroku #{cmd} -a #{application.name} -- #{args}"
    %x{ heroku #{cmd} -a #{application.name} -- #{args} }
  end
end