yeptris 0.1.5.0 → 0.1.5.1

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: 452666559ee9d904b6f4a75f4f6ec6f18d90d518e5b708069dbaad23b9f782b1
4
- data.tar.gz: 72364220f5c04c168a8a2a98f9e9567a4291e951e062f267cedc35dbac9e6c1a
3
+ metadata.gz: 45c9ffb9d3764fce864ccc1ffab5ac6112c110883bc32929e15c1ee156e6dea6
4
+ data.tar.gz: 21ea720b0f2e2d9d9bc9e679a5291a7663e258822b1dd2c39005e71e5c4eb55f
5
5
  SHA512:
6
- metadata.gz: b14eac3ed7686f125fb53b82c61d8186913f125534c41f998bb7b7a712e951057a5495696cc73a68e93e92b4ee9d167bb5e32835e6d7dace7254973cf625c72d
7
- data.tar.gz: '0872f3ac4b779be90d3f72e78bb118fe3d9150b8cc43f2159fff0c5b0e0fa861f0df8b55ec6a70a4bf9a1a7b5ef94d97bb55f53301c83e8a736af3583ad7185b'
6
+ metadata.gz: 668eae34b9f8b1958c9fd0561464dc1b255f37d3911708b4e341cdf57c8293be506001d2d47c7380404012b8b1e288925950fa896173d2fa21927521c1e08bc9
7
+ data.tar.gz: 497cefd3df85bb955a723c7a0151b9283470cc917a4d0cea594d47349b00ac5363f7497321d72d6e11812836d62c4031c4bf85ae85d08573a7723a8f3be4b130
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yeptris
4
- VERSION = "0.1.5.0"
4
+ VERSION = "0.1.5.1"
5
5
  end
data/lib/yeptris/yaml.rb CHANGED
@@ -152,6 +152,9 @@ module Yeptris
152
152
  # verdicts by the differential spec (spec/yaml_spec.rb).
153
153
  RESHAPES = %w[~ null Null NULL y Y yes Yes YES n N no No NO true True
154
154
  TRUE false False FALSE on On ON off Off OFF <<].freeze
155
+ # the fast lane consults the reshape table per string: an Array
156
+ # scan of 36 words was ~a third of the whole dump walk
157
+ RESHAPES_SET = RESHAPES.each_with_object({}) { |w, h| h[w] = true }.freeze
155
158
 
156
159
  SAFE_WORD = /\A[A-Za-z][A-Za-z0-9_\-.\/ ]*\z/
157
160
 
@@ -159,7 +162,7 @@ module Yeptris
159
162
  # fast lane: letter-started, safe characters incl. spaces — no
160
163
  # number/timestamp/indicator shape is possible; only the
161
164
  # reshape words need the set lookup
162
- if SAFE_WORD.match?(s) && !s.end_with?(" ") && !RESHAPES.include?(s)
165
+ if SAFE_WORD.match?(s) && !s.end_with?(" ") && !RESHAPES_SET[s]
163
166
  return true
164
167
  end
165
168
  return false if s.empty? || s != s.strip
@@ -168,7 +171,7 @@ module Yeptris
168
171
  return false if "#,[]{}&*!|>'\"%@`".include?(c)
169
172
  return false if "-?:".include?(c) && (s.length == 1 || s[1] =~ /[ \t]/)
170
173
  return false if s.include?(": ") || s.end_with?(":") || s.include?(" #")
171
- return false if RESHAPES.include?(s)
174
+ return false if RESHAPES_SET[s]
172
175
  # compat's float grammar REQUIRES the dot ("1e3" re-reads as a
173
176
  # String and may dump plain); ints/sexagesimals still reshape
174
177
  return false if s.match?(/\A[-+]?(0|[1-9][0-9_]*)(:[0-5]?[0-9])+\z/)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yeptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5.0
4
+ version: 0.1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-09-04 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: ffi
@@ -55,7 +54,6 @@ metadata:
55
54
  homepage_uri: https://github.com/leptris/yeptris
56
55
  source_code_uri: https://github.com/leptris/yeptris
57
56
  changelog_uri: https://github.com/leptris/yeptris/releases
58
- post_install_message:
59
57
  rdoc_options: []
60
58
  require_paths:
61
59
  - lib
@@ -70,8 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
68
  - !ruby/object:Gem::Version
71
69
  version: '0'
72
70
  requirements: []
73
- rubygems_version: 3.5.22
74
- signing_key:
71
+ rubygems_version: 4.0.16
75
72
  specification_version: 4
76
73
  summary: 'The YAML counterpart of libleptris: ultra-performance YAML 1.2 for Ruby'
77
74
  test_files: []