Class: Mutant::Env::Bootstrap
- Inherits:
-
Object
- Object
- Mutant::Env::Bootstrap
- Includes:
- Adamantium::Flat
- Defined in:
- lib/mutant/env/bootstrap.rb
Overview
Boostrap environment
Constant Summary collapse
- SEMANTICS_MESSAGE_FORMAT =
"%<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 =
'%<scope_class>s#name from: %<scope>s raised an error: %<exception>s'.freeze
- CLASS_NAME_TYPE_MISMATCH_FORMAT =
'%<scope_class>s#name from: %<scope>s returned %<name>s'.freeze
Instance Attribute Summary collapse
-
#matchable_scopes ⇒ Enumerable<Matcher::Scope>
readonly
private
Scopes that are eligible for matching.
Class Method Summary collapse
-
.new(_config, _cache = Cache.new) ⇒ Env
private
New bootstrap env.
Instance Method Summary collapse
-
#env ⇒ Env
private
Environment after bootstraping.
-
#initialize ⇒ Object
constructor
private
Initialize object.
-
#warn(message) ⇒ self
private
Print warning message.
Constructor Details
#initialize ⇒ Object
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
40 41 42 43 44 |
# File 'lib/mutant/env/bootstrap.rb', line 40 def initialize(*) super infect initialize_matchable_scopes end |
Instance Attribute Details
#matchable_scopes ⇒ Enumerable<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
24 25 26 |
# File 'lib/mutant/env/bootstrap.rb', line 24 def matchable_scopes @matchable_scopes 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.
New bootstrap env
31 32 33 |
# File 'lib/mutant/env/bootstrap.rb', line 31 def self.new(_config, _cache = Cache.new) super end |
Instance Method Details
#env ⇒ 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.
Environment after bootstraping
rubocop:disable MethodLength
65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/mutant/env/bootstrap.rb', line 65 def env subjects = matched_subjects Env.new( actor_env: Actor::Env.new(Thread), config: config, cache: cache, subjects: subjects, matchable_scopes: matchable_scopes, integration: @integration, selector: Selector::Expression.new(@integration), mutations: subjects.flat_map(&:mutations) ) 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
53 54 55 56 |
# File 'lib/mutant/env/bootstrap.rb', line 53 def warn() config.reporter.warn() self end |