kafo 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of kafo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/kafo/param.rb +14 -2
- data/lib/kafo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50b4317c6753f887ed5f82958ccddb7c7231b0c6
|
4
|
+
data.tar.gz: 80e53f9fc0c40a7898beb5cd1df07e4f2159d2bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d6874b159789e97761e7ac8cb1f86595a5d167d23cd1720f582914dea450408fb37c3c03269451f5ce38723e3e1d4b88abbd5cdedda284600d8976bfc0fd434
|
7
|
+
data.tar.gz: 6c9fb42c37dd21084cd32a0895eb3b284a918acbe8d37727d64953b928fbf511e7ffd23803d9b6e13310f5dbf28a44518ddbeebcd17cefa0d7a74aa33a739d97
|
data/lib/kafo/param.rb
CHANGED
@@ -45,13 +45,25 @@ class Param
|
|
45
45
|
# also we want to clone validations so we don't interfere
|
46
46
|
validations.map! do |v|
|
47
47
|
v = v.clone
|
48
|
-
|
48
|
+
if v.name == 'validate_re'
|
49
|
+
# validate_re does not take more variables as arguments, instead we need to pass all arguments
|
50
|
+
args = v.arguments
|
51
|
+
else
|
52
|
+
args = v.arguments.select { |a| a.to_s == "$#{self.name}" }
|
53
|
+
end
|
49
54
|
v.arguments = Puppet::Parser::AST::ASTArray.new :children => args
|
50
55
|
v
|
51
56
|
end
|
52
57
|
|
53
58
|
validator = Validator.new([self])
|
54
|
-
validations.map
|
59
|
+
validations.map! do |v|
|
60
|
+
result = v.evaluate(validator)
|
61
|
+
# validate_re returns nil if succeeds
|
62
|
+
result = true if v.name == 'validate_re' && result.nil?
|
63
|
+
result
|
64
|
+
end
|
65
|
+
|
66
|
+
validations.all?
|
55
67
|
end
|
56
68
|
|
57
69
|
# To be overwritten in children
|
data/lib/kafo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kafo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marek Hulan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|