Class: Pork::Executor

Inherits:
Struct
  • Object
show all
Defined in:
lib/pork/executor.rb

Direct Known Subclasses

Sequential, Shuffled

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(new_isolator) ⇒ Executor

Returns a new instance of Executor.



20
21
22
23
24
# File 'lib/pork/executor.rb', line 20

def initialize new_isolator
  super(new_isolator)
  extensions = Pork.execute_extensions
  extend(*extensions.reverse) if extensions.any?
end

Instance Attribute Details

#isolatorObject

Returns the value of attribute isolator

Returns:

  • (Object)

    the current value of isolator



6
7
8
# File 'lib/pork/executor.rb', line 6

def isolator
  @isolator
end

Class Method Details

.[](index) ⇒ Object



7
8
9
# File 'lib/pork/executor.rb', line 7

def self.[] index
  Isolator[][index]
end

.execute(mode: Pork.execute_mode, stat: Pork.stat, suite: Suite, isolator: Isolator[suite], paths: isolator.all_paths) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/pork/executor.rb', line 11

def self.execute mode: Pork.execute_mode,
                 stat: Pork.stat,
                 suite: Suite,
                 isolator: Isolator[suite],
                 paths: isolator.all_paths
  require "pork/mode/#{mode}"
  Pork.const_get(mode.capitalize).new(isolator).execute(stat, paths)
end

Instance Method Details

#execute(stat = Stat.new, paths = isolator.all_paths) ⇒ Object

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/pork/executor.rb', line 26

def execute stat=Stat.new, paths=isolator.all_paths
  raise NotImplementedError
end