class Rundoc::CodeCommand::Background::StdinWrite
Will send contents to the background process via STDIN along with a newline
Public Class Methods
Source
# File lib/rundoc/code_command/background/stdin_write.rb, line 6 def initialize(contents, name:, wait:, timeout: 5, ending: $/) @contents = contents @ending = ending @wait = wait @name = name @timeout_value = Integer(timeout) @contents_written = nil @background = nil end
Public Instance Methods
Source
# File lib/rundoc/code_command/background/stdin_write.rb, line 16 def background @background ||= Rundoc::CodeCommand::Background::ProcessSpawn.find(@name) end
Source
# File lib/rundoc/code_command/background/stdin_write.rb, line 26 def call(env = {}) writecontents background.log.read end
The contents produced by the command (‘:::->`) are rendered by the `def to_md
` method.
Source
# File lib/rundoc/code_command/background/stdin_write.rb, line 21 def to_md(env = {}) writecontents end
The command is rendered (‘:::>-`) by the output of the `def call` method.
Source
# File lib/rundoc/code_command/background/stdin_write.rb, line 31 def writecontents @contents_written ||= background.stdin_write( contents, wait: @wait, ending: @ending, timeout: @timeout_value ) end