Class: HerokuCLI::Base
- Inherits:
-
Object
- Object
- HerokuCLI::Base
- Defined in:
- lib/heroku_cli/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#application ⇒ Object
readonly
Returns the value of attribute application.
Instance Method Summary collapse
- #heroku(cmd, args = nil) ⇒ Object
-
#initialize(application) ⇒ Base
constructor
A new instance of Base.
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
#application ⇒ Object (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 |