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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4583de41d22f665133c58c57e67a92320369ea9c
4
- data.tar.gz: 8c58f930efd693d2df6ab23d688d2a55ff154f6b
2
+ SHA256:
3
+ metadata.gz: 5d8c7496ddfb91d9d85cfa71c2c3f0a3408617e2f4ff2dfe8e18746f945ca80b
4
+ data.tar.gz: a7ea361497ed0e978e5f6ba2f3f1963efbee45a170a31f7cd7df4578d0b5bb06
5
5
  SHA512:
6
- metadata.gz: f7d5b0f832ea16d77bb829cff0372fa27132b753f69e8fef2039e1d057ffd32d35650220b4610c85b9ff9a30c0b2fca9cb1a0b2695606a48340d28a19c984acd
7
- data.tar.gz: e1c1cafd66abb1581a3fff71ca45dfdeced16d3485c3a97f56e4cdcb544143ab2e7b1fa900325be13e20c5c1983f9c9cab33cc85d443f0ced1192a8f53a53742
6
+ metadata.gz: 4e86cf6f6cbb61d3ab3c91862c20ed069e2cd58c5e742799efa4ba14cf1074f9cbd59565da73568e0ea6faf8e0ef93c0b886b5802b60a07070e1494dea21534e
7
+ data.tar.gz: 97cd52322dca4ea025d6e9bc23f9409bfabcf6ebc68bfc0279269d1e4aea0adfacede5f8a74285f20569b23d42dea889f724e7e2b7277e0a58c1c62d4f89d329
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'time_jawn/time_jawn'
2
4
 
3
- ActiveRecord::Base.send(:include, TimeJawn)
5
+ ActiveRecord::Base.include TimeJawn
@@ -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_#{attribue} and local_#{attribute}= the attribute portion their
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_#{attribue} methods will take the value stored in the attribute
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(self.send(self.class.time_zone_attribute_name))
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 = self.send(self.class.time_zone_attribute_name)
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
- next unless column.type == :datetime
11
- column.name.to_sym
11
+ next unless column.type == :datetime
12
+
13
+ column.name.to_sym
12
14
  end.compact
13
15
  end
14
16
 
@@ -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 "has_time_zone" do
27
- it "does not have instance methods until called" do
28
- expect(Happening.instance_methods.include? :local_start_time).to eq false
29
- expect(Happening.instance_methods.include? :local_created_at).to eq false
30
- expect(Happening.instance_methods.include? :local_updated_at).to eq false
31
- expect(Happening.instance_methods.include? :local_start_time=).to eq false
32
- expect(Happening.instance_methods.include? :local_updated_at=).to eq false
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? :local_start_time).to eq true
40
- expect(Happening.instance_methods.include? :local_created_at).to eq true
41
- expect(Happening.instance_methods.include? :local_updated_at).to eq true
42
- expect(Happening.instance_methods.include? :local_start_time=).to eq true
43
- expect(Happening.instance_methods.include? :local_created_at=).to eq true
44
- expect(Happening.instance_methods.include? :local_updated_at=).to eq true
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 "current_time" do
51
- it "returns a time with zone object reflecting the current local time of the instance" do
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 "local_start_time" do
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).to eq 'Mon, 01 Apr 2013 00:01:00 UTC +00:00'
63
- expect(@happening1.start_time).to eq 'Sun, 31 Mar 2013 20:01:00 EDT -04:00'
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(@happening2.start_time).to eq 'Mon, 01 Apr 2013 00:00:00 UTC +00:00'
68
- expect(@happening2.start_time).to eq 'Sun, 31 Mar 2013 14:00:00 HST -10:00'
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
- expect(@happening2.local_start_time.to_s).to eq "2013-03-31 14:00:00 -1000"
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 "local_updated_at" do
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).to eq 'Tue, 01 Jan 2013 00:01:00 UTC +0000'
77
- expect(@happening1.updated_at).to eq 'Wed, 31 Dec 2012 20:01:00 EDT -04:00'
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(@happening2.updated_at).to eq 'Tue, 01 Jan 2013 00:00:00 UTC +0000'
82
- expect(@happening2.updated_at).to eq 'Wed, 31 Dec 2012 14:00:00 HST -10:00'
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
- expect(@happening2.local_updated_at.to_s).to eq "2012-12-31 14:00:00 -1000"
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 "local_created_at" do
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).to eq 'Tue, 01 Jan 2013 00:01:00 UTC +0000'
91
- expect(@happening1.created_at).to eq 'Wed, 31 Dec 2012 20:01:00 EDT -04:00'
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(@happening2.created_at).to eq 'Tue, 01 Jan 2013 00:00:00 UTC +0000'
96
- expect(@happening2.created_at).to eq 'Wed, 31 Dec 2012 14:00:00 HST -10:00'
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
- expect(@happening2.local_created_at.to_s).to eq "2012-12-31 14:00:00 -1000"
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 "local_start_time=(time_or_string)" do
103
- it "sets start_time on the instance to a time_with_zone object only modifying the time zone" do
104
- expect(@happening1.start_time).to eq 'Mon, 01 Apr 2013 00:01:00 UTC +00:00'
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("Thu, 29 Aug 2013 02:41:12")
110
- expect(@happening1.start_time).to eq Time.parse("2013-08-29 02:41:12 -0400")
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 = "Thu, 29 Aug 2013 02:42:12"
113
- expect(@happening1.start_time).to eq Time.parse("2013-08-29 02:42:12 -0400")
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 = "Thu, 29 Aug 2013 02:43:12 HST -10:00"
116
- expect(@happening1.start_time).to eq Time.parse("2013-08-29 02:43:12 -0400")
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 = "2013-11-11 12:34:56"
119
- expect(@happening1.start_time).to eq Time.parse("2013-11-11 12:34:56 -0500")
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 "local_updated_at=(time_or_string)" do
125
- it "sets updated_at on the instance to a time_with_zone object only modifying the time zone" do
126
- expect(@happening1.updated_at).to eq 'Tue, 01 Jan 2013 00:01:00 +0000'
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("Thu, 29 Aug 2013 02:41:12")
132
- expect(@happening1.updated_at).to eq Time.parse("2013-08-29 02:41:12 -0400")
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 = "Thu, 29 Aug 2013 02:42:12"
135
- expect(@happening1.updated_at).to eq Time.parse("2013-08-29 02:42:12 -0400")
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 = "Thu, 29 Aug 2013 02:43:12 HST -10:00"
138
- expect(@happening1.updated_at).to eq Time.parse("2013-08-29 02:43:12 -0400")
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 = "2013-11-11 12:34:56"
141
- expect(@happening1.updated_at).to eq Time.parse("2013-11-11 12:34:56 -0500")
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 "local_created_at=(time_or_string)" do
147
- it "sets created_at on the instance to a time_with_zone object only modifying the time zone" do
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("Thu, 29 Aug 2013 02:40:12 HST -10:00")
151
- expect(@happening1.created_at).to eq Time.parse("2013-08-29 02:40:12 -0400")
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("Thu, 29 Aug 2013 02:41:12")
154
- expect(@happening1.created_at).to eq Time.parse("2013-08-29 02:41:12 -0400")
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 = "Thu, 29 Aug 2013 02:42:12"
157
- expect(@happening1.created_at).to eq Time.parse("2013-08-29 02:42:12 -0400")
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 = "Thu, 29 Aug 2013 02:43:12 HST -10:00"
160
- expect(@happening1.created_at).to eq Time.parse("2013-08-29 02:43:12 -0400")
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 = "2013-11-11 12:34:56"
163
- expect(@happening1.created_at).to eq Time.parse("2013-11-11 12:34:56 -0500")
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 "Event should have time_jawn methods even though it has a non_conventional attribute" do
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 "Ocurrence instance attribute accessor" do
193
- describe "time_zone_attribute_name" do
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( @occurrence1.class.time_zone_attribute_name ).to eq :time_zone
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 "Occurrence should have time_jawn methods, except for local_updated_at, since it is not specified in the model" do
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 "Occasion instance attribute accessor" do
219
- describe "time_zone_attribute_name" do
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( @occasion1.class.time_zone_attribute_name ).to eq :t_z
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 "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
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: 2.0.1
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: 2015-01-07 00:00:00.000000000 Z
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: 4.2.1
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: 4.2.1
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: 4.2.1
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: 4.2.1
40
+ version: '6'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec-rails
42
+ name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
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: '0'
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: '0'
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: '0'
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.0'
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
- rubyforge_project:
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.