class Rundoc::CodeCommand

Generic CodeCommand class to be inherited

Constants

NEWLINE

Newlines are stripped and re-added, this tells the project that we’re intentionally wanting an extra newline

Attributes

command[RW]
contents[RW]
keyword[RW]
original_args[RW]
render_command[RW]
render_command?[RW]
render_result[RW]
render_result?[RW]

Public Class Methods

new(*args) click to toggle source
# File lib/rundoc/code_command.rb, line 23
def initialize(*args)
end

Public Instance Methods

<<(contents)
Alias for: push
call(env = {}) click to toggle source

Executes command to build project Is expected to return the result of the command

# File lib/rundoc/code_command.rb, line 42
def call(env = {})
  raise "not implemented on #{inspect}"
end
hidden?() click to toggle source
# File lib/rundoc/code_command.rb, line 26
def hidden?
  !render_command? && !render_result?
end
not_hidden?() click to toggle source
# File lib/rundoc/code_command.rb, line 30
def not_hidden?
  !hidden?
end
push(contents) click to toggle source
# File lib/rundoc/code_command.rb, line 34
def push(contents)
  @contents ||= ""
  @contents << contents
end
Also aliased as: <<
to_md(env = {}) click to toggle source

the output of the command, i.e. ‘$ cat foo.txt`

# File lib/rundoc/code_command.rb, line 47
def to_md(env = {})
  raise "not implemented on #{inspect}"
end