Class: Mutant::Env::Bootstrap Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Bootstrap environment

Constant Summary collapse

SEMANTICS_MESSAGE_FORMAT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

"%<message>s. Fix your lib to follow normal ruby semantics!\n" \
'{Module,Class}#name should return resolvable constant name as String or nil'.freeze
CLASS_NAME_RAISED_EXCEPTION =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'%<scope_class>s#name from: %<scope>s raised an error: %<exception>s'.freeze
CLASS_NAME_TYPE_MISMATCH_FORMAT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'%<scope_class>s#name from: %<scope>s returned %<name>s'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

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 object



34
35
36
37
38
39
40
# File 'lib/mutant/env/bootstrap.rb', line 34

def initialize(*)
  super
  @parser = Parser.new
  infect
  initialize_matchable_scopes
  @integration = config.integration.new(config).setup
end

Instance Attribute Details

#matchable_scopesEnumerable<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.

Scopes that are eligible for matching

Returns:



24
25
26
# File 'lib/mutant/env/bootstrap.rb', line 24

def matchable_scopes
  @matchable_scopes
end

#parserParser (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.

Parser for this environment

Returns:



29
30
31
# File 'lib/mutant/env/bootstrap.rb', line 29

def parser
  @parser
end

Instance Method Details

#envEnv

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.

Environment after bootstraping

rubocop:disable MethodLength

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/mutant/env/bootstrap.rb', line 57

def env
  subjects = matched_subjects
  Env.new(
    actor_env:        Actor::Env.new(Thread),
    config:           config,
    integration:      integration,
    matchable_scopes: matchable_scopes,
    mutations:        subjects.flat_map(&:mutations),
    parser:           parser,
    selector:         Selector::Expression.new(integration),
    subjects:         subjects
  )
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)


47
48
49
50
# File 'lib/mutant/env/bootstrap.rb', line 47

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