condition 0.0.23 → 0.0.24

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: 6cad7ee79b223ee79d74b13beeb86b2150bb64cb
4
- data.tar.gz: 442b388404b070bd2c1fdf208ee4485f18a2cc60
3
+ metadata.gz: f0873720de10377eb9430e59c174227923848a9f
4
+ data.tar.gz: f3c850d201e4136536c2be145b1bf1b349287092
5
5
  SHA512:
6
- metadata.gz: 02e4b7028a5862dba7afb7136f9ccb3b53712081053a913eb5c6ebff22c00dfdd8c9c85980cfc079924a26596c1f593f3d381382160decd60b81c75e68217575
7
- data.tar.gz: 232dcc50345ce8c2a0e0ef3d49adb03dc04e8e42725e27b8830256ea5814cc57fbb6cd9bb05f432c506b1a8819c25ec3812236624c27b3b7d890f12e81569591
6
+ metadata.gz: 75ebd5305230b36772686de80db2560407b9093cdef8c4b65f48670a94d7004aa991d9d153d8bae1b4f369293498d3764c24a25fea3cedb5b5fc28c6312c851f
7
+ data.tar.gz: 6d298975bf3d9645e0802b6af2cac8fa9c2be0c7819ac5458c989eb146a63dcb5ad5bca2c33fd9ecac5e64c885bde4915e45dae7321c1d5635186a77785ad0a1
data/README.md CHANGED
@@ -30,6 +30,9 @@ TODO: Write usage instructions here
30
30
 
31
31
  ## Changes
32
32
 
33
+ 2014-01-08 0.0.24
34
+ add now() and now(diff seconds)
35
+
33
36
  2013-12-25 0.0.23
34
37
  support sequel pg_array
35
38
 
@@ -46,6 +46,10 @@ module Condition
46
46
  false
47
47
  elsif '#EMPTY' == item
48
48
  ''
49
+ elsif '#NOW' == item
50
+ Time.now
51
+ elsif /^#NOW\((.+)\)$/ =~ item
52
+ Time.now + ($1.to_i)
49
53
  elsif /^#REF\((.+)\)$/ =~ item
50
54
  ary = $1.split(/,/)
51
55
  count = ary.size > 1 ? ary[1].strip.to_i : nil
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
2
 
3
3
  module Condition
4
- VERSION = "0.0.23"
4
+ VERSION = "0.0.24"
5
5
  end
@@ -62,6 +62,15 @@ describe Condition do
62
62
  lambda{param.check('present', [{val1: nil}])}.should raise_error
63
63
  end
64
64
 
65
+ it 'now' do
66
+ param = Condition::Param.new(FILES + '/t_user.ods', 2)
67
+ t = Time.now
68
+ t2 = Time.now - 24 * 3600
69
+ val = param.get('now')
70
+ expect(val[0][:val1].strftime("%Y%m%d")).to eq(t.strftime("%Y%m%d"))
71
+ expect(val[0][:val2].strftime("%Y%m%d")).to eq(t2.strftime("%Y%m%d"))
72
+ end
73
+
65
74
  it 'regex' do
66
75
  param = Condition::Param.new(FILES + '/t_user.ods', 2)
67
76
  param.check('regex', [{val1: "abbbbbc"}])
Binary file
metadata CHANGED
@@ -1,153 +1,153 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: condition
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
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-25 00:00:00.000000000 Z
11
+ date: 2014-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pg
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sequel
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: mongo
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: bson_ext
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: redis
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: roo
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: json
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - '>='
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - '>='
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  description: Condition Test
@@ -157,7 +157,7 @@ executables: []
157
157
  extensions: []
158
158
  extra_rdoc_files: []
159
159
  files:
160
- - .gitignore
160
+ - ".gitignore"
161
161
  - Gemfile
162
162
  - LICENSE.txt
163
163
  - README.md
@@ -188,17 +188,17 @@ require_paths:
188
188
  - lib
189
189
  required_ruby_version: !ruby/object:Gem::Requirement
190
190
  requirements:
191
- - - '>='
191
+ - - ">="
192
192
  - !ruby/object:Gem::Version
193
193
  version: '0'
194
194
  required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  requirements:
196
- - - '>='
196
+ - - ">="
197
197
  - !ruby/object:Gem::Version
198
198
  version: '0'
199
199
  requirements: []
200
200
  rubyforge_project:
201
- rubygems_version: 2.1.11
201
+ rubygems_version: 2.2.0
202
202
  signing_key:
203
203
  specification_version: 4
204
204
  summary: Condition Test