Class: Mutant::Env

Inherits:
Object
  • Object
show all
Includes:
Adamantium
Defined in:
lib/mutant/env.rb

Overview

Abstract base class for mutant environments

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeundefined

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 env



24
25
26
27
28
29
30
# File 'lib/mutant/env.rb', line 24

def initialize(*)
  super

  infect
  initialize_matchable_scopes
  initialize_subjects
end

Instance Attribute Details

#matchable_scopesArray<Matcher::Scope> (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 all usable match scopes

Returns:



69
70
71
# File 'lib/mutant/env.rb', line 69

def matchable_scopes
  @matchable_scopes
end

#subjectsArray<Subject> (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 subjects

Returns:



61
62
63
# File 'lib/mutant/env.rb', line 61

def subjects
  @subjects
end

Class Method Details

.new(config, cache = Cache.new) ⇒ Env

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 new env

Parameters:

Returns:



14
15
16
# File 'lib/mutant/env.rb', line 14

def self.new(config, cache = Cache.new)
  super(config, cache)
end

Instance Method Details

#runReport

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 mutant producing a report on configured env

Returns:

  • (Report)


38
39
40
# File 'lib/mutant/env.rb', line 38

def run
  Runner.call(self)
end

#warn(message) ⇒ self

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.

Print warning message

Parameters:

  • (String)

Returns:

  • (self)


50
51
52
53
# File 'lib/mutant/env.rb', line 50

def warn(message)
  config.reporter.warn(message)
  self
end