mutant 0.13.4 → 0.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mutant/config.rb +25 -5
- data/lib/mutant/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 538aeb3b4a0e294ad4e9267116dc4cfc68f42fd195da8c6dcc7ba3eeaac9378f
|
|
4
|
+
data.tar.gz: a09a2c06315294c7c88f42e4002afc02f73bba76f6d7c04e04bc436e9f70b421
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 818bda670d95c84e55413051f04e0afbd47973b1edf1840126f2109df8979d7bb5be3a5d2d560dbfc50b875137c1d45826b6ba9228b939b51b5e56b7d5c5d6d2
|
|
7
|
+
data.tar.gz: 9ad79412af1baa590c8b88487b227d6235f15b399b8ea602ad75fc25abcdce252ea3a69766989937fa9915292396f252557a807cc7b23245ded8818c5b38007a
|
data/lib/mutant/config.rb
CHANGED
|
@@ -97,14 +97,34 @@ module Mutant
|
|
|
97
97
|
|
|
98
98
|
# Load the configuration
|
|
99
99
|
def self.load(cli_config:, world:)
|
|
100
|
-
load_config_file(reporter: cli_config.reporter, world:).
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
load_config_file(reporter: cli_config.reporter, world:).bind do |file_config|
|
|
101
|
+
load_env_config(world:).fmap do |env_config|
|
|
102
|
+
DEFAULT.with(
|
|
103
|
+
jobs: Etc.nprocessors,
|
|
104
|
+
mutation: Mutation::Config::DEFAULT
|
|
105
|
+
).merge(file_config).merge(env_config).merge(cli_config)
|
|
106
|
+
end
|
|
105
107
|
end
|
|
106
108
|
end
|
|
107
109
|
|
|
110
|
+
# Load configuration from environment variables
|
|
111
|
+
#
|
|
112
|
+
# @param [World] world
|
|
113
|
+
#
|
|
114
|
+
# @return [Either<String,Config>]
|
|
115
|
+
def self.load_env_config(world:)
|
|
116
|
+
jobs = world.environment_variables['MUTANT_JOBS']
|
|
117
|
+
|
|
118
|
+
if jobs
|
|
119
|
+
Either.wrap_error(ArgumentError) { Integer(jobs, 10) }
|
|
120
|
+
.lmap { |exception| "MUTANT_JOBS environment variable has invalid value: #{jobs.inspect} - #{exception}" }
|
|
121
|
+
.fmap { |jobs_value| DEFAULT.with(jobs: jobs_value) }
|
|
122
|
+
else
|
|
123
|
+
Either::Right.new(DEFAULT)
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
private_class_method :load_env_config
|
|
127
|
+
|
|
108
128
|
# Load config file
|
|
109
129
|
#
|
|
110
130
|
# @param [Env] env
|
data/lib/mutant/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mutant
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.13.
|
|
4
|
+
version: 0.13.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Markus Schirp
|
|
@@ -374,7 +374,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
374
374
|
- !ruby/object:Gem::Version
|
|
375
375
|
version: '0'
|
|
376
376
|
requirements: []
|
|
377
|
-
rubygems_version: 3.6.
|
|
377
|
+
rubygems_version: 3.6.9
|
|
378
378
|
specification_version: 4
|
|
379
379
|
summary: ''
|
|
380
380
|
test_files: []
|