Class: Mutiny::Configuration
- Inherits:
-
Object
- Object
- Mutiny::Configuration
- Defined in:
- lib/mutiny/configuration.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#loads ⇒ Object
readonly
Returns the value of attribute loads.
-
#mutants ⇒ Object
readonly
Returns the value of attribute mutants.
-
#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.
-
#tests ⇒ Object
readonly
Returns the value of attribute tests.
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.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/mutiny/configuration.rb', line 12 def initialize(loads: [], requires: [], patterns: []) @loads = loads @requires = requires @patterns = patterns @patterns.map!(&Pattern.method(:new)) @reporter = Reporter::Stdout.new @mutants = Mutants.new @tests = Tests.new end |
Instance Attribute Details
#loads ⇒ Object (readonly)
Returns the value of attribute loads.
10 11 12 |
# File 'lib/mutiny/configuration.rb', line 10 def loads @loads end |
#mutants ⇒ Object (readonly)
Returns the value of attribute mutants.
10 11 12 |
# File 'lib/mutiny/configuration.rb', line 10 def mutants @mutants 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.
10 11 12 |
# File 'lib/mutiny/configuration.rb', line 10 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 |
#tests ⇒ Object (readonly)
Returns the value of attribute tests.
10 11 12 |
# File 'lib/mutiny/configuration.rb', line 10 def tests @tests end |
Instance Method Details
#can_load?(source_path) ⇒ Boolean
27 28 29 |
# File 'lib/mutiny/configuration.rb', line 27 def can_load?(source_path) load_paths.any? { |load_path| source_path.start_with?(load_path) } end |
#load_paths ⇒ Object
23 24 25 |
# File 'lib/mutiny/configuration.rb', line 23 def load_paths loads.map(&File.method(:expand_path)) end |