rails_erb_credentials 1.0.1 → 1.0.2

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: 904a3b4da6fb78fd0345033613992f507da09cd1703b2f5c52728622ba9087fb
4
- data.tar.gz: f9efb59cc9a8311162c806d108ed969ee0328b1e0b14d371e8ec829eb657f589
3
+ metadata.gz: c638a785c0d89f710c5d1158f238678bd26a5fb92395e1f5e0b066f213a1de03
4
+ data.tar.gz: ac7e4f5481ddd97a771c3af91e39bfe81308a1ebd243c29fc7c4ad83dfdcc0d8
5
5
  SHA512:
6
- metadata.gz: f35254ee9b74e30f0169f2d8232fc6e579e369d3c288db4e9bff49c0ac8baf26a50af468173b82745ee99d904d434b25b8b378f4247e651c8d3ac3fafb2e8804
7
- data.tar.gz: 3fbf91da9cd08829e82d3c471356859f253e4440c511b21860d3ec2dda3549ffff9be515328cb3f9df7c5d2b039eeba892c10ccf23d873aa735ec2e41e3d6b2e
6
+ metadata.gz: 4de7be37d110681e9c5191f4a827e6c1c7cbb4eca0215aba9ab66c6a792a16e3090fb6353fb5882844a04b1c5b4043ddfed4bef6528b2e12cb9c25e6b129ea6b
7
+ data.tar.gz: 3820cebcca07720f9dd836b239ca093689671fecdc168f240c346184bff0b1985aa3e05c5500cceb4bf35cc28d99186a0b9ec5ff435a7cd9f8a9075e4fccd154
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.0.2] - 2024-10-05
4
+
5
+ - Added support for nested credentials
3
6
 
4
7
  ## [1.0.1] - 2024-10-05
5
8
 
@@ -11,16 +11,22 @@ module RailsErbCredentials
11
11
  def method_missing(method_name, *args, &block)
12
12
  if @original_credentials.respond_to?(method_name)
13
13
  value = @original_credentials.public_send(method_name, *args, &block)
14
- if value.is_a?(String) && value.include?("<%=")
15
- ERB.new(value).result(binding)
16
- else
17
- value
18
- end
14
+ evaluate_value(value)
19
15
  else
20
16
  super
21
17
  end
22
18
  end
23
19
 
20
+ def evaluate_value(value)
21
+ if value.is_a?(Hash)
22
+ value.transform_values { |v| evaluate_value(v) }
23
+ elsif value.is_a?(String) && value.include?("<%=")
24
+ ERB.new(value).result(binding)
25
+ else
26
+ value
27
+ end
28
+ end
29
+
24
30
  def respond_to_missing?(method_name, include_private = false)
25
31
  @original_credentials.respond_to?(method_name, include_private) || super
26
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsErbCredentials
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_erb_credentials
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nuzair46