dynamic_time_zone 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dynamic_time_zone/time_patch.rb +14 -0
- data/lib/dynamic_time_zone/version.rb +1 -1
- data/lib/dynamic_time_zone.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '086e49015eb839845d138706fa36e5f5389db097bf2612df00f7fe50ea1e9dd8'
|
4
|
+
data.tar.gz: 9ca0f7741e769f1b679157744e3713737a982de3438a5e693b48d40b3edfbbc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecf0bdef79552069afce4a7bf669743679e3a64929ee858a10110b6d51d47b2c720f23cf767b86ac0352db5999322b584b7e78bb84b02d41060cfdc95683a46b
|
7
|
+
data.tar.gz: 59c876b2e3d98c82d0afb28a873fdbaa60dd83206ecb1575e257af45f86caa3b52b12d57e82bb95a4c3cfc8cc996de0df1937feb8b492113e2dfe016c927725b
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TimePatch
|
4
|
+
def compare_with_coercion(other)
|
5
|
+
if DynamicTimeZone.enabled && other.is_a?(ActiveSupport::TimeWithZone) && other.using_dynamic_time_zone?
|
6
|
+
self.utc <=> other.utc
|
7
|
+
else
|
8
|
+
super
|
9
|
+
end
|
10
|
+
end
|
11
|
+
alias_method :<=>, :compare_with_coercion
|
12
|
+
end
|
13
|
+
|
14
|
+
Time.prepend(TimePatch)
|
data/lib/dynamic_time_zone.rb
CHANGED
@@ -21,5 +21,6 @@ require 'dynamic_time_zone/validator'
|
|
21
21
|
require 'dynamic_time_zone/identifier_builder'
|
22
22
|
require 'dynamic_time_zone/time_zone_data_source'
|
23
23
|
require 'dynamic_time_zone/time_with_zone_patch'
|
24
|
+
require 'dynamic_time_zone/time_patch'
|
24
25
|
require 'dynamic_time_zone/offset_format_convertor'
|
25
26
|
require 'dynamic_time_zone/time_parser'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamic_time_zone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Appfolio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tzinfo
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- lib/dynamic_time_zone/offset_format_convertor.rb
|
56
56
|
- lib/dynamic_time_zone/test_helper.rb
|
57
57
|
- lib/dynamic_time_zone/time_parser.rb
|
58
|
+
- lib/dynamic_time_zone/time_patch.rb
|
58
59
|
- lib/dynamic_time_zone/time_with_zone_patch.rb
|
59
60
|
- lib/dynamic_time_zone/time_zone_data_source.rb
|
60
61
|
- lib/dynamic_time_zone/validator.rb
|
@@ -77,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
78
|
- !ruby/object:Gem::Version
|
78
79
|
version: '0'
|
79
80
|
requirements: []
|
80
|
-
rubygems_version: 3.
|
81
|
+
rubygems_version: 3.1.6
|
81
82
|
signing_key:
|
82
83
|
specification_version: 4
|
83
84
|
summary: Dynamically set the offset from UTC from timezone identifier
|