anyway_config 2.4.1 → 2.4.2
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/CHANGELOG.md +6 -0
- data/README.md +4 -0
- data/lib/.rbnext/2.7/anyway/settings.rb +4 -1
- data/lib/anyway/rails/settings.rb +2 -1
- data/lib/anyway/settings.rb +4 -1
- data/lib/anyway/testing.rb +1 -1
- data/lib/anyway/version.rb +1 -1
- data/sig/manifest.yml +0 -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: 822e17fb52f85c3f3066322083d1d2d30265bb58fbce6f50e88590ebea140ba4
|
4
|
+
data.tar.gz: c3cfd97af9fe5de290b8a378517b3f11a7a020e550929c7e3765e34411988246
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fabe569de72f9a65d22a4a69a8b2b4cad0d97ef2dc62f245133352b142402ec2eb2b6f9492c713aceaac6518ca1453e1527855e6eaf5b4adb12ec0b2c2c1b50
|
7
|
+
data.tar.gz: 2fe2eef92329925f2626a501bd34c0081170e507f30214b9199710e509f208b0f3df7bfda163b304304e1fda58c8b4f757f527e748afd21708514877e4a1765c
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 2.4.2 (2023-06-07)
|
6
|
+
|
7
|
+
- Use ANYWAY_ENV as the current environment if defined. ([@palkan][])
|
8
|
+
|
9
|
+
It can be used to specify environment for configs independently of Rails environment.
|
10
|
+
|
5
11
|
## 2.4.1 (2023-05-04)
|
6
12
|
|
7
13
|
- Add custom namespace support via `ejson_namespace` ([@bessey])
|
data/README.md
CHANGED
@@ -367,6 +367,8 @@ development:
|
|
367
367
|
port: 3000
|
368
368
|
```
|
369
369
|
|
370
|
+
**NOTE:** You can override the environment name for configuration files via the `ANYWAY_ENV` environment variable or by setting it explicitly in the code: `Anyway::Settings.current_environment = "some_other_env"`.
|
371
|
+
|
370
372
|
### Multi-env configuration
|
371
373
|
|
372
374
|
_⚡️ This feature will be turned on by default in the future releases. You can turn it on now via `config.anyway_config.future.use :unwrap_known_environments`._
|
@@ -559,6 +561,8 @@ If you want to enable this feature you must specify `Anyway::Settings.current_en
|
|
559
561
|
Anyway::Settings.current_environment = "development"
|
560
562
|
```
|
561
563
|
|
564
|
+
You can also specify the `ANYWAY_ENV=development` environment variable to set the current environment for configuration.
|
565
|
+
|
562
566
|
YAML files should be in this format:
|
563
567
|
|
564
568
|
```yml
|
@@ -96,8 +96,11 @@ module Anyway
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
+
# By default, use ANYWAY_ENV
|
100
|
+
self.current_environment = ENV["ANYWAY_ENV"]
|
101
|
+
|
99
102
|
# By default, use local files only in development (that's the purpose if the local files)
|
100
|
-
self.use_local_files = (ENV["RACK_ENV"] == "development" || ENV["RAILS_ENV"] == "development")
|
103
|
+
self.use_local_files = (ENV["ANYWAY_ENV"] == "development" || ENV["RACK_ENV"] == "development" || ENV["RAILS_ENV"] == "development")
|
101
104
|
|
102
105
|
# By default, consider configs are stored in the ./config folder
|
103
106
|
self.default_config_path = ->(name) { "./config/#{name}.yml" }
|
@@ -66,7 +66,7 @@ module Anyway
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def current_environment
|
69
|
-
::Rails.env.to_s
|
69
|
+
@current_environment || ::Rails.env.to_s
|
70
70
|
end
|
71
71
|
|
72
72
|
def app_root
|
@@ -76,6 +76,7 @@ module Anyway
|
|
76
76
|
|
77
77
|
self.default_config_path = ->(name) { ::Rails.root.join("config", "#{name}.yml") }
|
78
78
|
self.known_environments = %w[test development production]
|
79
|
+
self.use_local_files ||= ::Rails.env.development?
|
79
80
|
# Don't try read defaults when no key defined
|
80
81
|
self.default_environmental_key = nil
|
81
82
|
end
|
data/lib/anyway/settings.rb
CHANGED
@@ -96,8 +96,11 @@ module Anyway
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
+
# By default, use ANYWAY_ENV
|
100
|
+
self.current_environment = ENV["ANYWAY_ENV"]
|
101
|
+
|
99
102
|
# By default, use local files only in development (that's the purpose if the local files)
|
100
|
-
self.use_local_files = (ENV["RACK_ENV"] == "development" || ENV["RAILS_ENV"] == "development")
|
103
|
+
self.use_local_files = (ENV["ANYWAY_ENV"] == "development" || ENV["RACK_ENV"] == "development" || ENV["RAILS_ENV"] == "development")
|
101
104
|
|
102
105
|
# By default, consider configs are stored in the ./config folder
|
103
106
|
self.default_config_path = ->(name) { "./config/#{name}.yml" }
|
data/lib/anyway/testing.rb
CHANGED
data/lib/anyway/version.rb
CHANGED
data/sig/manifest.yml
CHANGED
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.4.
|
4
|
+
version: 2.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-next-core
|