Class: Heroku::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/heroku/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Runner

Returns a new instance of Runner.



7
8
9
10
11
12
13
# File 'lib/heroku/runner.rb', line 7

def initialize(options = {})
  @app = options[:app]
  @logger = options[:logger]
  @command = options[:command]
  @size = options[:size]
  raise Heroku::Commander::Errors::MissingCommandError unless @command
end

Instance Attribute Details

#appObject

Returns the value of attribute app.



4
5
6
# File 'lib/heroku/runner.rb', line 4

def app
  @app
end

#commandObject

Returns the value of attribute command.



4
5
6
# File 'lib/heroku/runner.rb', line 4

def command
  @command
end

#loggerObject

Returns the value of attribute logger.



4
5
6
# File 'lib/heroku/runner.rb', line 4

def logger
  @logger
end

#pidObject (readonly)

Returns the value of attribute pid.



5
6
7
# File 'lib/heroku/runner.rb', line 5

def pid
  @pid
end

#runningObject (readonly)

Returns the value of attribute running.



5
6
7
# File 'lib/heroku/runner.rb', line 5

def running
  @running
end

#sizeObject

Returns the value of attribute size.



4
5
6
# File 'lib/heroku/runner.rb', line 4

def size
  @size
end

#tailObject (readonly)

Returns the value of attribute tail.



5
6
7
# File 'lib/heroku/runner.rb', line 5

def tail
  @tail
end

Instance Method Details

#run!(options = {}, &block) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/heroku/runner.rb', line 19

def run!(options = {}, &block)
  if options && options[:detached]
    run_detached! options, &block
  else
    run_attached! options, &block
  end
end

#running?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/heroku/runner.rb', line 15

def running?
  !! @running
end