dm-zone-types 0.1.3 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -18
- data/Gemfile.lock +54 -115
- data/README.textile +2 -2
- data/Rakefile +0 -3
- data/lib/dm-zone-types.rb +0 -2
- data/test/dm-zone-types/test_zoned_time.rb +12 -0
- metadata +51 -85
- data/.gitignore +0 -3
- data/Tumbler +0 -6
- data/dm-zone-types.gemspec +0 -25
- data/lib/dm-zone-types/version.rb +0 -8
- data/specs.watchr +0 -37
data/Gemfile
CHANGED
@@ -1,19 +1,2 @@
|
|
1
1
|
source :rubygems
|
2
|
-
|
3
|
-
gem 'dm-core'
|
4
|
-
gem 'activesupport', '>=3.0.0.beta3'
|
5
|
-
gem 'tzinfo'
|
6
|
-
gem 'ruby-debug'
|
7
|
-
|
8
|
-
group :development do
|
9
|
-
gem "tumbler", ">= 0"
|
10
|
-
gem 'nanotest'
|
11
|
-
gem 'nanotest_extensions'
|
12
|
-
gem 'watchr'
|
13
|
-
gem 'rake'
|
14
|
-
gem 'dm-sqlite-adapter'
|
15
|
-
gem 'dm-migrations'
|
16
|
-
gem 'i18n'
|
17
|
-
gem 'dm-validations'
|
18
|
-
end
|
19
|
-
|
2
|
+
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,115 +1,54 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
dm-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
specs:
|
56
|
-
- rake:
|
57
|
-
version: 0.8.7
|
58
|
-
- activesupport:
|
59
|
-
version: 3.0.0.beta4
|
60
|
-
- addressable:
|
61
|
-
version: 2.1.2
|
62
|
-
- blockenspiel:
|
63
|
-
version: 0.4.1
|
64
|
-
- bundler:
|
65
|
-
version: 0.9.26
|
66
|
-
- callsite:
|
67
|
-
version: 0.0.2
|
68
|
-
- columnize:
|
69
|
-
version: 0.3.1
|
70
|
-
- data_objects:
|
71
|
-
version: 0.10.2
|
72
|
-
- extlib:
|
73
|
-
version: 0.9.15
|
74
|
-
- dm-core:
|
75
|
-
version: 1.0.0
|
76
|
-
- dm-do-adapter:
|
77
|
-
version: 1.0.0
|
78
|
-
- dm-migrations:
|
79
|
-
version: 1.0.0
|
80
|
-
- do_sqlite3:
|
81
|
-
version: 0.10.2
|
82
|
-
- dm-sqlite-adapter:
|
83
|
-
version: 1.0.0
|
84
|
-
- dm-validations:
|
85
|
-
version: 1.0.0
|
86
|
-
- i18n:
|
87
|
-
version: 0.4.1
|
88
|
-
- json:
|
89
|
-
version: 1.4.3
|
90
|
-
- linecache:
|
91
|
-
version: "0.43"
|
92
|
-
- nanotest:
|
93
|
-
version: 0.9.4.1
|
94
|
-
- nanotest_extensions:
|
95
|
-
version: 0.6.3
|
96
|
-
- rainbow:
|
97
|
-
version: "1.1"
|
98
|
-
- ruby-debug-base:
|
99
|
-
version: 0.10.3
|
100
|
-
- ruby-debug:
|
101
|
-
version: 0.10.3
|
102
|
-
- thor:
|
103
|
-
version: 0.13.7
|
104
|
-
- versionomy:
|
105
|
-
version: 0.4.0
|
106
|
-
- tumbler:
|
107
|
-
version: 0.0.16
|
108
|
-
- tzinfo:
|
109
|
-
version: 0.3.22
|
110
|
-
- watchr:
|
111
|
-
version: "0.6"
|
112
|
-
hash: 0b6c03727c1a61fac9b2854abc49cfc189b6c3bc
|
113
|
-
sources:
|
114
|
-
- Rubygems:
|
115
|
-
uri: http://gemcutter.org
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
dm-zone-types (0.2)
|
5
|
+
activesupport (>= 3.0.0.beta3)
|
6
|
+
dm-core
|
7
|
+
tzinfo
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: http://rubygems.org/
|
11
|
+
specs:
|
12
|
+
activesupport (3.0.1)
|
13
|
+
addressable (2.2.2)
|
14
|
+
data_objects (0.10.2)
|
15
|
+
addressable (~> 2.1)
|
16
|
+
dm-core (1.0.2)
|
17
|
+
addressable (~> 2.2)
|
18
|
+
extlib (~> 0.9.15)
|
19
|
+
dm-do-adapter (1.0.2)
|
20
|
+
data_objects (~> 0.10.2)
|
21
|
+
dm-core (~> 1.0.2)
|
22
|
+
dm-migrations (1.0.2)
|
23
|
+
dm-core (~> 1.0.2)
|
24
|
+
dm-sqlite-adapter (1.0.2)
|
25
|
+
dm-do-adapter (~> 1.0.2)
|
26
|
+
do_sqlite3 (~> 0.10.2)
|
27
|
+
dm-validations (1.0.2)
|
28
|
+
dm-core (~> 1.0.2)
|
29
|
+
do_sqlite3 (0.10.2)
|
30
|
+
data_objects (= 0.10.2)
|
31
|
+
extlib (0.9.15)
|
32
|
+
i18n (0.4.2)
|
33
|
+
nanotest (0.9.4.1)
|
34
|
+
nanotest_extensions (0.6.3)
|
35
|
+
rake (0.8.7)
|
36
|
+
tzinfo (0.3.23)
|
37
|
+
watchr (0.7)
|
38
|
+
|
39
|
+
PLATFORMS
|
40
|
+
ruby
|
41
|
+
|
42
|
+
DEPENDENCIES
|
43
|
+
activesupport (>= 3.0.0.beta3)
|
44
|
+
dm-core
|
45
|
+
dm-migrations
|
46
|
+
dm-sqlite-adapter
|
47
|
+
dm-validations
|
48
|
+
dm-zone-types!
|
49
|
+
i18n
|
50
|
+
nanotest
|
51
|
+
nanotest_extensions
|
52
|
+
rake
|
53
|
+
tzinfo
|
54
|
+
watchr
|
data/README.textile
CHANGED
@@ -4,11 +4,11 @@ Provides time zone aware data types for data mapper.
|
|
4
4
|
|
5
5
|
Whenver the property is set, it will be typecast to the Time.zone set in active support and be stored in the database as the timezone set in DataMapper::Zone::Types.storage_zone
|
6
6
|
|
7
|
-
|
7
|
+
h2. Installation
|
8
8
|
|
9
9
|
<pre><code>gem install dm-zone-types</code></pre>
|
10
10
|
|
11
|
-
|
11
|
+
h2. Usage
|
12
12
|
|
13
13
|
<pre><code>
|
14
14
|
require 'dm-zone-types'
|
data/Rakefile
CHANGED
data/lib/dm-zone-types.rb
CHANGED
@@ -95,6 +95,18 @@ context do
|
|
95
95
|
results = SpecModel.all(:zoned_time => ((t - 2.days)..t))
|
96
96
|
results.size.must == 3
|
97
97
|
end
|
98
|
+
|
99
|
+
# Allow searching between dates
|
100
|
+
test do
|
101
|
+
t2 = Date.today
|
102
|
+
t1 = t2 - 3
|
103
|
+
[0,1,2,3,4,5].each do |d|
|
104
|
+
SpecModel.create(:zoned_time => (t2 - d.days))
|
105
|
+
end
|
106
|
+
|
107
|
+
results = SpecModel.all(:zoned_time => (t1..t2))
|
108
|
+
results.size.must == 4
|
109
|
+
end
|
98
110
|
end
|
99
111
|
end # tz's
|
100
112
|
end # saved_tz's
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-zone-types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
- 1
|
9
8
|
- 3
|
10
|
-
version: 0.
|
9
|
+
version: "0.3"
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Daniel Neighman
|
@@ -15,11 +14,13 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-11-08 00:00:00 +11:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
|
-
|
21
|
+
name: dm-core
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
24
|
none: false
|
24
25
|
requirements:
|
25
26
|
- - ">="
|
@@ -28,12 +29,12 @@ dependencies:
|
|
28
29
|
segments:
|
29
30
|
- 0
|
30
31
|
version: "0"
|
31
|
-
requirement: *id001
|
32
|
-
name: dm-core
|
33
|
-
prerelease: false
|
34
32
|
type: :runtime
|
33
|
+
version_requirements: *id001
|
35
34
|
- !ruby/object:Gem::Dependency
|
36
|
-
|
35
|
+
name: activesupport
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
37
38
|
none: false
|
38
39
|
requirements:
|
39
40
|
- - ">="
|
@@ -45,26 +46,12 @@ dependencies:
|
|
45
46
|
- 0
|
46
47
|
- beta3
|
47
48
|
version: 3.0.0.beta3
|
48
|
-
requirement: *id002
|
49
|
-
name: activesupport
|
50
|
-
prerelease: false
|
51
49
|
type: :runtime
|
50
|
+
version_requirements: *id002
|
52
51
|
- !ruby/object:Gem::Dependency
|
53
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
54
|
-
none: false
|
55
|
-
requirements:
|
56
|
-
- - ">="
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
hash: 3
|
59
|
-
segments:
|
60
|
-
- 0
|
61
|
-
version: "0"
|
62
|
-
requirement: *id003
|
63
52
|
name: tzinfo
|
64
53
|
prerelease: false
|
65
|
-
|
66
|
-
- !ruby/object:Gem::Dependency
|
67
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
68
55
|
none: false
|
69
56
|
requirements:
|
70
57
|
- - ">="
|
@@ -73,26 +60,12 @@ dependencies:
|
|
73
60
|
segments:
|
74
61
|
- 0
|
75
62
|
version: "0"
|
76
|
-
requirement: *id004
|
77
|
-
name: ruby-debug
|
78
|
-
prerelease: false
|
79
63
|
type: :runtime
|
64
|
+
version_requirements: *id003
|
80
65
|
- !ruby/object:Gem::Dependency
|
81
|
-
|
82
|
-
none: false
|
83
|
-
requirements:
|
84
|
-
- - ">="
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
hash: 3
|
87
|
-
segments:
|
88
|
-
- 0
|
89
|
-
version: "0"
|
90
|
-
requirement: *id005
|
91
|
-
name: tumbler
|
66
|
+
name: nanotest
|
92
67
|
prerelease: false
|
93
|
-
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
version_requirements: &id006 !ruby/object:Gem::Requirement
|
68
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
96
69
|
none: false
|
97
70
|
requirements:
|
98
71
|
- - ">="
|
@@ -101,12 +74,12 @@ dependencies:
|
|
101
74
|
segments:
|
102
75
|
- 0
|
103
76
|
version: "0"
|
104
|
-
requirement: *id006
|
105
|
-
name: nanotest
|
106
|
-
prerelease: false
|
107
77
|
type: :development
|
78
|
+
version_requirements: *id004
|
108
79
|
- !ruby/object:Gem::Dependency
|
109
|
-
|
80
|
+
name: nanotest_extensions
|
81
|
+
prerelease: false
|
82
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
110
83
|
none: false
|
111
84
|
requirements:
|
112
85
|
- - ">="
|
@@ -115,12 +88,12 @@ dependencies:
|
|
115
88
|
segments:
|
116
89
|
- 0
|
117
90
|
version: "0"
|
118
|
-
requirement: *id007
|
119
|
-
name: nanotest_extensions
|
120
|
-
prerelease: false
|
121
91
|
type: :development
|
92
|
+
version_requirements: *id005
|
122
93
|
- !ruby/object:Gem::Dependency
|
123
|
-
|
94
|
+
name: watchr
|
95
|
+
prerelease: false
|
96
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
124
97
|
none: false
|
125
98
|
requirements:
|
126
99
|
- - ">="
|
@@ -129,12 +102,12 @@ dependencies:
|
|
129
102
|
segments:
|
130
103
|
- 0
|
131
104
|
version: "0"
|
132
|
-
requirement: *id008
|
133
|
-
name: watchr
|
134
|
-
prerelease: false
|
135
105
|
type: :development
|
106
|
+
version_requirements: *id006
|
136
107
|
- !ruby/object:Gem::Dependency
|
137
|
-
|
108
|
+
name: rake
|
109
|
+
prerelease: false
|
110
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
138
111
|
none: false
|
139
112
|
requirements:
|
140
113
|
- - ">="
|
@@ -143,12 +116,12 @@ dependencies:
|
|
143
116
|
segments:
|
144
117
|
- 0
|
145
118
|
version: "0"
|
146
|
-
requirement: *id009
|
147
|
-
name: rake
|
148
|
-
prerelease: false
|
149
119
|
type: :development
|
120
|
+
version_requirements: *id007
|
150
121
|
- !ruby/object:Gem::Dependency
|
151
|
-
|
122
|
+
name: dm-sqlite-adapter
|
123
|
+
prerelease: false
|
124
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
152
125
|
none: false
|
153
126
|
requirements:
|
154
127
|
- - ">="
|
@@ -157,12 +130,12 @@ dependencies:
|
|
157
130
|
segments:
|
158
131
|
- 0
|
159
132
|
version: "0"
|
160
|
-
requirement: *id010
|
161
|
-
name: dm-sqlite-adapter
|
162
|
-
prerelease: false
|
163
133
|
type: :development
|
134
|
+
version_requirements: *id008
|
164
135
|
- !ruby/object:Gem::Dependency
|
165
|
-
|
136
|
+
name: dm-migrations
|
137
|
+
prerelease: false
|
138
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
166
139
|
none: false
|
167
140
|
requirements:
|
168
141
|
- - ">="
|
@@ -171,12 +144,12 @@ dependencies:
|
|
171
144
|
segments:
|
172
145
|
- 0
|
173
146
|
version: "0"
|
174
|
-
requirement: *id011
|
175
|
-
name: dm-migrations
|
176
|
-
prerelease: false
|
177
147
|
type: :development
|
148
|
+
version_requirements: *id009
|
178
149
|
- !ruby/object:Gem::Dependency
|
179
|
-
|
150
|
+
name: i18n
|
151
|
+
prerelease: false
|
152
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
180
153
|
none: false
|
181
154
|
requirements:
|
182
155
|
- - ">="
|
@@ -185,12 +158,12 @@ dependencies:
|
|
185
158
|
segments:
|
186
159
|
- 0
|
187
160
|
version: "0"
|
188
|
-
requirement: *id012
|
189
|
-
name: i18n
|
190
|
-
prerelease: false
|
191
161
|
type: :development
|
162
|
+
version_requirements: *id010
|
192
163
|
- !ruby/object:Gem::Dependency
|
193
|
-
|
164
|
+
name: dm-validations
|
165
|
+
prerelease: false
|
166
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
194
167
|
none: false
|
195
168
|
requirements:
|
196
169
|
- - ">="
|
@@ -199,10 +172,8 @@ dependencies:
|
|
199
172
|
segments:
|
200
173
|
- 0
|
201
174
|
version: "0"
|
202
|
-
requirement: *id013
|
203
|
-
name: dm-validations
|
204
|
-
prerelease: false
|
205
175
|
type: :development
|
176
|
+
version_requirements: *id011
|
206
177
|
description: Timezone aware datatypes for DataMapper
|
207
178
|
email: has.sox@gmail.com
|
208
179
|
executables: []
|
@@ -212,21 +183,16 @@ extensions: []
|
|
212
183
|
extra_rdoc_files: []
|
213
184
|
|
214
185
|
files:
|
215
|
-
- .
|
216
|
-
-
|
186
|
+
- test/dm-zone-types/test_zoned_time.rb
|
187
|
+
- test/test_dm-zone-types.rb
|
188
|
+
- test/test_helper.rb
|
189
|
+
- lib/dm-zone-types/zoned_time.rb
|
190
|
+
- lib/dm-zone-types.rb
|
217
191
|
- Gemfile
|
218
192
|
- Gemfile.lock
|
219
193
|
- README.textile
|
194
|
+
- CHANGELOG
|
220
195
|
- Rakefile
|
221
|
-
- Tumbler
|
222
|
-
- dm-zone-types.gemspec
|
223
|
-
- lib/dm-zone-types.rb
|
224
|
-
- lib/dm-zone-types/version.rb
|
225
|
-
- lib/dm-zone-types/zoned_time.rb
|
226
|
-
- specs.watchr
|
227
|
-
- test/dm-zone-types/test_zoned_time.rb
|
228
|
-
- test/test_dm-zone-types.rb
|
229
|
-
- test/test_helper.rb
|
230
196
|
has_rdoc: true
|
231
197
|
homepage: http://github.com/hassox/dm-zone-types
|
232
198
|
licenses: []
|
@@ -256,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
222
|
version: "0"
|
257
223
|
requirements: []
|
258
224
|
|
259
|
-
rubyforge_project:
|
225
|
+
rubyforge_project:
|
260
226
|
rubygems_version: 1.3.7
|
261
227
|
signing_key:
|
262
228
|
specification_version: 3
|
data/.gitignore
DELETED
data/Tumbler
DELETED
data/dm-zone-types.gemspec
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
require 'tumbler'
|
4
|
-
tumbler = Tumbler::GemspecHelper.new
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = tumbler.name
|
8
|
-
s.version = tumbler.version
|
9
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
10
|
-
s.rubyforge_project = tumbler.name
|
11
|
-
s.authors = ["Daniel Neighman"]
|
12
|
-
s.date = tumbler.date
|
13
|
-
s.description = %q{Timezone aware datatypes for DataMapper}
|
14
|
-
s.email = "has.sox@gmail.com"
|
15
|
-
s.files = tumbler.files
|
16
|
-
s.homepage = %q{http://github.com/hassox/dm-zone-types}
|
17
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
18
|
-
s.require_paths = ["lib"]
|
19
|
-
s.rubygems_version = %q{1.3.7}
|
20
|
-
s.summary = %q{Timezone aware datatypes for DataMapper}
|
21
|
-
s.test_files = tumbler.files(/^test/)
|
22
|
-
|
23
|
-
# dependencies
|
24
|
-
tumbler.inject_dependencies(s)
|
25
|
-
end
|
data/specs.watchr
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# Run me with:
|
2
|
-
#
|
3
|
-
# $ watchr specs.watchr
|
4
|
-
|
5
|
-
# --------------------------------------------------
|
6
|
-
# Helpers
|
7
|
-
# --------------------------------------------------
|
8
|
-
def run(cmd)
|
9
|
-
puts(cmd)
|
10
|
-
system(cmd)
|
11
|
-
end
|
12
|
-
|
13
|
-
def run_all_tests
|
14
|
-
# see Rakefile for the definition of the test:all task
|
15
|
-
system( "rake -s test:all VERBOSE=true" )
|
16
|
-
end
|
17
|
-
|
18
|
-
# --------------------------------------------------
|
19
|
-
# Watchr Rules
|
20
|
-
# --------------------------------------------------
|
21
|
-
watch( '^test.*/test_.*\.rb' ) { |m| run( "ruby -rubygems -Ilib %s" % m[0] ) }
|
22
|
-
watch( '^lib/phocus\.rb' ) { |m| run( "ruby -rubygems -Ilib test/test_phocus.rb" ) }
|
23
|
-
watch( '^lib/phocus/autodetect\.rb' ) { run_all_tests }
|
24
|
-
watch( '^test/test_helper\.rb' ) { run_all_tests }
|
25
|
-
|
26
|
-
# --------------------------------------------------
|
27
|
-
# Signal Handling
|
28
|
-
# --------------------------------------------------
|
29
|
-
# Ctrl-\
|
30
|
-
Signal.trap('QUIT') do
|
31
|
-
puts " --- Running all tests ---\n\n"
|
32
|
-
run_all_tests
|
33
|
-
end
|
34
|
-
|
35
|
-
# Ctrl-C
|
36
|
-
Signal.trap('INT') { abort("\n") }
|
37
|
-
|