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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5506a51bba0e3b7bd2e1890b492495dd81e6b022ac80ad89f3742554a8af1cfa
4
- data.tar.gz: 27306ea6f76d995b790f0285fc3e4810b3ffc85819438f464073ce3bb037ca48
3
+ metadata.gz: 3314020b6aa5d270ed5edccb0a3a2d8b6ac3e856121a4fd26485086a4d66cc3e
4
+ data.tar.gz: 8f1dbd12ed39cd5825804e69c215dd1158c60a475f19fc29658a93178e1d7bb4
5
5
  SHA512:
6
- metadata.gz: 171daf856ef54a34063e037118e506cc4bd7e5577170e643d69e410fdea7b322e944d9122a60ab82a8992587f7f2a565d1f5a492349026547d8c570d08139bfe
7
- data.tar.gz: 0461e40d0a5847ad8ff5aeb28fb43e8c504a573363a8c5e50595d4bfd28e44d1c29085bd0167858f0e3131f1ac1dac9afc63aaf18325014f3b84d1c4a964cfe6
6
+ metadata.gz: 18a0dc8afa5db10b8ce897c5909c45abbdfac9c99fcd7d1221b9ec95827de8dfad76eb28eecde04e38a711df999e7ec81258f786101dadededff6aecb298d2f5
7
+ data.tar.gz: f46b20077102d040374c08ed4870ad100dbd7efa1db2aadc69d2abe85218b0e5c67b35ab3ce390c623c6579615737fdee99e1ce80db50779ea746859319d4b11
@@ -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 = ENV[key.to_s.upcase].presence
21
- value ||= credentials.dig(Rails.env.to_sym, key)
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shimmer
4
- VERSION = "0.0.40"
4
+ VERSION = "0.0.41"
5
5
  end
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.40
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.3.27
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