et-orbi 1.2.1 → 1.2.2

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: 0e76c51b164aaa3749e6865594a141100e4e6e1e
4
- data.tar.gz: dbc982c799a79da7408ed7e7cb9ff9d9481ea91c
2
+ SHA256:
3
+ metadata.gz: d3ad790bb200e2bb944f6d8b69abb66a3f5563c0d601fd51839c19fa9b2585ed
4
+ data.tar.gz: 1a9c61b4371a23fb0e4c4db5dfdf5ffb0fd440415f811e232a580e6ce71d37f0
5
5
  SHA512:
6
- metadata.gz: b2780226defd2f1ad6aad04291e6dc77bcf9e56d60c75f2f68ea0471f931bf75f434cf44e52a17d5e41dff79947c571d7179cf70759d0429e3d6631f02f4d996
7
- data.tar.gz: 8cad684822abf9f08a3811867a5c0010e24d175527fa65c7f4f67e580fd540b5e798cf94131b95b9942ec239b00c1fccc470a5c8a0cadeacfd4dfa3c8f5299a0
6
+ metadata.gz: 5f6032e29f4f91a638c5d524cd94854128ad9f59d2a017989088dd44c130098bbce44460f0d57396e3dd81a155b770fdcc3454be8069513924aa1dfe1807ea0d
7
+ data.tar.gz: 2b9b2e1b4dd3c49c103d856509096ca0672c3efff4b9e3d5affb87559de010416c9944de55cd4284a8f3bc949ef2f6251fe0fd56c7a055aa516f63b046a09c28
@@ -2,6 +2,11 @@
2
2
  # CHANGELOG.md
3
3
 
4
4
 
5
+ ## et-orbi 1.2.2 released 2019-08-19
6
+
7
+ - Let EoTime#== accept EoTime or ::Time instances, gh-20, gh-7
8
+
9
+
5
10
  ## et-orbi 1.2.1 released 2019-05-01
6
11
 
7
12
  - More US time zone corrections, Vais Salikhov, gh-19
data/CREDITS.md CHANGED
@@ -1,6 +1,7 @@
1
1
 
2
2
  # et-orbi credits
3
3
 
4
+ * d-m-u (https://github.com/d-m-u) EoTime#==(Time), gh-20, gh-7
4
5
  * Vais Salikhov (https://github.com/vais) missing US timezone aliases, gh-18 gh-19
5
6
  * Wenhui Wang https://github.com/w11th .parse vs Chronic+ActiveSupport, fugit 11
6
7
  * Marcel https://github.com/MTRNord "Mitteleuropaeische Sommerzeit", gh-15
@@ -13,6 +13,6 @@ require 'et-orbi/zone'
13
13
 
14
14
  module EtOrbi
15
15
 
16
- VERSION = '1.2.1'
16
+ VERSION = '1.2.2'
17
17
  end
18
18
 
@@ -205,11 +205,24 @@ module EtOrbi
205
205
 
206
206
  def ==(o)
207
207
 
208
- o.is_a?(EoTime) &&
209
- o.seconds == @seconds &&
210
- (o.zone == @zone || o.zone.current_period == @zone.current_period)
208
+ if o.is_a?(EoTime)
209
+ o.seconds == @seconds &&
210
+ (o.zone == @zone || o.zone.current_period == @zone.current_period)
211
+ elsif o.is_a?(::Time)
212
+ (to_f * 1000).to_i == (o.to_f * 1000).to_i
213
+ else
214
+ false
215
+ end
211
216
  end
212
- #alias eql? == # FIXME see Object#== (ri)
217
+
218
+ # Nota Bene:
219
+ #
220
+ # Unlike ==, the equal? method should never be overridden by subclasses
221
+ # as it is used to determine object identity (that is, a.equal?(b) if and
222
+ # only if a is the same object as b)
223
+ #
224
+ # The eql? method returns true if obj and other refer to the same hash key.
225
+ # This is used by Hash to test members for equality.
213
226
 
214
227
  def >(o); @seconds > _to_f(o); end
215
228
  def >=(o); @seconds >= _to_f(o); end
@@ -414,7 +427,7 @@ module EtOrbi
414
427
 
415
428
  fail ArgumentError(
416
429
  "Comparison of EoTime with #{o.inspect} failed"
417
- ) unless o.is_a?(EoTime) || o.is_a?(Time)
430
+ ) unless o.respond_to?(:to_f)
418
431
 
419
432
  o.to_f
420
433
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: et-orbi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-30 00:00:00.000000000 Z
11
+ date: 2019-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzinfo
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  requirements: []
100
100
  rubyforge_project:
101
- rubygems_version: 2.6.14.1
101
+ rubygems_version: 2.7.6
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: time with zones