jekyll 3.9.2 → 3.9.3

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: d1f18811c89301d6ac1f83c43a4d2c1780bbe1e69e15c660ddef08048826bed5
4
- data.tar.gz: ad03fafa2fc29fbdcd80f517ccef5f07eb109e79c83334c1aa7142a5b2561f64
3
+ metadata.gz: 10ada5abfe77a61887f4915b1b5230a0b654d812bc8a6b628907e1bbc62c2b2a
4
+ data.tar.gz: 85f09cb1ecafab016ea53e305af4b774e9c14d78f4309830f1e99dcf59b19d7c
5
5
  SHA512:
6
- metadata.gz: a8b270aaeff77e73442f5f6094c063254716873107b5aacaef68b992a9c15bedca1c5b4921965de784cdb823abdbe37f9af504c82d566bded0a831c80b674161
7
- data.tar.gz: 7cfb965920cf1ddf96d515c94ce25b0595a9d23ff434607f70aba4ea668dfc1e7e2e46f19d0ebe03c1f733360eb0d7c9c9616210396623f884111be656942d61
6
+ metadata.gz: c351db7593dd51d91404472a9a0acaa499a03e8f4512694bc7867c3b290b913a22d61aa04858ee6cc96d31d85f4b3c102d3ad1e055f0c2a4a45ca5d6960e21e6
7
+ data.tar.gz: 80ee7476d928d1f4d3ab88af5ee951026ee017fb3769a915136d25b097fccaef916705299588cd9718290e7bc852ecf1fb5bc8b492bb4e60e40c1f923d0eb38c
@@ -87,10 +87,10 @@ group :jekyll_plugins do
87
87
  gem "jekyll-feed", "~> 0.6"
88
88
  end
89
89
 
90
- # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
90
+ # Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
91
91
  # and associated library.
92
- install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
93
- gem "tzinfo", "~> 1.2"
92
+ platforms :mingw, :x64_mingw, :mswin, :jruby do
93
+ gem "tzinfo", ">= 1", "< 3"
94
94
  gem "tzinfo-data"
95
95
  end
96
96
 
@@ -11,64 +11,35 @@ module Jekyll
11
11
  # timezone - the IANA Time Zone specified in "_config.yml"
12
12
  #
13
13
  # Returns a string that ultimately re-defines ENV["TZ"] in Windows
14
- def calculate(timezone)
14
+ def calculate(timezone, now = Time.now)
15
15
  External.require_with_graceful_fail("tzinfo") unless defined?(TZInfo)
16
16
  tz = TZInfo::Timezone.get(timezone)
17
- difference = Time.now.to_i - tz.now.to_i
17
+
18
+ #
19
+ # Use period_for_utc and utc_total_offset instead of
20
+ # period_for and observed_utc_offset for compatibility with tzinfo v1.
21
+ offset = tz.period_for_utc(now.getutc).utc_total_offset
22
+
18
23
  #
19
24
  # POSIX style definition reverses the offset sign.
20
25
  # e.g. Eastern Standard Time (EST) that is 5Hrs. to the 'west' of Prime Meridian
21
26
  # is denoted as:
22
27
  # EST+5 (or) EST+05:00
23
- # Reference: http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
24
- sign = difference < 0 ? "-" : "+"
25
- offset = sign == "-" ? "+" : "-" unless difference.zero?
26
- #
27
- # convert the difference (in seconds) to hours, as a rational number, and perform
28
- # a modulo operation on it.
29
- modulo = modulo_of(rational_hour(difference))
28
+ # Reference: https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
29
+ sign = offset.positive? ? "-" : "+"
30
+
31
+ rational_hours = offset.abs.to_r / 3600
32
+ hours = rational_hours.to_i
33
+ minutes = ((rational_hours - hours) * 60).to_i
34
+
30
35
  #
31
- # Format the hour as a two-digit number.
32
- # Establish the minutes based on modulo expression.
33
- hh = format("%02d", absolute_hour(difference).ceil)
34
- mm = modulo.zero? ? "00" : "30"
36
+ # Format the hours and minutes as two-digit numbers.
37
+ time = format("%<hours>02d:%<minutes>02d", :hours => hours, :minutes => minutes)
35
38
 
36
- Jekyll.logger.debug "Timezone:", "#{timezone} #{offset}#{hh}:#{mm}"
39
+ Jekyll.logger.debug "Timezone:", "#{timezone} #{sign}#{time}"
37
40
  #
38
41
  # Note: The 3-letter-word below doesn't have a particular significance.
39
- "WTZ#{sign}#{hh}:#{mm}"
40
- end
41
-
42
- private
43
-
44
- # Private: Convert given seconds to an hour as a rational number.
45
- #
46
- # seconds - supplied as an integer, it is converted to a rational number.
47
- # 3600 - no. of seconds in an hour.
48
- #
49
- # Returns a rational number.
50
- def rational_hour(seconds)
51
- seconds.to_r / 3600
52
- end
53
-
54
- # Private: Convert given seconds to an hour as an absolute number.
55
- #
56
- # seconds - supplied as an integer, it is converted to its absolute.
57
- # 3600 - no. of seconds in an hour.
58
- #
59
- # Returns an integer.
60
- def absolute_hour(seconds)
61
- seconds.abs / 3600
62
- end
63
-
64
- # Private: Perform a modulo operation on a given fraction.
65
- #
66
- # fraction - supplied as a rational number, its numerator is divided
67
- # by its denominator and the remainder returned.
68
- #
69
- # Returns an integer.
70
- def modulo_of(fraction)
71
- fraction.numerator % fraction.denominator
42
+ "WTZ#{sign}#{time}"
72
43
  end
73
44
  end
74
45
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jekyll
4
- VERSION = "3.9.2".freeze
4
+ VERSION = "3.9.3".freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.2
4
+ version: 3.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-27 00:00:00.000000000 Z
11
+ date: 2023-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -56,16 +56,22 @@ dependencies:
56
56
  name: i18n
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.7'
62
+ - - "<"
63
+ - !ruby/object:Gem::Version
64
+ version: '2'
62
65
  type: :runtime
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
65
68
  requirements:
66
- - - "~>"
69
+ - - ">="
67
70
  - !ruby/object:Gem::Version
68
71
  version: '0.7'
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: '2'
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: jekyll-sass-converter
71
77
  requirement: !ruby/object:Gem::Requirement
@@ -318,7 +324,7 @@ homepage: https://github.com/jekyll/jekyll
318
324
  licenses:
319
325
  - MIT
320
326
  metadata: {}
321
- post_install_message:
327
+ post_install_message:
322
328
  rdoc_options:
323
329
  - "--charset=UTF-8"
324
330
  require_paths:
@@ -335,7 +341,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
335
341
  version: '0'
336
342
  requirements: []
337
343
  rubygems_version: 3.1.6
338
- signing_key:
344
+ signing_key:
339
345
  specification_version: 2
340
346
  summary: A simple, blog aware, static site generator.
341
347
  test_files: []