activerecord-time 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +12 -4
- data/README.md +2 -0
- data/lib/activerecord-time/version.rb +1 -1
- data/lib/time_of_day.rb +1 -1
- data/test/time_of_day_test.rb +15 -3
- metadata +23 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ae9554b5154d27b89d69c1b24773eb9335be354
|
4
|
+
data.tar.gz: 42ec02e4d00f79d45b23770149b7fd7df583e980
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57819c0256a549da0c0f790efef7a83b69c628f24f1157733fe38026d50476bde7b30490b6fc9d818fb785883c9ddd1e70aad381cb981e1c25d3ec123ab30562
|
7
|
+
data.tar.gz: 2ecae0563de41830cc400adb4935a95309c6b233904286bf11dd1d51b3b0e80bf00ecb5d1a71e0af45f76b02bd0c689c3fed68db2f0fbb4706d8a7ed29fcf5d8
|
data/.travis.yml
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
language: ruby
|
2
2
|
sudo: false
|
3
3
|
rvm:
|
4
|
-
-
|
5
|
-
-
|
6
|
-
- jruby-9.0.1.0
|
4
|
+
- "2.3"
|
5
|
+
- jruby-9.1.0.0
|
7
6
|
- "2.2"
|
7
|
+
- jruby-9.0.5.0
|
8
8
|
- "2.1"
|
9
9
|
- "2.0.0"
|
10
|
-
- jruby-
|
10
|
+
- jruby-1.7.25
|
11
|
+
- ruby-head
|
12
|
+
- jruby-head
|
11
13
|
gemfile:
|
12
14
|
- gemfiles/ar42.gemfile
|
13
15
|
- gemfiles/ar41.gemfile
|
@@ -17,3 +19,9 @@ env:
|
|
17
19
|
- ADAPTER="postgresql"
|
18
20
|
- ADAPTER="derby"
|
19
21
|
- ADAPTER="sqlite3"
|
22
|
+
matrix:
|
23
|
+
allow_failures:
|
24
|
+
- rvm: ruby-head
|
25
|
+
gemfile: gemfiles/ar40.gemfile
|
26
|
+
- rvm: ruby-head
|
27
|
+
gemfile: gemfiles/ar32.gemfile
|
data/README.md
CHANGED
data/lib/time_of_day.rb
CHANGED
data/test/time_of_day_test.rb
CHANGED
@@ -54,6 +54,18 @@ class TimeOfDayTest < Minitest::Test
|
|
54
54
|
assert_equal 59, tod.second
|
55
55
|
end
|
56
56
|
|
57
|
+
def test_parse_immutable_string
|
58
|
+
tod = TimeOfDay.parse('10:01'.freeze)
|
59
|
+
assert_equal 10, tod.hour
|
60
|
+
assert_equal 1, tod.minute
|
61
|
+
assert_equal 0, tod.second
|
62
|
+
|
63
|
+
tod = TimeOfDay.parse('23:59:59'.freeze)
|
64
|
+
assert_equal 23, tod.hour
|
65
|
+
assert_equal 59, tod.minute
|
66
|
+
assert_equal 59, tod.second
|
67
|
+
end
|
68
|
+
|
57
69
|
def test_parse_full
|
58
70
|
assert_equal @twelve_o_clock, TimeOfDay.parse('12:00:00')
|
59
71
|
end
|
@@ -73,7 +85,7 @@ class TimeOfDayTest < Minitest::Test
|
|
73
85
|
|
74
86
|
def test_yaml_dump
|
75
87
|
string = YAML.dump({'start_at' => TimeOfDay.parse('12:34:56')})
|
76
|
-
assert_match
|
88
|
+
assert_match(/---\nstart_at: !!time '?12:34:56'?\n/, string)
|
77
89
|
end
|
78
90
|
|
79
91
|
def test_column_type
|
@@ -152,7 +164,7 @@ class TimeOfDayTest < Minitest::Test
|
|
152
164
|
def test_spaceship
|
153
165
|
tod1 = TimeOfDay.new(12, 0)
|
154
166
|
tod2 = TimeOfDay.new(13, 0)
|
155
|
-
assert_equal
|
167
|
+
assert_equal(-1, tod1 <=> tod2)
|
156
168
|
assert_equal 1, tod2 <=> tod1
|
157
169
|
assert_equal 0, tod1 <=> tod1
|
158
170
|
end
|
@@ -170,7 +182,7 @@ class TimeOfDayTest < Minitest::Test
|
|
170
182
|
|
171
183
|
def test_to_yaml
|
172
184
|
tod = TimeOfDay.new(12, 13, 14)
|
173
|
-
assert_match
|
185
|
+
assert_match(/--- !!time '?12:13:14'?\n/, tod.to_yaml)
|
174
186
|
end
|
175
187
|
|
176
188
|
def test_date_at
|
metadata
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Uwe Kubosch
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
+
name: activerecord
|
14
15
|
requirement: !ruby/object:Gem::Requirement
|
15
16
|
requirements:
|
16
17
|
- - ">="
|
@@ -19,9 +20,8 @@ dependencies:
|
|
19
20
|
- - "<"
|
20
21
|
- !ruby/object:Gem::Version
|
21
22
|
version: 5.0.0
|
22
|
-
name: activerecord
|
23
|
-
prerelease: false
|
24
23
|
type: :runtime
|
24
|
+
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
@@ -31,76 +31,77 @@ dependencies:
|
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 5.0.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
|
+
name: pg
|
34
35
|
requirement: !ruby/object:Gem::Requirement
|
35
36
|
requirements:
|
36
37
|
- - ">="
|
37
38
|
- !ruby/object:Gem::Version
|
38
39
|
version: '0'
|
39
|
-
name: activerecord-jdbcpostgresql-adapter
|
40
|
-
prerelease: false
|
41
40
|
type: :development
|
41
|
+
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
+
name: sqlite3
|
48
49
|
requirement: !ruby/object:Gem::Requirement
|
49
50
|
requirements:
|
50
51
|
- - ">="
|
51
52
|
- !ruby/object:Gem::Version
|
52
53
|
version: '0'
|
53
|
-
name: activerecord-jdbcsqlite3-adapter
|
54
|
-
prerelease: false
|
55
54
|
type: :development
|
55
|
+
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
|
+
name: minitest-reporters
|
62
63
|
requirement: !ruby/object:Gem::Requirement
|
63
64
|
requirements:
|
64
65
|
- - ">="
|
65
66
|
- !ruby/object:Gem::Version
|
66
67
|
version: '0'
|
67
|
-
name: minitest-reporters
|
68
|
-
prerelease: false
|
69
68
|
type: :development
|
69
|
+
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
|
+
name: rake
|
76
77
|
requirement: !ruby/object:Gem::Requirement
|
77
78
|
requirements:
|
78
79
|
- - ">="
|
79
80
|
- !ruby/object:Gem::Version
|
80
81
|
version: '0'
|
81
|
-
name: rake
|
82
|
-
prerelease: false
|
83
82
|
type: :development
|
83
|
+
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
|
+
name: simplecov
|
90
91
|
requirement: !ruby/object:Gem::Requirement
|
91
92
|
requirements:
|
92
93
|
- - ">="
|
93
94
|
- !ruby/object:Gem::Version
|
94
95
|
version: '0'
|
95
|
-
name: simplecov
|
96
|
-
prerelease: false
|
97
96
|
type: :development
|
97
|
+
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
|
-
description: A handler for storing TimeOfDay objects in ActiveRecord objects as sql
|
103
|
+
description: A handler for storing TimeOfDay objects in ActiveRecord objects as sql
|
104
|
+
time values.
|
104
105
|
email:
|
105
106
|
- uwe@kubosch.no
|
106
107
|
executables: []
|
@@ -138,7 +139,7 @@ homepage: https://github.com/donv/activerecord-time
|
|
138
139
|
licenses:
|
139
140
|
- MIT
|
140
141
|
metadata: {}
|
141
|
-
post_install_message:
|
142
|
+
post_install_message:
|
142
143
|
rdoc_options: []
|
143
144
|
require_paths:
|
144
145
|
- lib
|
@@ -153,11 +154,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
154
|
- !ruby/object:Gem::Version
|
154
155
|
version: '0'
|
155
156
|
requirements: []
|
156
|
-
rubyforge_project:
|
157
|
-
rubygems_version: 2.
|
158
|
-
signing_key:
|
157
|
+
rubyforge_project:
|
158
|
+
rubygems_version: 2.5.1
|
159
|
+
signing_key:
|
159
160
|
specification_version: 4
|
160
|
-
summary: A handler for storing TimeOfDay objects in ActiveRecord objects as sql time
|
161
|
+
summary: A handler for storing TimeOfDay objects in ActiveRecord objects as sql time
|
162
|
+
values.
|
161
163
|
test_files:
|
162
164
|
- test/database.yml
|
163
165
|
- test/schema.rb
|