timing 0.2.8 → 0.2.9

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
2
  SHA256:
3
- metadata.gz: 6abb23fdcc3b41f24244fe8f84c359b9dabd79d23b761372f22e6b2d5a491daa
4
- data.tar.gz: 3cb211dfff78e9426c01a7e2a0c3c22b51f80ff4a347557172ee9d09982c0651
3
+ metadata.gz: 7957fd2301422e73b76369d0c7f077a70b39fe3c6ef4a040a8defdbc09902d96
4
+ data.tar.gz: af73b67fe136ffc4e9af07025f12cb44276101ad72ff452ece46c1515acce8bd
5
5
  SHA512:
6
- metadata.gz: 876430e1344bbe150c1f0e74d5ec5fd752804ee30f7682b469f3d8122ec66f81bfd7f9a2bdba0dfc80c59be3aa87e1bfb2927700f1544f16ec6333f08d77ca0d
7
- data.tar.gz: 7af0ec9c84cb00aa38ce3352480a9716d27821fa17085d1fb4a6feb9c92aacb6fea21127818b997b47e4f16a5da86b5c894de87df2af946b9330b07bbe88c70d
6
+ metadata.gz: 8d4dff8a47e6a7c87e0c7dc73dc3822fa870c03f7d6ed0f03f7b1c7ee6c12cf02e3208d4987060848b985bb0df28cff4d939698910f48284a578aa2bfa540cf1
7
+ data.tar.gz: b32a451bf8881941c55199574e7ee8469f952ed935e5c8879a386e4d0d76b696d6379b532cda8c211fc75a3a21966b1e29990707bfd15a7ecd5c3251deb0f351
@@ -2613,12 +2613,30 @@ module Timing
2613
2613
  return cached
2614
2614
  end
2615
2615
 
2616
+ i0 = index
2616
2617
  if has_terminal?('utc', false, index)
2617
- r0 = instantiate_node(ZoneName,input, index...(index + 3))
2618
+ r1 = instantiate_node(ZoneName,input, index...(index + 3))
2618
2619
  @index += 3
2619
2620
  else
2620
2621
  terminal_parse_failure('utc')
2621
- r0 = nil
2622
+ r1 = nil
2623
+ end
2624
+ if r1
2625
+ r0 = r1
2626
+ else
2627
+ if has_terminal?('z', false, index)
2628
+ r2 = instantiate_node(ZoneName,input, index...(index + 1))
2629
+ @index += 1
2630
+ else
2631
+ terminal_parse_failure('z')
2632
+ r2 = nil
2633
+ end
2634
+ if r2
2635
+ r0 = r2
2636
+ else
2637
+ @index = i0
2638
+ r0 = nil
2639
+ end
2622
2640
  end
2623
2641
 
2624
2642
  node_cache[:zone_name][start_index] = r0
@@ -215,7 +215,8 @@ module Timing
215
215
  end
216
216
 
217
217
  rule zone_name
218
- 'utc' <ZoneName>
218
+ 'utc' <ZoneName> /
219
+ 'z' <ZoneName>
219
220
  end
220
221
 
221
222
  rule hour_minute_second
@@ -310,8 +310,9 @@ module Timing
310
310
  end
311
311
 
312
312
  class ZoneName < Treetop::Runtime::SyntaxNode
313
+ UTC_VALUES = ['utc', 'z']
313
314
  def value
314
- if text_value.downcase == 'utc'
315
+ if UTC_VALUES.include? text_value.downcase
315
316
  '+0000'
316
317
  end
317
318
  end
@@ -1,3 +1,3 @@
1
1
  module Timing
2
- VERSION = '0.2.8'
2
+ VERSION = '0.2.9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Naiman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-02 00:00:00.000000000 Z
11
+ date: 2025-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: treetop