shimmer 0.0.40 → 0.0.41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shimmer/utils/config.rb +10 -2
- data/lib/shimmer/version.rb +1 -1
- metadata +2 -3
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3314020b6aa5d270ed5edccb0a3a2d8b6ac3e856121a4fd26485086a4d66cc3e
|
4
|
+
data.tar.gz: 8f1dbd12ed39cd5825804e69c215dd1158c60a475f19fc29658a93178e1d7bb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18a0dc8afa5db10b8ce897c5909c45abbdfac9c99fcd7d1221b9ec95827de8dfad76eb28eecde04e38a711df999e7ec81258f786101dadededff6aecb298d2f5
|
7
|
+
data.tar.gz: f46b20077102d040374c08ed4870ad100dbd7efa1db2aadc69d2abe85218b0e5c67b35ab3ce390c623c6579615737fdee99e1ce80db50779ea746859319d4b11
|
data/lib/shimmer/utils/config.rb
CHANGED
@@ -17,8 +17,9 @@ module Shimmer
|
|
17
17
|
key = method_name.delete_suffix("!").delete_suffix("?").to_sym
|
18
18
|
required = method_name.end_with?("!")
|
19
19
|
type = :bool if method_name.end_with?("?")
|
20
|
-
value =
|
21
|
-
value ||=
|
20
|
+
value = @stubbed_values&.dig(key)
|
21
|
+
value ||= ENV[key.to_s.upcase].presence
|
22
|
+
value ||= credentials.dig(ENV["CONFIG_ENV"]&.to_sym || Rails.env.to_sym, key)
|
22
23
|
value ||= credentials[key]
|
23
24
|
value = default_value if value.nil?
|
24
25
|
raise MissingConfigError, "#{key.upcase} environment value is missing" if required && value.blank?
|
@@ -30,6 +31,13 @@ module Shimmer
|
|
30
31
|
true
|
31
32
|
end
|
32
33
|
|
34
|
+
def stub(**values)
|
35
|
+
@stubbed_values = values.to_h.deep_transform_keys(&:to_sym)
|
36
|
+
yield
|
37
|
+
ensure
|
38
|
+
@stubbed_values = nil
|
39
|
+
end
|
40
|
+
|
33
41
|
private
|
34
42
|
|
35
43
|
def coerce(value, type)
|
data/lib/shimmer/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shimmer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.41
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Ravens
|
@@ -25,7 +25,6 @@ files:
|
|
25
25
|
- ".prettierrc"
|
26
26
|
- ".rspec"
|
27
27
|
- ".rubocop.yml"
|
28
|
-
- ".ruby-version"
|
29
28
|
- ".solargraph.yml"
|
30
29
|
- ".vscode/settings.json"
|
31
30
|
- CHANGELOG.md
|
@@ -136,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
135
|
- !ruby/object:Gem::Version
|
137
136
|
version: '0'
|
138
137
|
requirements: []
|
139
|
-
rubygems_version: 3.
|
138
|
+
rubygems_version: 3.5.16
|
140
139
|
signing_key:
|
141
140
|
specification_version: 4
|
142
141
|
summary: Shimmer brings all the bells and whistles of a hotwired application, right
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
3.1.6
|