anyway_config 2.8.0 → 2.8.1

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: 414ea061d65832bc84e8cd08504abbea04e356431f2e85210fb458780bc9623b
4
- data.tar.gz: 5ebbb3638e8ad4b870de6a8a8d3a35560a0cc4f0f13095da950e50aeb04dc928
3
+ metadata.gz: c2505731c8729ea6a097cef8718c441684124da047a6856bd6156b4592c1ad9b
4
+ data.tar.gz: d20b15281220f9c3d77b7440ffcf915db6b28e6c7555ecec5ac9e4583de34887
5
5
  SHA512:
6
- metadata.gz: 3a4c7e785d4a9153b64247c1b5730bf72c73ced33967a15359c5651f2da9390b8f3ad4baba2d226eb8e66e4084cc5871d69dbf9790b67c5aa8f795b2c0142f99
7
- data.tar.gz: b5a2e8c483fb9120f53439e90391f6b4ef9d605cd2531a91223a0a47e43e01912cf3da8e739054a1d2d12240aadd79dbf3e1558374ee5985c7a04d0f912c291e
6
+ metadata.gz: 70db78ae8a9859a4f660173101127d4e8d30c6a059f5b3cba121864be120a787a5998f740a948651f84c82cb22e87f7bce7926a4ad6b27352297dbc9f24d20b4
7
+ data.tar.gz: a314943f0a1fe0779235a75656d80cbf7a1525bbd6db24ab4fe15f508d4ac3c2790819a6d9abf39682c17c0bb0fadf4184976e9a9753dc3d61f594b910bd211a
data/CHANGELOG.md CHANGED
@@ -2,9 +2,15 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 2.8.1 (2026-07-22)
6
+
7
+ - Fix default loaders order to keep ENV the last one (=higher precedence). ([@palkan][])
8
+
9
+ - Guard against a missing `PATH` environment variable in `Anyway::Utils.which`. ([@SAY-5][])
10
+
5
11
  - Do not require optional loader dependencies to speed up loading. ([@ardecvz][])
6
12
 
7
- ## 2.8.0 (2025-06-24)
13
+ ## 2.8.0 (2026-06-24)
8
14
 
9
15
  - Add `configuration_sources` option to config classes to specify which data sources to use. ([@palkan][])
10
16
 
@@ -611,3 +617,4 @@ No we're dependency-free!
611
617
  [@dominikb]: https://github.com/dominikb
612
618
  [@klondaiker]: https://github.com/klondaiker
613
619
  [@ardecvz]: https://github.com/ardecvz
620
+ [@SAY-5]: https://github.com/SAY-5
@@ -92,7 +92,7 @@ module Anyway # :nodoc:
92
92
 
93
93
  unless (reserved_names = (new_keys & RESERVED_NAMES)).empty?
94
94
  raise ArgumentError, "Can not use the following reserved names as config attrubutes: " \
95
- "#{reserved_names.sort.map(&:to_s).join(", ")}"
95
+ "#{reserved_names.sort.join(", ")}"
96
96
  end
97
97
 
98
98
  config_attributes.push(*new_keys)
@@ -92,7 +92,7 @@ module Anyway # :nodoc:
92
92
 
93
93
  unless (reserved_names = (new_keys & RESERVED_NAMES)).empty?
94
94
  raise ArgumentError, "Can not use the following reserved names as config attrubutes: " \
95
- "#{reserved_names.sort.map(&:to_s).join(", ")}"
95
+ "#{reserved_names.sort.join(", ")}"
96
96
  end
97
97
 
98
98
  config_attributes.push(*new_keys)
@@ -92,7 +92,7 @@ module Anyway # :nodoc:
92
92
 
93
93
  unless (reserved_names = (new_keys & RESERVED_NAMES)).empty?
94
94
  raise ArgumentError, "Can not use the following reserved names as config attrubutes: " \
95
- "#{reserved_names.sort.map(&:to_s).join(", ")}"
95
+ "#{reserved_names.sort.join(", ")}"
96
96
  end
97
97
 
98
98
  config_attributes.push(*new_keys)
@@ -92,7 +92,7 @@ module Anyway # :nodoc:
92
92
 
93
93
  unless (reserved_names = (new_keys & RESERVED_NAMES)).empty?
94
94
  raise ArgumentError, "Can not use the following reserved names as config attrubutes: " \
95
- "#{reserved_names.sort.map(&:to_s).join(", ")}"
95
+ "#{reserved_names.sort.join(", ")}"
96
96
  end
97
97
 
98
98
  config_attributes.push(*new_keys)
data/lib/anyway/config.rb CHANGED
@@ -92,7 +92,7 @@ module Anyway # :nodoc:
92
92
 
93
93
  unless (reserved_names = (new_keys & RESERVED_NAMES)).empty?
94
94
  raise ArgumentError, "Can not use the following reserved names as config attrubutes: " \
95
- "#{reserved_names.sort.map(&:to_s).join(", ")}"
95
+ "#{reserved_names.sort.join(", ")}"
96
96
  end
97
97
 
98
98
  config_attributes.push(*new_keys)
@@ -65,10 +65,12 @@ module Anyway
65
65
  @autoload_via_zeitwerk = defined?(::Zeitwerk)
66
66
  end
67
67
 
68
+ alias_method :current_environment, :current_environment
68
69
  def current_environment
69
70
  @current_environment || ::Rails.env.to_s
70
71
  end
71
72
 
73
+ alias_method :app_root, :app_root
72
74
  def app_root
73
75
  ::Rails.root
74
76
  end
@@ -6,7 +6,8 @@ module Anyway
6
6
  # taken from https://stackoverflow.com/a/5471032
7
7
  def self.which(cmd)
8
8
  exts = ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : [""]
9
- ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
9
+ paths = ENV["PATH"]&.split(File::PATH_SEPARATOR) || []
10
+ paths.each do |path|
10
11
  exts.each do |ext|
11
12
  exe = File.join(path, "#{cmd}#{ext}")
12
13
  return exe if File.executable?(exe) && !File.directory?(exe)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Anyway # :nodoc:
4
- VERSION = "2.8.0"
4
+ VERSION = "2.8.1"
5
5
  end
data/lib/anyway_config.rb CHANGED
@@ -37,7 +37,6 @@ module Anyway # :nodoc:
37
37
 
38
38
  # Configure default loaders
39
39
  loaders.append :yml, Loaders::YAML
40
- loaders.append :env, Loaders::Env
41
40
 
42
41
  # Configure optional loaders
43
42
  if ENV["ANYWAY_CONFIG_DISABLE_EJSON"] != "true" && Utils.which("ejson")
@@ -46,6 +45,9 @@ module Anyway # :nodoc:
46
45
  if ENV["ANYWAY_CONFIG_DISABLE_DOPPLER"] != "true" && ENV.key?("DOPPLER_TOKEN")
47
46
  loaders.append :doppler, Loaders::Doppler
48
47
  end
48
+
49
+ # ENV must go last to take higher precedence
50
+ loaders.append :env, Loaders::Env
49
51
  end
50
52
 
51
53
  if defined?(::Rails::VERSION)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anyway_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-28 00:00:00.000000000 Z
11
+ date: 2026-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-next-core