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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20018aa500c31e9d750a4ea9d905acacf9e64874
4
- data.tar.gz: 7bf7c6fbe619bab599c31dcf15587346f9e22d2f
3
+ metadata.gz: 6d0eaa8a5ffd881ac98550940bc72575e7784eeb
4
+ data.tar.gz: 26d1e51efde5623ba87d12ef69235b34109c1ea9
5
5
  SHA512:
6
- metadata.gz: b6412b0c8180271e8d5abfd02f8a82a285c745a27cacdc1d0808ba355865bf4e09a31348a90a635eb47191a6bb71671bbccc7c11d68b27f555cafdf4ad8e30d3
7
- data.tar.gz: 8e81f9192aefb66a6af4bdec4ee32ad75a1d67ea9daff558035a9b24e0561870e541fb813e42ded714648909d867c9665c999ec9539c95a22ffbc3c19efd8cf4
6
+ metadata.gz: b07577a3d7e099e5093b9dabca8c628f6c16e086a0c769f30d77d233d3d28d8e80bfa5a4e5e4b4be0038f9ee4cf45e055ad505672120b44b77f9b889f368eaba
7
+ data.tar.gz: 22e28db9c161fe74ced6ce81cf87daf96109b54bc060ee2834ea3be95e994f02094603e8e7dbfbdb77ced4b2a24abfda044fcd4cb0d7bea24725344f1ea0766b
data/README.md CHANGED
@@ -30,6 +30,9 @@ TODO: Write usage instructions here
30
30
 
31
31
  ## Changes
32
32
 
33
+ 2013-04-18 0.0.8
34
+ add json
35
+
33
36
  2013-04-18 0.0.7
34
37
  delete json
35
38
  add ref param_item
data/condition.gemspec CHANGED
@@ -24,4 +24,5 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "pg"
25
25
  spec.add_dependency "roo"
26
26
  spec.add_dependency "sequel"
27
+ spec.add_dependency "json"
27
28
  end
@@ -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
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
2
 
3
3
  module Condition
4
- VERSION = "0.0.7"
4
+ VERSION = "0.0.8"
5
5
  end
@@ -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
- param.check('ary', [{name: "a", val1: {a: "b"}, val2: [{a: {c: "d"}}], val3: [], val4: nil}])
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
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.7
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