Class: Mutiny::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/mutiny/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#analyserObject (readonly)

Returns the value of attribute analyser.



11
12
13
# File 'lib/mutiny/configuration.rb', line 11

def analyser
  @analyser
end

#integrationObject (readonly)

Returns the value of attribute integration.



11
12
13
# File 'lib/mutiny/configuration.rb', line 11

def integration
  @integration
end

#loadsObject (readonly)

Returns the value of attribute loads.



10
11
12
# File 'lib/mutiny/configuration.rb', line 10

def loads
  @loads
end

#mutant_storageObject (readonly)

Returns the value of attribute mutant_storage.



11
12
13
# File 'lib/mutiny/configuration.rb', line 11

def mutant_storage
  @mutant_storage
end

#mutatorObject (readonly)

Returns the value of attribute mutator.



11
12
13
# File 'lib/mutiny/configuration.rb', line 11

def mutator
  @mutator
end

#patternsObject (readonly)

Returns the value of attribute patterns.



10
11
12
# File 'lib/mutiny/configuration.rb', line 10

def patterns
  @patterns
end

#reporterObject (readonly)

Returns the value of attribute reporter.



11
12
13
# File 'lib/mutiny/configuration.rb', line 11

def reporter
  @reporter
end

#requiresObject (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

Returns:

  • (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_pathsObject



26
27
28
# File 'lib/mutiny/configuration.rb', line 26

def load_paths
  loads.map(&File.method(:expand_path))
end