timezone 1.3.8 → 1.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b1164d38577dae4cbf174e3a92199b50ee988401f79631d6333faa173721d63
4
- data.tar.gz: 64d95c4b4a61a060d1d3c067e247a56abc9ef6ac7e35484a60fcbb7d7c290a86
3
+ metadata.gz: 7470e7b4c5fd9cd721f958813e514054fbd3060dc4f30c3e4a2468a2185481d0
4
+ data.tar.gz: bfa1e661ff97f16b894083ca34772df64a8493a2d710301b89a515ce45918eda
5
5
  SHA512:
6
- metadata.gz: 166254a3f2bf10dc51512f09ece3c83490147f7495176efb58c319da9bf5ab87821e8e835ec19a6844454695ac92c0ad22347e0902fe9585ee71fc7f3850ca2b
7
- data.tar.gz: 6f3e35a59d7c3778c6a7d60f55d80fa0d6d269a3cddeb171b5304d00788644043097a8695dc98cc5375fbcdbfcd5b05a6d740eaa9bef4450318247fe78c99b22
6
+ metadata.gz: 54ac5018bf083eab0ea4997624b66d56aeb7721125eac51dd921d8b6043b2660e0eacd3d728a15aa2d154962d61cc175307d141123a41e8129c39b94f8a99ba5
7
+ data.tar.gz: 12e1590da7300b0aa84efd53c96b0a092a250cc674814e1c66b0518fccfb99955a7615b1cb3866f39c25c5fc781176dfb4b76c8238947e532740dc93f98cbb57
@@ -1,5 +1,9 @@
1
1
  # master (unreleased)
2
2
 
3
+ # 1.3.9
4
+
5
+ * Updated with `tzdata-2020c` ([@panthomakos][])
6
+
3
7
  # 1.3.8
4
8
 
5
9
  * Updated with `tzdata-2020b` ([@panthomakos][])
@@ -4,42 +4,29 @@
4
4
  require 'benchmark'
5
5
  require 'timezone'
6
6
 
7
- def load_tz(timezone)
8
- Timezone.fetch(timezone)
9
- end
10
-
11
7
  puts 'Loading timezones'
12
8
 
13
- LOAD_ITERATIONS = 1_000
14
9
  Benchmark.bm do |x|
15
- x.report('la') { LOAD_ITERATIONS.times { load_tz('America/Los_Angeles') } }
16
- x.report('hk') { LOAD_ITERATIONS.times { load_tz('Asia/Hong_Kong') } }
17
- end
18
-
19
- def calc_local(timezone)
20
- timezone.time(Time.utc(3000, 1, 1))
10
+ x.report('la') { 10_000.times { Timezone.fetch('America/Los_Angeles') } }
11
+ x.report('hk') { 10_000.times { Timezone.fetch('Asia/Hong_Kong') } }
21
12
  end
22
13
 
23
- puts 'Calculating LOCAL'
24
-
25
- LOCAL_ITERATIONS = 10_000
26
- Benchmark.bm do |x|
27
- timezone = Timezone.fetch('America/Los_Angeles')
28
- x.report('la') { LOCAL_ITERATIONS.times { calc_local(timezone) } }
29
- timezone = Timezone.fetch('Asia/Hong_Kong')
30
- x.report('hk') { LOCAL_ITERATIONS.times { calc_local(timezone) } }
14
+ def calc(method, timezone, time)
15
+ timezone.public_send(method, time)
31
16
  end
32
17
 
33
- def calc_utc(timezone)
34
- timezone.local_to_utc(Time.utc(3000, 1, 1))
18
+ def bench(iterations, method)
19
+ Benchmark.bm do |x|
20
+ time = Time.utc(3000, 1, 1)
21
+ timezone = Timezone.fetch('America/Los_Angeles')
22
+ x.report('la') { iterations.times { calc(method, timezone, time) } }
23
+ timezone = Timezone.fetch('Asia/Hong_Kong')
24
+ x.report('hk') { iterations.times { calc(method, timezone, time) } }
25
+ end
35
26
  end
36
27
 
37
- puts 'Calculating UTC'
28
+ puts 'Calculating LOCAL (#time)'
29
+ bench(10_000, :time)
38
30
 
39
- UTC_ITERATIONS = 10_000
40
- Benchmark.bm do |x|
41
- timezone = Timezone.fetch('America/Los_Angeles')
42
- x.report('la') { UTC_ITERATIONS.times { calc_utc(timezone) } }
43
- timezone = Timezone.fetch('Asia/Hong_Kong')
44
- x.report('hk') { UTC_ITERATIONS.times { calc_utc(timezone) } }
45
- end
31
+ puts 'Calculating UTC (#local_to_utc)'
32
+ bench(10_000, :local_to_utc)
@@ -25,8 +25,8 @@
25
25
  6048000:+13:1:46800
26
26
  26006400:+12:0:43200
27
27
  5443200:+13:1:46800
28
- 26006400:+12:0:43200
29
- 6048000:+13:1:46800
28
+ 29635200:+12:0:43200
29
+ 2419200:+13:1:46800
30
30
  26006400:+12:0:43200
31
31
  5443200:+13:1:46800
32
32
  26006400:+12:0:43200
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Timezone
4
- VERSION = '1.3.8'.freeze
4
+ VERSION = '1.3.9'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timezone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.8
4
+ version: 1.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pan Thomakos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-16 00:00:00.000000000 Z
11
+ date: 2020-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -747,7 +747,7 @@ requirements: []
747
747
  rubygems_version: 3.1.2
748
748
  signing_key:
749
749
  specification_version: 4
750
- summary: timezone-1.3.8
750
+ summary: timezone-1.3.9
751
751
  test_files:
752
752
  - test/data/Helsinki_rules_without_timestamps.json
753
753
  - test/data/asia