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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75662c8a4062a633ec556db2c2365e27202e9087227166cbd790daa6ff72c8b3
4
- data.tar.gz: 82a4648bc701a56dda880e9a758c08f9d4e53196e59f9c1976e364674ecb9099
3
+ metadata.gz: 538aeb3b4a0e294ad4e9267116dc4cfc68f42fd195da8c6dcc7ba3eeaac9378f
4
+ data.tar.gz: a09a2c06315294c7c88f42e4002afc02f73bba76f6d7c04e04bc436e9f70b421
5
5
  SHA512:
6
- metadata.gz: 68108911058155f67b9a0c44c1e04a5e361eb9057442a0b1d8447438330995abe6fb66e48c81d622b09e198cc0b8a4500233af9a20d2548b042c6231a1a95223
7
- data.tar.gz: b5c7b0d525407dcaeac02cd31e56a5e9d14ecc77def1711dfb115a5ed03163c204407cebbbcbda640c28024764c71c720745dffd224179477dc714d6603dabe3
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:).fmap do |file_config|
101
- DEFAULT.with(
102
- jobs: Etc.nprocessors,
103
- mutation: Mutation::Config::DEFAULT
104
- ).merge(file_config.merge(cli_config))
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mutant
4
4
  # Current mutant version
5
- VERSION = '0.13.4'
5
+ VERSION = '0.13.5'
6
6
  end # Mutant
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
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.7
377
+ rubygems_version: 3.6.9
378
378
  specification_version: 4
379
379
  summary: ''
380
380
  test_files: []