Class: Rundoc::CodeCommand
- Inherits:
-
Object
- Object
- Rundoc::CodeCommand
- Defined in:
- lib/rundoc/code_command.rb,
lib/rundoc/code_command/raw.rb,
lib/rundoc/code_command/pipe.rb,
lib/rundoc/code_command/write.rb,
lib/rundoc/code_command/print/erb.rb,
lib/rundoc/code_command/print/text.rb,
lib/rundoc/code_command/rundoc/require.rb,
lib/rundoc/code_command/rundoc_command.rb,
lib/rundoc/code_command/no_such_command.rb,
lib/rundoc/code_command/rundoc/depend_on.rb
Overview
Generic CodeCommand class to be inherited
Direct Known Subclasses
Background::Log::Clear, Background::Log::Read, Background::Start, Background::Stop, Background::Wait, Bash, FileCommand::Append, FileCommand::Remove, NoSuchCommand, Pipe, PrintERB, PrintText, Raw, RundocCommand::DependOn, RundocCommand::Require, Website::Navigate, Website::Screenshot, Website::Visit, Write, RundocCommand
Defined Under Namespace
Modules: FileUtil Classes: Background, Bash, FileCommand, NoSuchCommand, Pipe, PrintERB, PrintText, Raw, RundocCommand, Website, Write
Constant Summary collapse
- NEWLINE =
Newlines are stripped and re-added, this tells the project that we’re intentionally wanting an extra newline
Object.new
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#keyword ⇒ Object
Returns the value of attribute keyword.
-
#original_args ⇒ Object
Returns the value of attribute original_args.
-
#render_command ⇒ Object
(also: #render_command?)
Returns the value of attribute render_command.
-
#render_result ⇒ Object
(also: #render_result?)
Returns the value of attribute render_result.
Instance Method Summary collapse
-
#call(env = {}) ⇒ Object
Executes command to build project Is expected to return the result of the command.
- #hidden? ⇒ Boolean
-
#initialize(*args) ⇒ CodeCommand
constructor
A new instance of CodeCommand.
- #not_hidden? ⇒ Boolean
- #push(contents) ⇒ Object (also: #<<)
-
#to_md(env = {}) ⇒ Object
the output of the command, i.e.
Constructor Details
#initialize(*args) ⇒ CodeCommand
Returns a new instance of CodeCommand.
23 24 |
# File 'lib/rundoc/code_command.rb', line 23 def initialize(*args) end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
16 17 18 |
# File 'lib/rundoc/code_command.rb', line 16 def command @command end |
#contents ⇒ Object
Returns the value of attribute contents.
16 17 18 |
# File 'lib/rundoc/code_command.rb', line 16 def contents @contents end |
#keyword ⇒ Object
Returns the value of attribute keyword.
16 17 18 |
# File 'lib/rundoc/code_command.rb', line 16 def keyword @keyword end |
#original_args ⇒ Object
Returns the value of attribute original_args.
16 17 18 |
# File 'lib/rundoc/code_command.rb', line 16 def original_args @original_args end |
#render_command ⇒ Object Also known as: render_command?
Returns the value of attribute render_command.
16 17 18 |
# File 'lib/rundoc/code_command.rb', line 16 def render_command @render_command end |
#render_result ⇒ Object Also known as: render_result?
Returns the value of attribute render_result.
16 17 18 |
# File 'lib/rundoc/code_command.rb', line 16 def render_result @render_result end |
Instance Method Details
#call(env = {}) ⇒ Object
Executes command to build project Is expected to return the result of the command
42 43 44 |
# File 'lib/rundoc/code_command.rb', line 42 def call(env = {}) raise "not implemented on #{inspect}" end |
#hidden? ⇒ Boolean
26 27 28 |
# File 'lib/rundoc/code_command.rb', line 26 def hidden? !render_command? && !render_result? end |
#not_hidden? ⇒ Boolean
30 31 32 |
# File 'lib/rundoc/code_command.rb', line 30 def not_hidden? !hidden? end |
#push(contents) ⇒ Object Also known as: <<
34 35 36 37 |
# File 'lib/rundoc/code_command.rb', line 34 def push(contents) @contents ||= "" @contents << contents end |
#to_md(env = {}) ⇒ Object
the output of the command, i.e. ‘$ cat foo.txt`
47 48 49 |
# File 'lib/rundoc/code_command.rb', line 47 def to_md(env = {}) raise "not implemented on #{inspect}" end |