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/repl.rb,
lib/rundoc/code_command/write.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, Raw, Repl, RundocCommand::DependOn, RundocCommand::Require, Website::Navigate, Website::Screenshot, Website::Visit, Write, RundocCommand
Defined Under Namespace
Modules: FileUtil Classes: Background, Bash, FileCommand, NoSuchCommand, Pipe, Raw, Repl, RundocCommand, Website, Write
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.
12 13 |
# File 'lib/rundoc/code_command.rb', line 12 def initialize(*args) end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
5 6 7 |
# File 'lib/rundoc/code_command.rb', line 5 def command @command end |
#contents ⇒ Object
Returns the value of attribute contents.
5 6 7 |
# File 'lib/rundoc/code_command.rb', line 5 def contents @contents end |
#keyword ⇒ Object
Returns the value of attribute keyword.
5 6 7 |
# File 'lib/rundoc/code_command.rb', line 5 def keyword @keyword end |
#original_args ⇒ Object
Returns the value of attribute original_args.
5 6 7 |
# File 'lib/rundoc/code_command.rb', line 5 def original_args @original_args end |
#render_command ⇒ Object Also known as: render_command?
Returns the value of attribute render_command.
5 6 7 |
# File 'lib/rundoc/code_command.rb', line 5 def render_command @render_command end |
#render_result ⇒ Object Also known as: render_result?
Returns the value of attribute render_result.
5 6 7 |
# File 'lib/rundoc/code_command.rb', line 5 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
31 32 33 |
# File 'lib/rundoc/code_command.rb', line 31 def call(env = {}) raise "not implemented on #{self.inspect}" end |
#hidden? ⇒ Boolean
15 16 17 |
# File 'lib/rundoc/code_command.rb', line 15 def hidden? !render_command? && !render_result? end |
#not_hidden? ⇒ Boolean
19 20 21 |
# File 'lib/rundoc/code_command.rb', line 19 def not_hidden? !hidden? end |
#push(contents) ⇒ Object Also known as: <<
23 24 25 26 |
# File 'lib/rundoc/code_command.rb', line 23 def push(contents) @contents ||= "" @contents << contents end |
#to_md(env = {}) ⇒ Object
the output of the command, i.e. ‘$ cat foo.txt`
36 37 38 |
# File 'lib/rundoc/code_command.rb', line 36 def to_md(env = {}) raise "not implemented on #{self.inspect}" end |