rails_erb_credentials 1.0.0 → 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: 578afbd530644f4208763a33b08f988333c50911d7e69cd81f69f3a337d5fcf2
4
- data.tar.gz: 8281af297110a2aa1967c30ebb3dc3f3736bf937d28876cbd177ba9fac62db04
3
+ metadata.gz: c638a785c0d89f710c5d1158f238678bd26a5fb92395e1f5e0b066f213a1de03
4
+ data.tar.gz: ac7e4f5481ddd97a771c3af91e39bfe81308a1ebd243c29fc7c4ad83dfdcc0d8
5
5
  SHA512:
6
- metadata.gz: d0c581b1cabf3d632acc0c50bf3f12df892cad24f510f34053c56a2d4e3de277aa0ff05609e66478d9e40a0e6cb34839c696ff7a7f5d0407a508a969aa7abb6d
7
- data.tar.gz: b73ca5c66d8b5cd899f3e3c56e94ecbb80a3bfd94a11adc98e2b1c6ed5c78287059007c38a1b56d198537f59fb5785a86178172ab51c27f63caafdd4b5ac5832
6
+ metadata.gz: 4de7be37d110681e9c5191f4a827e6c1c7cbb4eca0215aba9ab66c6a792a16e3090fb6353fb5882844a04b1c5b4043ddfed4bef6528b2e12cb9c25e6b129ea6b
7
+ data.tar.gz: 3820cebcca07720f9dd836b239ca093689671fecdc168f240c346184bff0b1985aa3e05c5500cceb4bf35cc28d99186a0b9ec5ff435a7cd9f8a9075e4fccd154
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.0.2] - 2024-10-05
4
+
5
+ - Added support for nested credentials
6
+
7
+ ## [1.0.1] - 2024-10-05
8
+
9
+ - Fixed a major bug that prevented the credentials from being evaluated
10
+
3
11
  ## [1.0.0] - 2024-10-05
4
12
 
5
13
  - Initial release
@@ -9,8 +9,18 @@ module RailsErbCredentials
9
9
  end
10
10
 
11
11
  def method_missing(method_name, *args, &block)
12
- value = @original_credentials.public_send(method_name)
13
- if value.is_a?(String) && value.include?("<%=")
12
+ if @original_credentials.respond_to?(method_name)
13
+ value = @original_credentials.public_send(method_name, *args, &block)
14
+ evaluate_value(value)
15
+ else
16
+ super
17
+ end
18
+ end
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?("<%=")
14
24
  ERB.new(value).result(binding)
15
25
  else
16
26
  value
@@ -18,7 +28,7 @@ module RailsErbCredentials
18
28
  end
19
29
 
20
30
  def respond_to_missing?(method_name, include_private = false)
21
- @original_credentials.respond_to?(method_name) || super
31
+ @original_credentials.respond_to?(method_name, include_private) || super
22
32
  end
23
33
  end
24
34
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsErbCredentials
4
- VERSION = "1.0.0"
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.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nuzair46