Class: Most::Box
- Includes:
- FileUtils, MetaProgrammable, BoxHelpers, MemoryOut, OptionsHelpers, PathHelpers, Timeout
- Defined in:
- lib/most/structures/box.rb
Constant Summary
Constants included from MemoryOut
MemoryOut::CALLER_OFFSET, MemoryOut::THIS_FILE
Instance Method Summary collapse
-
#initialize(options = Options.new(), entities = {}, globals = [], input = '', &block) ⇒ Box
constructor
A new instance of Box.
- #run(step) ⇒ Object
Methods included from BoxHelpers
Methods included from MemoryOut
generic_memory_out, memory, memory_out, total_memory, total_memory_out, virtual_memory, virtual_memory_out
Methods included from OptionsHelpers
Methods included from PathHelpers
Methods included from MetaProgrammable
Constructor Details
#initialize(options = Options.new(), entities = {}, globals = [], input = '', &block) ⇒ Box
Returns a new instance of Box.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/most/structures/box.rb', line 64 def initialize( = Options.new(), entities = {}, globals = [], input = '', &block) @options = @entities = entities @globals = globals @input = input @result = {} instance_eval(&block) if block_given? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class MetaProgrammable
Instance Method Details
#run(step) ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/most/structures/box.rb', line 79 def run(step) SERVICES[:environment].state("#{6.w}Executing a test box #{object_id}") SERVICES[:environment].state("#{6.w}Step type: #{step.class}") result = Report.new("Box: #{object_id}") if @options[:tests/:report/:specs] result.specs = {:options => @options, :entities => @entities, :globals => @globals, :input => @input} end result << execute(step) SERVICES[:environment].state("#{6.w}|--> Finished.") result end |