Class: Mutant::Runner
- Inherits:
-
Object
- Object
- Mutant::Runner
- Includes:
- AbstractType, Adamantium::Flat
- Defined in:
- lib/mutant/runner.rb,
lib/mutant/runner/config.rb,
lib/mutant/runner/killer.rb,
lib/mutant/runner/subject.rb,
lib/mutant/runner/mutation.rb
Overview
Runner baseclass
Defined Under Namespace
Classes: Config, Killer, Mutation, Subject
Constant Summary collapse
- REGISTRY =
{}
Instance Attribute Summary collapse
-
#config ⇒ Mutant::Config
readonly
private
Return config.
Class Method Summary collapse
-
.run(config, object, *arguments) ⇒ Runner
private
Run runner for object.
Instance Method Summary collapse
-
#initialize(config) ⇒ undefined
constructor
private
Initialize object.
-
#running? ⇒ Boolean
Test if runner is running.
-
#runtime ⇒ Float
private
Return runtime.
-
#stop? ⇒ true, false
private
Test if runner should stop.
-
#success? ⇒ true, false
private
Test if runner is successful.
Constructor Details
#initialize(config) ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize object
82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/mutant/runner.rb', line 82 def initialize(config) @config = config @stop = false @start = Time.now @running = true progress(self) run @running = false progress(self) @end = Time.now end |
Instance Attribute Details
#config ⇒ Mutant::Config (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return config
72 73 74 |
# File 'lib/mutant/runner.rb', line 72 def config @config end |
Class Method Details
.run(config, object, *arguments) ⇒ Runner
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Run runner for object
51 52 53 54 |
# File 'lib/mutant/runner.rb', line 51 def self.run(config, object, *arguments) handler = lookup(object.class) handler.new(config, object, *arguments) end |
Instance Method Details
#running? ⇒ Boolean
Test if runner is running
Yeah this is evil. Should be refactored away
62 63 64 |
# File 'lib/mutant/runner.rb', line 62 def running? @running end |
#runtime ⇒ Float
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return runtime
114 115 116 |
# File 'lib/mutant/runner.rb', line 114 def runtime (@end || Time.now) - @start end |
#stop? ⇒ true, false
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Test if runner should stop
104 105 106 |
# File 'lib/mutant/runner.rb', line 104 def stop? @stop end |
#success? ⇒ true, false
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Test if runner is successful
128 |
# File 'lib/mutant/runner.rb', line 128 abstract_method :success? |