Class: Docgenerator::Creole::Plugins::Creole_plugin_ruby_raw
- Inherits:
-
Creole_inclusion_and_plugin
- Object
- Creole_inclusion_and_plugin
- Docgenerator::Creole::Plugins::Creole_plugin_ruby_raw
- Defined in:
- lib/docgenerator/creole/plugins.rb
Overview
Eval the given ruby-code and put it as “raw text”.
This is defined as a plugin.
Instance Attribute Summary
Attributes inherited from Creole_inclusion_and_plugin
Instance Method Summary collapse
-
#initialize(inclusionname, description, options, wiki) ⇒ Creole_plugin_ruby_raw
constructor
A new instance of Creole_plugin_ruby_raw.
- #inspect ⇒ Object
-
#to_doc(target, options = {}) ⇒ Object
initialize.
Methods inherited from Creole_inclusion_and_plugin
set_inclusions_key, set_plugin_key
Constructor Details
#initialize(inclusionname, description, options, wiki) ⇒ Creole_plugin_ruby_raw
Returns a new instance of Creole_plugin_ruby_raw.
176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/docgenerator/creole/plugins.rb', line 176 def initialize( inclusionname, description, , wiki ) #The ruby-code may contain | - so we have to ad it again description << "|#{.join('|')}" unless .empty? = nil super @code = description begin @result = eval(@code) rescue => bang wiki.log.error("Plugin ruby_raw: <#{@code}> results in #{bang.class}/#{bang}") if wiki.log.error? end end |
Instance Method Details
#inspect ⇒ Object
191 192 193 |
# File 'lib/docgenerator/creole/plugins.rb', line 191 def inspect() "#<Creole_plugin_ruby_raw:#{@code}>" end |
#to_doc(target, options = {}) ⇒ Object
initialize
188 189 190 |
# File 'lib/docgenerator/creole/plugins.rb', line 188 def to_doc(target, ={}) @result.to_s end |