var_block 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/var_block/getvar_handlers.rb +6 -6
- data/lib/var_block/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e4402003ba6ed9894c5c346f3dac996e8b0a52c1
|
|
4
|
+
data.tar.gz: e1f48bd2618296ba9392180cbd0cdd6b6d6c4568
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f23bea2ab3859970eaa3669d961a75634a4f569fe22eace63c785f76037a41add32d381b0a8644f45518fe970182a1720798f0d1a837dbb06ae16db598da1dcb
|
|
7
|
+
data.tar.gz: 7dacd9c7c46940e469e55e0fdff1d602cffc3a449f43847d18462a90df1f5461019d45589795183e37591d6bf8217e380f16186aef5bb0038f5c537f042386fa
|
|
@@ -29,7 +29,7 @@ module VarBlock
|
|
|
29
29
|
|
|
30
30
|
def handle(value, context, options)
|
|
31
31
|
if options.any?
|
|
32
|
-
return handle_options(value, options)
|
|
32
|
+
return handle_options(value, context, options)
|
|
33
33
|
|
|
34
34
|
# else, if no options, defaults to return as a wrapped Array
|
|
35
35
|
else
|
|
@@ -49,20 +49,20 @@ module VarBlock
|
|
|
49
49
|
|
|
50
50
|
private
|
|
51
51
|
|
|
52
|
-
def handle_options(value, options)
|
|
52
|
+
def handle_options(value, context, options)
|
|
53
53
|
options.each do |option|
|
|
54
54
|
case option
|
|
55
55
|
|
|
56
56
|
when :truthy?
|
|
57
|
-
return handle_option_truthy(value)
|
|
57
|
+
return handle_option_truthy(value, context)
|
|
58
58
|
|
|
59
59
|
when :any?
|
|
60
|
-
return handle_option_any(value)
|
|
60
|
+
return handle_option_any(value, context)
|
|
61
61
|
end
|
|
62
62
|
end
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
-
def handle_option_truthy(values)
|
|
65
|
+
def handle_option_truthy(values, context)
|
|
66
66
|
is_truthy = true
|
|
67
67
|
|
|
68
68
|
values.each do |value|
|
|
@@ -78,7 +78,7 @@ module VarBlock
|
|
|
78
78
|
return is_truthy
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
-
def handle_option_any(values)
|
|
81
|
+
def handle_option_any(values, context)
|
|
82
82
|
values.each do |value|
|
|
83
83
|
if value.is_a? Proc
|
|
84
84
|
evaluated_value = ProcHandler.handle(value, context)
|
data/lib/var_block/version.rb
CHANGED