Class: Mumukit::Runner
- Inherits:
-
Object
- Object
- Mumukit::Runner
- Defined in:
- lib/mumukit/runner.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#runtime ⇒ Object
readonly
Returns the value of attribute runtime.
Class Method Summary collapse
Instance Method Summary collapse
- #config ⇒ Object
- #configure {|@config| ... } ⇒ Object
- #configure_runtime(config) ⇒ Object
- #directives_pipeline ⇒ Object
-
#initialize(name) ⇒ Runner
constructor
A new instance of Runner.
- #new_directives_pipeline ⇒ Object
- #prefix ⇒ Object
Constructor Details
#initialize(name) ⇒ Runner
Returns a new instance of Runner.
5 6 7 |
# File 'lib/mumukit/runner.rb', line 5 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/mumukit/runner.rb', line 3 def name @name end |
#runtime ⇒ Object (readonly)
Returns the value of attribute runtime.
3 4 5 |
# File 'lib/mumukit/runner.rb', line 3 def runtime @runtime end |
Class Method Details
.configure_defaults {|@default_config| ... } ⇒ Object
48 49 50 51 |
# File 'lib/mumukit/runner.rb', line 48 def self.configure_defaults @default_config ||= OpenStruct.new yield @default_config end |
.default_config ⇒ Object
44 45 46 |
# File 'lib/mumukit/runner.rb', line 44 def self.default_config @default_config end |
Instance Method Details
#config ⇒ Object
18 19 20 |
# File 'lib/mumukit/runner.rb', line 18 def config @config or raise 'This runner has not being configured yet' end |
#configure {|@config| ... } ⇒ Object
9 10 11 12 |
# File 'lib/mumukit/runner.rb', line 9 def configure @config ||= self.class.default_config.clone yield @config end |
#configure_runtime(config) ⇒ Object
14 15 16 |
# File 'lib/mumukit/runner.rb', line 14 def configure_runtime(config) @runtime = Mumukit::Runtime.new(config) end |
#directives_pipeline ⇒ Object
26 27 28 |
# File 'lib/mumukit/runner.rb', line 26 def directives_pipeline @pipeline ||= new_directives_pipeline end |
#new_directives_pipeline ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/mumukit/runner.rb', line 30 def new_directives_pipeline if config.preprocessor_enabled Mumukit::Directives::Pipeline.new( [Mumukit::Directives::Sections.new, Mumukit::Directives::Interpolations.new('test'), Mumukit::Directives::Interpolations.new('extra'), Mumukit::Directives::Interpolations.new('content'), Mumukit::Directives::Flags.new], config.comment_type) else Mumukit::Directives::NullPipeline end end |
#prefix ⇒ Object
22 23 24 |
# File 'lib/mumukit/runner.rb', line 22 def prefix name.camelize end |