time_jawn 2.0.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/time_jawn.rb +3 -1
- data/lib/time_jawn/time_jawn.rb +8 -6
- data/lib/time_jawn/time_jawn_private_class_methods.rb +5 -3
- data/spec/time_jawn_spec.rb +170 -98
- metadata +41 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5d8c7496ddfb91d9d85cfa71c2c3f0a3408617e2f4ff2dfe8e18746f945ca80b
|
4
|
+
data.tar.gz: a7ea361497ed0e978e5f6ba2f3f1963efbee45a170a31f7cd7df4578d0b5bb06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e86cf6f6cbb61d3ab3c91862c20ed069e2cd58c5e742799efa4ba14cf1074f9cbd59565da73568e0ea6faf8e0ef93c0b886b5802b60a07070e1494dea21534e
|
7
|
+
data.tar.gz: 97cd52322dca4ea025d6e9bc23f9409bfabcf6ebc68bfc0279269d1e4aea0adfacede5f8a74285f20569b23d42dea889f724e7e2b7277e0a58c1c62d4f89d329
|
data/lib/time_jawn.rb
CHANGED
data/lib/time_jawn/time_jawn.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# The base module of the TimeJawn gem. Everything in here assumes that your
|
2
4
|
# model has a valid time zone in a attribute name time_zone or has been
|
3
5
|
# delegating one to somewhere else.
|
@@ -26,19 +28,19 @@ module TimeJawn
|
|
26
28
|
# class Event<ActiveRecord::Base
|
27
29
|
# has_time_zone named: :this_is_my_time_zone
|
28
30
|
# end
|
29
|
-
def has_time_zone(options_hash={})
|
31
|
+
def has_time_zone(options_hash = {})
|
30
32
|
set_instance_variables(options_hash)
|
31
33
|
send(:include, InstanceMethods)
|
32
34
|
end
|
33
35
|
end
|
34
36
|
|
35
|
-
#Defines methods that will be added to instances of classes that have
|
37
|
+
# Defines methods that will be added to instances of classes that have
|
36
38
|
# previously called has_time_zone.
|
37
39
|
module InstanceMethods
|
38
40
|
# This method generates a series of methods on instances by calling the
|
39
41
|
# enerate_to_local and generate_to_local_with_assignment that are private on
|
40
42
|
# the parent class. The methods that are created are called
|
41
|
-
# local_#{
|
43
|
+
# local_#{attribute} and local_#{attribute}= the attribute portion their
|
42
44
|
# names are completed by enumerating the datetime_attributes of the class.
|
43
45
|
# Twice as many methods as there are DateTime attributes will be created.
|
44
46
|
#
|
@@ -49,7 +51,7 @@ module TimeJawn
|
|
49
51
|
# local_created_at=
|
50
52
|
# local_updated_at=
|
51
53
|
#
|
52
|
-
# The local_#{
|
54
|
+
# The local_#{attribute} methods will take the value stored in the attribute
|
53
55
|
# indicated by the methods name and apply a time zone conversion to it. This
|
54
56
|
# is useful for displaying the local time (according to the object).
|
55
57
|
#
|
@@ -93,14 +95,14 @@ module TimeJawn
|
|
93
95
|
# converts a time object into it's local counter part (they will have the
|
94
96
|
# same value but differnt presentation.)
|
95
97
|
def to_local(time)
|
96
|
-
time.in_time_zone(
|
98
|
+
time.in_time_zone(send(self.class.time_zone_attribute_name))
|
97
99
|
end
|
98
100
|
|
99
101
|
# Given a string that looks like a time. It will convert that string into a
|
100
102
|
# time object that matches the time but with the instances time zone
|
101
103
|
# appended.
|
102
104
|
def add_zone(time_string)
|
103
|
-
Time.zone =
|
105
|
+
Time.zone = send(self.class.time_zone_attribute_name)
|
104
106
|
Time.zone.parse(Time.parse(time_string).strftime(DATE_FORMAT))
|
105
107
|
end
|
106
108
|
|
@@ -1,14 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Defines private methods necessary for TimeJawn to work.
|
2
4
|
module TimeJawnPrivateClassMethods
|
3
|
-
|
4
5
|
private
|
5
6
|
|
6
7
|
# Locates all of an ActiveRecord class' DateTime Attributes and returns them
|
7
8
|
# as an array of symbols.
|
8
9
|
def datetime_attributes
|
9
10
|
name.constantize.columns.map do |column|
|
10
|
-
|
11
|
-
|
11
|
+
next unless column.type == :datetime
|
12
|
+
|
13
|
+
column.name.to_sym
|
12
14
|
end.compact
|
13
15
|
end
|
14
16
|
|
data/spec/time_jawn_spec.rb
CHANGED
@@ -1,54 +1,77 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Happening do
|
4
|
-
before(:each)
|
6
|
+
before(:each) do
|
5
7
|
@happening1 =
|
6
8
|
Happening.new(
|
7
|
-
start_time: DateTime.new+6725.years+3.months+1.minute,
|
9
|
+
start_time: DateTime.new + 6725.years + 3.months + 1.minute,
|
8
10
|
time_zone: 'Eastern Time (US & Canada)',
|
9
|
-
name:'Eastern Time (US & Canada)',
|
10
|
-
updated_at: DateTime.new+6725.years+1.minute,
|
11
|
-
created_at: DateTime.new+6725.years+1.minute
|
11
|
+
name: 'Eastern Time (US & Canada)',
|
12
|
+
updated_at: DateTime.new + 6725.years + 1.minute,
|
13
|
+
created_at: DateTime.new + 6725.years + 1.minute
|
12
14
|
)
|
13
15
|
|
14
16
|
@happening2 =
|
15
17
|
Happening.new(
|
16
|
-
start_time: DateTime.new+6725.years+3.months,
|
17
|
-
time_zone: 'Pacific/Honolulu', name:'Pacific/Honolulu',
|
18
|
-
updated_at: DateTime.new+6725.years,
|
19
|
-
created_at: DateTime.new+6725.years
|
18
|
+
start_time: DateTime.new + 6725.years + 3.months,
|
19
|
+
time_zone: 'Pacific/Honolulu', name: 'Pacific/Honolulu',
|
20
|
+
updated_at: DateTime.new + 6725.years,
|
21
|
+
created_at: DateTime.new + 6725.years
|
20
22
|
)
|
21
23
|
|
22
24
|
Time.zone = 'UTC'
|
23
|
-
|
25
|
+
end
|
24
26
|
|
25
27
|
context 'class method' do
|
26
|
-
describe
|
27
|
-
it
|
28
|
-
expect(Happening.instance_methods.include?
|
29
|
-
|
30
|
-
|
31
|
-
expect(Happening.instance_methods.include?
|
32
|
-
|
33
|
-
expect(Happening.instance_methods.include? :local_updated_at=).to eq false
|
34
|
-
end
|
35
|
-
it "has instance methods once called " do
|
28
|
+
describe 'has_time_zone' do
|
29
|
+
it 'does not have instance methods until called' do
|
30
|
+
expect(Happening.instance_methods.include?(:local_start_time))
|
31
|
+
.to eq false
|
32
|
+
|
33
|
+
expect(Happening.instance_methods.include?(:local_created_at))
|
34
|
+
.to eq false
|
36
35
|
|
36
|
+
expect(Happening.instance_methods.include?(:local_updated_at))
|
37
|
+
.to eq false
|
38
|
+
|
39
|
+
expect(Happening.instance_methods.include?(:local_start_time=))
|
40
|
+
.to eq false
|
41
|
+
|
42
|
+
expect(Happening.instance_methods.include?(:local_updated_at=))
|
43
|
+
.to eq false
|
44
|
+
|
45
|
+
expect(Happening.instance_methods.include?(:local_updated_at=))
|
46
|
+
.to eq false
|
47
|
+
end
|
48
|
+
it 'has instance methods once called ' do
|
37
49
|
Happening.has_time_zone
|
38
50
|
|
39
|
-
expect(Happening.instance_methods.include?
|
40
|
-
|
41
|
-
|
42
|
-
expect(Happening.instance_methods.include?
|
43
|
-
|
44
|
-
|
51
|
+
expect(Happening.instance_methods.include?(:local_start_time))
|
52
|
+
.to eq true
|
53
|
+
|
54
|
+
expect(Happening.instance_methods.include?(:local_created_at))
|
55
|
+
.to eq true
|
56
|
+
|
57
|
+
expect(Happening.instance_methods.include?(:local_updated_at))
|
58
|
+
.to eq true
|
59
|
+
|
60
|
+
expect(Happening.instance_methods.include?(:local_start_time=))
|
61
|
+
.to eq true
|
62
|
+
|
63
|
+
expect(Happening.instance_methods.include?(:local_created_at=))
|
64
|
+
.to eq true
|
65
|
+
|
66
|
+
expect(Happening.instance_methods.include?(:local_updated_at=))
|
67
|
+
.to eq true
|
45
68
|
end
|
46
69
|
end
|
47
70
|
end
|
48
71
|
|
49
72
|
context 'static instance methods' do
|
50
|
-
describe
|
51
|
-
it
|
73
|
+
describe 'current_time' do
|
74
|
+
it 'returns a time with zone object reflecting the current local time of the instance' do
|
52
75
|
Timecop.freeze
|
53
76
|
expect(DateTime.current).to eq @happening1.current_time
|
54
77
|
Timecop.return
|
@@ -57,110 +80,159 @@ describe Happening do
|
|
57
80
|
end
|
58
81
|
|
59
82
|
context 'dynamic instance methods' do
|
60
|
-
describe
|
83
|
+
describe 'local_start_time' do
|
61
84
|
it "returns a time with zone object that reflects the value of start_time altered to the instance's time zone" do
|
62
|
-
expect(@happening1.start_time)
|
63
|
-
|
85
|
+
expect(@happening1.start_time)
|
86
|
+
.to eq 'Mon, 01 Apr 2013 00:01:00 UTC +00:00'
|
87
|
+
|
88
|
+
expect(@happening1.start_time)
|
89
|
+
.to eq 'Sun, 31 Mar 2013 20:01:00 EDT -04:00'
|
90
|
+
|
64
91
|
Time.zone = 'Eastern Time (US & Canada)'
|
65
|
-
expect(@happening1.local_start_time.to_s).to eq "2013-03-31 20:01:00 -0400"
|
66
92
|
|
67
|
-
expect(@
|
68
|
-
|
93
|
+
expect(@happening1.local_start_time.to_s)
|
94
|
+
.to eq '2013-03-31 20:01:00 -0400'
|
95
|
+
|
96
|
+
expect(@happening2.start_time)
|
97
|
+
.to eq 'Mon, 01 Apr 2013 00:00:00 UTC +00:00'
|
98
|
+
|
99
|
+
expect(@happening2.start_time)
|
100
|
+
.to eq 'Sun, 31 Mar 2013 14:00:00 HST -10:00'
|
101
|
+
|
69
102
|
Time.zone = 'Pacific/Honolulu'
|
70
|
-
|
103
|
+
|
104
|
+
expect(@happening2.local_start_time.to_s)
|
105
|
+
.to eq '2013-03-31 14:00:00 -1000'
|
71
106
|
end
|
72
107
|
end
|
73
108
|
|
74
|
-
describe
|
109
|
+
describe 'local_updated_at' do
|
75
110
|
it "returns a time with zone object that reflects the value of updated_at at altered to the instance's time zone" do
|
76
|
-
expect(@happening1.updated_at)
|
77
|
-
|
111
|
+
expect(@happening1.updated_at)
|
112
|
+
.to eq 'Tue, 01 Jan 2013 00:01:00 UTC +0000'
|
113
|
+
|
114
|
+
expect(@happening1.updated_at)
|
115
|
+
.to eq 'Wed, 31 Dec 2012 20:01:00 EDT -04:00'
|
116
|
+
|
78
117
|
Time.zone = 'Eastern Time (US & Canada)'
|
79
|
-
expect(@happening1.local_updated_at.to_s).to eq "2012-12-31 19:01:00 -0500"
|
80
118
|
|
81
|
-
expect(@
|
82
|
-
|
119
|
+
expect(@happening1.local_updated_at.to_s)
|
120
|
+
.to eq '2012-12-31 19:01:00 -0500'
|
121
|
+
|
122
|
+
expect(@happening2.updated_at)
|
123
|
+
.to eq 'Tue, 01 Jan 2013 00:00:00 UTC +0000'
|
124
|
+
expect(@happening2.updated_at)
|
125
|
+
.to eq 'Wed, 31 Dec 2012 14:00:00 HST -10:00'
|
83
126
|
Time.zone = 'Pacific/Honolulu'
|
84
|
-
|
127
|
+
|
128
|
+
expect(@happening2.local_updated_at.to_s)
|
129
|
+
.to eq '2012-12-31 14:00:00 -1000'
|
85
130
|
end
|
86
131
|
end
|
87
132
|
|
88
|
-
describe
|
133
|
+
describe 'local_created_at' do
|
89
134
|
it "returns a time with zone object that reflects the value of created_at at altered to the instance's time zone" do
|
90
|
-
expect(@happening1.created_at)
|
91
|
-
|
135
|
+
expect(@happening1.created_at)
|
136
|
+
.to eq 'Tue, 01 Jan 2013 00:01:00 UTC +0000'
|
137
|
+
|
138
|
+
expect(@happening1.created_at)
|
139
|
+
.to eq 'Wed, 31 Dec 2012 20:01:00 EDT -04:00'
|
140
|
+
|
92
141
|
Time.zone = 'Eastern Time (US & Canada)'
|
93
|
-
expect(@happening1.local_created_at.to_s).to eq "2012-12-31 19:01:00 -0500"
|
94
142
|
|
95
|
-
expect(@
|
96
|
-
|
143
|
+
expect(@happening1.local_created_at.to_s)
|
144
|
+
.to eq '2012-12-31 19:01:00 -0500'
|
145
|
+
|
146
|
+
expect(@happening2.created_at)
|
147
|
+
.to eq 'Tue, 01 Jan 2013 00:00:00 UTC +0000'
|
148
|
+
|
149
|
+
expect(@happening2.created_at)
|
150
|
+
.to eq 'Wed, 31 Dec 2012 14:00:00 HST -10:00'
|
151
|
+
|
97
152
|
Time.zone = 'Pacific/Honolulu'
|
98
|
-
|
153
|
+
|
154
|
+
expect(@happening2.local_created_at.to_s)
|
155
|
+
.to eq '2012-12-31 14:00:00 -1000'
|
99
156
|
end
|
100
157
|
end
|
101
158
|
|
102
|
-
describe
|
103
|
-
it
|
104
|
-
expect(@happening1.start_time)
|
105
|
-
|
106
|
-
@happening1.local_start_time = Time.parse("Thu, 29 Aug 2013 02:40:12 HST -10:00")
|
107
|
-
expect(@happening1.start_time).to eq Time.parse("2013-08-29 02:40:12 -0400")
|
159
|
+
describe 'local_start_time=(time_or_string)' do
|
160
|
+
it 'sets start_time on the instance to a time_with_zone object only modifying the time zone' do
|
161
|
+
expect(@happening1.start_time)
|
162
|
+
.to eq 'Mon, 01 Apr 2013 00:01:00 UTC +00:00'
|
108
163
|
|
109
|
-
@happening1.local_start_time = Time.parse(
|
110
|
-
expect(@happening1.start_time)
|
164
|
+
@happening1.local_start_time = Time.parse('Thu, 29 Aug 2013 02:40:12 HST -10:00')
|
165
|
+
expect(@happening1.start_time)
|
166
|
+
.to eq Time.parse('2013-08-29 02:40:12 -0400')
|
111
167
|
|
112
|
-
@happening1.local_start_time =
|
113
|
-
expect(@happening1.start_time)
|
168
|
+
@happening1.local_start_time = Time.parse('Thu, 29 Aug 2013 02:41:12')
|
169
|
+
expect(@happening1.start_time)
|
170
|
+
.to eq Time.parse('2013-08-29 02:41:12 -0400')
|
114
171
|
|
115
|
-
@happening1.local_start_time =
|
116
|
-
expect(@happening1.start_time)
|
172
|
+
@happening1.local_start_time = 'Thu, 29 Aug 2013 02:42:12'
|
173
|
+
expect(@happening1.start_time)
|
174
|
+
.to eq Time.parse('2013-08-29 02:42:12 -0400')
|
117
175
|
|
118
|
-
@happening1.local_start_time =
|
119
|
-
expect(@happening1.start_time)
|
176
|
+
@happening1.local_start_time = 'Thu, 29 Aug 2013 02:43:12 HST -10:00'
|
177
|
+
expect(@happening1.start_time)
|
178
|
+
.to eq Time.parse('2013-08-29 02:43:12 -0400')
|
120
179
|
|
180
|
+
@happening1.local_start_time = '2013-11-11 12:34:56'
|
181
|
+
expect(@happening1.start_time)
|
182
|
+
.to eq Time.parse('2013-11-11 12:34:56 -0500')
|
121
183
|
end
|
122
184
|
end
|
123
185
|
|
124
|
-
describe
|
125
|
-
it
|
126
|
-
expect(@happening1.updated_at)
|
127
|
-
|
128
|
-
@happening1.local_updated_at = Time.parse("Thu, 29 Aug 2013 02:40:12 HST -10:00")
|
129
|
-
expect(@happening1.updated_at).to eq Time.parse("2013-08-29 02:40:12 -0400")
|
186
|
+
describe 'local_updated_at=(time_or_string)' do
|
187
|
+
it 'sets updated_at on the instance to a time_with_zone object only modifying the time zone' do
|
188
|
+
expect(@happening1.updated_at)
|
189
|
+
.to eq 'Tue, 01 Jan 2013 00:01:00 +0000'
|
130
190
|
|
131
|
-
@happening1.local_updated_at = Time.parse(
|
132
|
-
expect(@happening1.updated_at)
|
191
|
+
@happening1.local_updated_at = Time.parse('Thu, 29 Aug 2013 02:40:12 HST -10:00')
|
192
|
+
expect(@happening1.updated_at)
|
193
|
+
.to eq Time.parse('2013-08-29 02:40:12 -0400')
|
133
194
|
|
134
|
-
@happening1.local_updated_at =
|
135
|
-
expect(@happening1.updated_at)
|
195
|
+
@happening1.local_updated_at = Time.parse('Thu, 29 Aug 2013 02:41:12')
|
196
|
+
expect(@happening1.updated_at)
|
197
|
+
.to eq Time.parse('2013-08-29 02:41:12 -0400')
|
136
198
|
|
137
|
-
@happening1.local_updated_at =
|
138
|
-
expect(@happening1.updated_at)
|
199
|
+
@happening1.local_updated_at = 'Thu, 29 Aug 2013 02:42:12'
|
200
|
+
expect(@happening1.updated_at)
|
201
|
+
.to eq Time.parse('2013-08-29 02:42:12 -0400')
|
139
202
|
|
140
|
-
@happening1.local_updated_at =
|
141
|
-
expect(@happening1.updated_at)
|
203
|
+
@happening1.local_updated_at = 'Thu, 29 Aug 2013 02:43:12 HST -10:00'
|
204
|
+
expect(@happening1.updated_at)
|
205
|
+
.to eq Time.parse('2013-08-29 02:43:12 -0400')
|
142
206
|
|
207
|
+
@happening1.local_updated_at = '2013-11-11 12:34:56'
|
208
|
+
expect(@happening1.updated_at)
|
209
|
+
.to eq Time.parse('2013-11-11 12:34:56 -0500')
|
143
210
|
end
|
144
211
|
end
|
145
212
|
|
146
|
-
describe
|
147
|
-
it
|
213
|
+
describe 'local_created_at=(time_or_string)' do
|
214
|
+
it 'sets created_at on the instance to a time_with_zone object only modifying the time zone' do
|
148
215
|
expect(@happening1.created_at).to eq ' Tue, 01 Jan 2013 00:01:00 +0000'
|
149
216
|
|
150
|
-
@happening1.local_created_at = Time.parse(
|
151
|
-
expect(@happening1.created_at)
|
217
|
+
@happening1.local_created_at = Time.parse('Thu, 29 Aug 2013 02:40:12 HST -10:00')
|
218
|
+
expect(@happening1.created_at)
|
219
|
+
.to eq Time.parse('2013-08-29 02:40:12 -0400')
|
152
220
|
|
153
|
-
@happening1.local_created_at = Time.parse(
|
154
|
-
expect(@happening1.created_at)
|
221
|
+
@happening1.local_created_at = Time.parse('Thu, 29 Aug 2013 02:41:12')
|
222
|
+
expect(@happening1.created_at)
|
223
|
+
.to eq Time.parse('2013-08-29 02:41:12 -0400')
|
155
224
|
|
156
|
-
@happening1.local_created_at =
|
157
|
-
expect(@happening1.created_at)
|
225
|
+
@happening1.local_created_at = 'Thu, 29 Aug 2013 02:42:12'
|
226
|
+
expect(@happening1.created_at)
|
227
|
+
.to eq Time.parse('2013-08-29 02:42:12 -0400')
|
158
228
|
|
159
|
-
@happening1.local_created_at =
|
160
|
-
expect(@happening1.created_at)
|
229
|
+
@happening1.local_created_at = 'Thu, 29 Aug 2013 02:43:12 HST -10:00'
|
230
|
+
expect(@happening1.created_at)
|
231
|
+
.to eq Time.parse('2013-08-29 02:43:12 -0400')
|
161
232
|
|
162
|
-
@happening1.local_created_at =
|
163
|
-
expect(@happening1.created_at)
|
233
|
+
@happening1.local_created_at = '2013-11-11 12:34:56'
|
234
|
+
expect(@happening1.created_at)
|
235
|
+
.to eq Time.parse('2013-11-11 12:34:56 -0500')
|
164
236
|
end
|
165
237
|
end
|
166
238
|
end
|
@@ -171,7 +243,7 @@ describe Event do
|
|
171
243
|
@event1 = Event.find_by_name('Eastern Time (US & Canada)')
|
172
244
|
end
|
173
245
|
|
174
|
-
context
|
246
|
+
context 'Event should have time_jawn methods even though it has a non_conventional attribute' do
|
175
247
|
subject { @event1 }
|
176
248
|
|
177
249
|
it { should respond_to :local_start_time }
|
@@ -189,15 +261,15 @@ describe Occurrence do
|
|
189
261
|
@occurrence1 = Occurrence.find_by_name('Eastern Time (US & Canada)')
|
190
262
|
end
|
191
263
|
|
192
|
-
context
|
193
|
-
describe
|
264
|
+
context 'Ocurrence instance attribute accessor' do
|
265
|
+
describe 'time_zone_attribute_name' do
|
194
266
|
it 'should respond with the time_zone attribute name as defined in the class.' do
|
195
|
-
expect(
|
267
|
+
expect(@occurrence1.class.time_zone_attribute_name).to eq :time_zone
|
196
268
|
end
|
197
269
|
end
|
198
270
|
end
|
199
271
|
|
200
|
-
context
|
272
|
+
context 'Occurrence should have time_jawn methods, except for local_updated_at, since it is not specified in the model' do
|
201
273
|
subject { @occurrence1 }
|
202
274
|
|
203
275
|
it { should respond_to :local_start_time }
|
@@ -215,15 +287,15 @@ describe Occasion do
|
|
215
287
|
@occasion1 = Occasion.find_by_name('Eastern Time (US & Canada)')
|
216
288
|
end
|
217
289
|
|
218
|
-
context
|
219
|
-
describe
|
290
|
+
context 'Occasion instance attribute accessor' do
|
291
|
+
describe 'time_zone_attribute_name' do
|
220
292
|
it 'should respond with the time_zone attribute name as defined in the class.' do
|
221
|
-
expect(
|
293
|
+
expect(@occasion1.class.time_zone_attribute_name).to eq :t_z
|
222
294
|
end
|
223
295
|
end
|
224
296
|
end
|
225
297
|
|
226
|
-
context
|
298
|
+
context 'Occasion should have time_jawn methods, except for local_updated_at, since it is not specified in the model, even though it has a non_conventional attribute' do
|
227
299
|
subject { @occasion1 }
|
228
300
|
|
229
301
|
it { should respond_to :local_start_time }
|
metadata
CHANGED
@@ -1,85 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: time_jawn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Platt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '6'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '6'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '6'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
42
|
+
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '3.9'
|
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
|
-
version: '
|
54
|
+
version: '3.9'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.82'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.82'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: sqlite3-ruby
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- -
|
73
|
+
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
75
|
+
version: '1.3'
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- -
|
80
|
+
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
82
|
+
version: '1.3'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: timecop
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- -
|
87
|
+
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
89
|
+
version: '0.9'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- -
|
94
|
+
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
96
|
+
version: '0.9'
|
83
97
|
description: TimeJawn makes class instances time zone aware. It doesn't care one iota
|
84
98
|
about system, application or database time as far as I can tell. It has some expectations
|
85
99
|
and adds some useful methods.
|
@@ -102,17 +116,16 @@ require_paths:
|
|
102
116
|
- lib
|
103
117
|
required_ruby_version: !ruby/object:Gem::Requirement
|
104
118
|
requirements:
|
105
|
-
- -
|
119
|
+
- - ">="
|
106
120
|
- !ruby/object:Gem::Version
|
107
|
-
version: '2.
|
121
|
+
version: '2.5'
|
108
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
123
|
requirements:
|
110
|
-
- -
|
124
|
+
- - ">="
|
111
125
|
- !ruby/object:Gem::Version
|
112
126
|
version: '0'
|
113
127
|
requirements: []
|
114
|
-
|
115
|
-
rubygems_version: 2.0.14
|
128
|
+
rubygems_version: 3.1.2
|
116
129
|
signing_key:
|
117
130
|
specification_version: 4
|
118
131
|
summary: TimeJawn makes time zone aware class instances.
|