condition 0.0.17 → 0.0.18
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/README.md +3 -0
- data/lib/condition/param_item.rb +4 -0
- data/lib/condition/version.rb +1 -1
- data/spec/condition_spec.rb +9 -0
- data/spec/files/t_user.ods +0 -0
- 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: 4f6e6b63b389476aeff5e4d95247e0d5d35629ae
|
|
4
|
+
data.tar.gz: bc05b5b4eaa8c7c6962a686a39c185aa642185ce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91d70e0ac79e93af4d89617efdb6067623d384665e7a7f688095fa42344592258d3c888f480573d92e10b9885dac00d6b1c45431c0ae263b5131796c02760fd1
|
|
7
|
+
data.tar.gz: 57729586f297cb315949dfdcf672fe61031e2b0621e863624ca38abafbdb500a311e57b1675f16ecb00d05678db2522210c65b4ce2465f99f6f6fcc1e9e0e51b
|
data/README.md
CHANGED
data/lib/condition/param_item.rb
CHANGED
|
@@ -59,6 +59,8 @@ module Condition
|
|
|
59
59
|
$1.to_i
|
|
60
60
|
elsif /^#REGEXP\((.+)\)$/ =~ item
|
|
61
61
|
Regexp.new($1)
|
|
62
|
+
elsif /^#EVAL\((.+)\)$/ =~ item
|
|
63
|
+
eval($1)
|
|
62
64
|
else
|
|
63
65
|
item
|
|
64
66
|
end
|
|
@@ -139,6 +141,8 @@ module Condition
|
|
|
139
141
|
end
|
|
140
142
|
result
|
|
141
143
|
end
|
|
144
|
+
elsif Integer === expected
|
|
145
|
+
real.to_i == expected
|
|
142
146
|
else
|
|
143
147
|
real.to_s == expected
|
|
144
148
|
end
|
data/lib/condition/version.rb
CHANGED
data/spec/condition_spec.rb
CHANGED
|
@@ -109,4 +109,13 @@ describe Condition do
|
|
|
109
109
|
param = Condition::Param.new(FILES + '/t_user.ods', 5)
|
|
110
110
|
expect { param.post(storage) }.to raise_error
|
|
111
111
|
end
|
|
112
|
+
|
|
113
|
+
it 'eval' do
|
|
114
|
+
param = Condition::Param.new(FILES + '/t_user.ods', 2)
|
|
115
|
+
param.check('eval', [{
|
|
116
|
+
val1: Time.now.hour,
|
|
117
|
+
val2: "ab",
|
|
118
|
+
val3: 3,
|
|
119
|
+
}])
|
|
120
|
+
end
|
|
112
121
|
end
|
data/spec/files/t_user.ods
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: condition
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.18
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- aoyagikouhei
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-12-
|
|
11
|
+
date: 2013-12-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|