Class: Mutiny::Configuration
- Inherits:
-
Object
- Object
- Mutiny::Configuration
- Defined in:
- lib/mutiny/configuration.rb
Instance Attribute Summary collapse
-
#integration ⇒ Object
readonly
Returns the value of attribute integration.
-
#loads ⇒ Object
readonly
Returns the value of attribute loads.
-
#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.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/mutiny/configuration.rb', line 10 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 end |
Instance Attribute Details
#integration ⇒ Object (readonly)
Returns the value of attribute integration.
8 9 10 |
# File 'lib/mutiny/configuration.rb', line 8 def integration @integration end |
#loads ⇒ Object (readonly)
Returns the value of attribute loads.
8 9 10 |
# File 'lib/mutiny/configuration.rb', line 8 def loads @loads end |
#mutator ⇒ Object (readonly)
Returns the value of attribute mutator.
8 9 10 |
# File 'lib/mutiny/configuration.rb', line 8 def mutator @mutator end |
#patterns ⇒ Object (readonly)
Returns the value of attribute patterns.
8 9 10 |
# File 'lib/mutiny/configuration.rb', line 8 def patterns @patterns end |
#reporter ⇒ Object (readonly)
Returns the value of attribute reporter.
8 9 10 |
# File 'lib/mutiny/configuration.rb', line 8 def reporter @reporter end |
#requires ⇒ Object (readonly)
Returns the value of attribute requires.
8 9 10 |
# File 'lib/mutiny/configuration.rb', line 8 def requires @requires end |
Instance Method Details
#can_load?(source_path) ⇒ Boolean
25 26 27 |
# File 'lib/mutiny/configuration.rb', line 25 def can_load?(source_path) load_paths.any? { |load_path| source_path.start_with?(load_path) } end |
#load_paths ⇒ Object
21 22 23 |
# File 'lib/mutiny/configuration.rb', line 21 def load_paths loads.map(&File.method(:expand_path)) end |