Class: Rundoc::CodeCommand::Background::StopRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/rundoc/code_command/background/stop.rb

Instance Method Summary collapse

Constructor Details

#initialize(user_args:, render_command:, render_result:, io: nil, contents: nil) ⇒ StopRunner

Returns a new instance of StopRunner.



13
14
15
16
# File 'lib/rundoc/code_command/background/stop.rb', line 13

def initialize(user_args:, render_command:, render_result:, io: nil, contents: nil)
  @name = user_args.name
  @background = nil
end

Instance Method Details

#backgroundObject



18
19
20
# File 'lib/rundoc/code_command/background/stop.rb', line 18

def background
  @background ||= Rundoc::CodeCommand::Background::ProcessSpawn.find(@name)
end

#call(env = {}) ⇒ Object



26
27
28
29
# File 'lib/rundoc/code_command/background/stop.rb', line 26

def call(env = {})
  background.stop
  background.log.read
end

#to_md(env = {}) ⇒ Object



22
23
24
# File 'lib/rundoc/code_command/background/stop.rb', line 22

def to_md(env = {})
  ""
end