condition 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/condition.gemspec +1 -0
- data/lib/condition/param_item.rb +3 -0
- data/lib/condition/version.rb +1 -1
- data/spec/condition_spec.rb +5 -2
- data/spec/files/t_user.ods +0 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d0eaa8a5ffd881ac98550940bc72575e7784eeb
|
4
|
+
data.tar.gz: 26d1e51efde5623ba87d12ef69235b34109c1ea9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b07577a3d7e099e5093b9dabca8c628f6c16e086a0c769f30d77d233d3d28d8e80bfa5a4e5e4b4be0038f9ee4cf45e055ad505672120b44b77f9b889f368eaba
|
7
|
+
data.tar.gz: 22e28db9c161fe74ced6ce81cf87daf96109b54bc060ee2834ea3be95e994f02094603e8e7dbfbdb77ced4b2a24abfda044fcd4cb0d7bea24725344f1ea0766b
|
data/README.md
CHANGED
data/condition.gemspec
CHANGED
data/lib/condition/param_item.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
require 'time'
|
3
|
+
require 'json'
|
3
4
|
|
4
5
|
module Condition
|
5
6
|
class ParamItem
|
@@ -37,6 +38,8 @@ module Condition
|
|
37
38
|
count = ary.size > 1 ? ary[1].strip.to_i : nil
|
38
39
|
@refs << {index: index, key: key, name: ary[0].strip.to_sym, count: count}
|
39
40
|
item
|
41
|
+
elsif /^#JSON\((.+)\)$/ =~ item
|
42
|
+
JSON.parse($1, {:symbolize_names => true})
|
40
43
|
else
|
41
44
|
item
|
42
45
|
end
|
data/lib/condition/version.rb
CHANGED
data/spec/condition_spec.rb
CHANGED
@@ -26,10 +26,13 @@ describe Condition do
|
|
26
26
|
ds.call(item.value.merge(param.get('ins', 0)))
|
27
27
|
|
28
28
|
list = DB["SELECT * FROM t_user"].all
|
29
|
-
#p param.get('ary')
|
30
29
|
param.check('list', list)
|
31
30
|
param.check('list', [{user_id: 1, user_name: "aaax"}])
|
32
|
-
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'ref and json' do
|
34
|
+
param = Condition::Param.new(FILES + '/t_user.ods', 2)
|
35
|
+
param.check('ary', [{name: "a", val1: {a: "b"}, val2: [{a: {c: "d"}}], val3: [], val4: nil, val5: {a: [1, 2, 3]}}])
|
33
36
|
end
|
34
37
|
|
35
38
|
it 'unmatch' do
|
data/spec/files/t_user.ods
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aoyagikouhei
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: json
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: Condition Test
|
98
112
|
email:
|
99
113
|
- aoyagi.kouhei@gmail.com
|