Class: Mutiny::Configuration
- Inherits:
-
Object
- Object
- Mutiny::Configuration
- Defined in:
- lib/mutiny/configuration.rb
Instance Attribute Summary collapse
-
#analyser ⇒ Object
readonly
Returns the value of attribute analyser.
-
#integration ⇒ Object
readonly
Returns the value of attribute integration.
-
#loads ⇒ Object
readonly
Returns the value of attribute loads.
-
#mutant_storage ⇒ Object
readonly
Returns the value of attribute mutant_storage.
-
#mutator ⇒ Object
readonly
Returns the value of attribute mutator.
-
#patterns ⇒ Object
readonly
Returns the value of attribute patterns.
-
#reporter ⇒ Object
readonly
Returns the value of attribute reporter.
-
#requires ⇒ Object
readonly
Returns the value of attribute requires.
Instance Method Summary collapse
- #can_load?(source_path) ⇒ Boolean
-
#initialize(loads: [], requires: [], patterns: []) ⇒ Configuration
constructor
A new instance of Configuration.
- #load_paths ⇒ Object
Constructor Details
#initialize(loads: [], requires: [], patterns: []) ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/mutiny/configuration.rb', line 13 def initialize(loads: [], requires: [], patterns: []) @loads = loads @requires = requires @patterns = patterns @patterns.map!(&Pattern.method(:new)) @reporter = Reporter::Stdout.new @integration = Integration::RSpec.new @mutator = Mutants::Ruby.new @mutant_storage = Mutants::Storage.new @analyser = Analysis::Analyser::Default.new(integration: @integration) end |
Instance Attribute Details
#analyser ⇒ Object (readonly)
Returns the value of attribute analyser.
11 12 13 |
# File 'lib/mutiny/configuration.rb', line 11 def analyser @analyser end |
#integration ⇒ Object (readonly)
Returns the value of attribute integration.
11 12 13 |
# File 'lib/mutiny/configuration.rb', line 11 def integration @integration end |
#loads ⇒ Object (readonly)
Returns the value of attribute loads.
10 11 12 |
# File 'lib/mutiny/configuration.rb', line 10 def loads @loads end |
#mutant_storage ⇒ Object (readonly)
Returns the value of attribute mutant_storage.
11 12 13 |
# File 'lib/mutiny/configuration.rb', line 11 def mutant_storage @mutant_storage end |
#mutator ⇒ Object (readonly)
Returns the value of attribute mutator.
11 12 13 |
# File 'lib/mutiny/configuration.rb', line 11 def mutator @mutator end |
#patterns ⇒ Object (readonly)
Returns the value of attribute patterns.
10 11 12 |
# File 'lib/mutiny/configuration.rb', line 10 def patterns @patterns end |
#reporter ⇒ Object (readonly)
Returns the value of attribute reporter.
11 12 13 |
# File 'lib/mutiny/configuration.rb', line 11 def reporter @reporter end |
#requires ⇒ Object (readonly)
Returns the value of attribute requires.
10 11 12 |
# File 'lib/mutiny/configuration.rb', line 10 def requires @requires end |
Instance Method Details
#can_load?(source_path) ⇒ Boolean
30 31 32 |
# File 'lib/mutiny/configuration.rb', line 30 def can_load?(source_path) load_paths.any? { |load_path| source_path.start_with?(load_path) } end |
#load_paths ⇒ Object
26 27 28 |
# File 'lib/mutiny/configuration.rb', line 26 def load_paths loads.map(&File.method(:expand_path)) end |