snfoil-controller 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/snfoil/controller/version.rb +1 -1
- data/lib/snfoil/deserializer/json.rb +13 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30037f7a35419e8de1da92218600be13dc1100f66038cd9c8e01a44bcea66581
|
4
|
+
data.tar.gz: 3a89ea36f71ec450eb20d37eed391fec23d7f836b13ad0226d2e2cc413358a4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 102c59b528fe811eab77dfaa69d5061a37227575f2608a4cdbbb6949da59d646313265aec275c1cfe4ba80d68222554213438b25eac60c0e19254673bfa03750
|
7
|
+
data.tar.gz: 528df87e07ee5a48a61466c8d9dce0dca57af18fb9c128a381a3e5afe943fc887d56c231d123b599961448fba2fcf58233f1c1b0a929e080177f47b8a0dd536c
|
@@ -46,7 +46,19 @@ module SnFoil
|
|
46
46
|
|
47
47
|
def apply_transforms(output, input)
|
48
48
|
(self.class.snfoil_attribute_transforms || {}).reduce(output) do |transformed_output, transform|
|
49
|
-
|
49
|
+
transform_options = transform[1]
|
50
|
+
next transformed_output if transform_options[:if] && !check_conditional(transform_options[:if], input)
|
51
|
+
next transformed_output if transform_options[:unless] && check_conditional(transform_options[:unless], input)
|
52
|
+
|
53
|
+
apply_transform(transformed_output, input, transform[0], **transform_options)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def check_conditional(conditional, input)
|
58
|
+
if conditional.is_a? Symbol
|
59
|
+
send(conditional, input)
|
60
|
+
else
|
61
|
+
instance_exec(input, &conditional)
|
50
62
|
end
|
51
63
|
end
|
52
64
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snfoil-controller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Howes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-03-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|