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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c660ebf970ed4d07d0cb2c17f663c26d957f5e3c
4
- data.tar.gz: 80508516454670dc5eb73a1e5c9db3f945519226
3
+ metadata.gz: 4f6e6b63b389476aeff5e4d95247e0d5d35629ae
4
+ data.tar.gz: bc05b5b4eaa8c7c6962a686a39c185aa642185ce
5
5
  SHA512:
6
- metadata.gz: 038592f544ab29b35d7edba60c2e22fce16d18e78cf2474f13a5b637707b5f5467b612a84b2492b3847c02b48f84a0bab8c98efd2eeae537c1b0c6c260f6ecd8
7
- data.tar.gz: 8f3cbbb7c9b4e66203b81a5fbdddf232ebe2a072cc91ba3381cec166f1071804ec26344554d6a18badce332107dd620d35a1e37828937f815092d78123b00c33
6
+ metadata.gz: 91d70e0ac79e93af4d89617efdb6067623d384665e7a7f688095fa42344592258d3c888f480573d92e10b9885dac00d6b1c45431c0ae263b5131796c02760fd1
7
+ data.tar.gz: 57729586f297cb315949dfdcf672fe61031e2b0621e863624ca38abafbdb500a311e57b1675f16ecb00d05678db2522210c65b4ce2465f99f6f6fcc1e9e0e51b
data/README.md CHANGED
@@ -30,6 +30,9 @@ TODO: Write usage instructions here
30
30
 
31
31
  ## Changes
32
32
 
33
+ 2013-12-12 0.0.18
34
+ add eval check
35
+
33
36
  2013-12-11 0.0.17
34
37
  add redis reader
35
38
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
2
 
3
3
  module Condition
4
- VERSION = "0.0.17"
4
+ VERSION = "0.0.18"
5
5
  end
@@ -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
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.17
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-10 00:00:00.000000000 Z
11
+ date: 2013-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler