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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/rails_erb_credentials/evaluated_credentials.rb +11 -5
- data/lib/rails_erb_credentials/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c638a785c0d89f710c5d1158f238678bd26a5fb92395e1f5e0b066f213a1de03
|
4
|
+
data.tar.gz: ac7e4f5481ddd97a771c3af91e39bfe81308a1ebd243c29fc7c4ad83dfdcc0d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4de7be37d110681e9c5191f4a827e6c1c7cbb4eca0215aba9ab66c6a792a16e3090fb6353fb5882844a04b1c5b4043ddfed4bef6528b2e12cb9c25e6b129ea6b
|
7
|
+
data.tar.gz: 3820cebcca07720f9dd836b239ca093689671fecdc168f240c346184bff0b1985aa3e05c5500cceb4bf35cc28d99186a0b9ec5ff435a7cd9f8a9075e4fccd154
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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
|