uri-idna 0.2.1 → 0.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 +4 -4
- data/CHANGELOG.md +8 -2
- data/lib/uri/idna/base_processing.rb +12 -6
- data/lib/uri/idna/data/bidi_classes.rb +1973 -0
- data/lib/uri/idna/data/codepoint_classes.rb +1226 -0
- data/lib/uri/idna/data/joining_types.rb +839 -0
- data/lib/uri/idna/data/leading_combiners.rb +321 -0
- data/lib/uri/idna/data/scripts.rb +108 -0
- data/lib/uri/idna/data/unicode_version.rb +10 -0
- data/lib/uri/idna/data/uts46.rb +8459 -8179
- data/lib/uri/idna/data/virama_combining_classes.rb +67 -0
- data/lib/uri/idna/idna2008/processing.rb +13 -28
- data/lib/uri/idna/punycode.rb +11 -9
- data/lib/uri/idna/uts46/mapping.rb +39 -37
- data/lib/uri/idna/uts46/processing.rb +14 -15
- data/lib/uri/idna/validation/bidi.rb +34 -52
- data/lib/uri/idna/validation/contextj.rb +62 -0
- data/lib/uri/idna/validation/contexto.rb +61 -0
- data/lib/uri/idna/validation/idna_permitted.rb +30 -0
- data/lib/uri/idna/validation/label.rb +1 -14
- data/lib/uri/idna/validation/leading_combining.rb +23 -0
- data/lib/uri/idna/version.rb +1 -1
- metadata +15 -7
- data/lib/uri/idna/data/idna.rb +0 -4697
- data/lib/uri/idna/intranges.rb +0 -57
- data/lib/uri/idna/validation/codepoint.rb +0 -128
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a31f65444a2088912d65c6755cf7e1cb16ae1936c801245b29804f55414a6b67
|
4
|
+
data.tar.gz: 1538c13b89e089e53f7d249ac6b3ce628e163bbd65d30f36cddc2b97007382b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d26a6d183474bc619cf282d712874c06a91a522207c539ee9a1c67bf51474b3084e67dea2a1f2315b1852204eeea5b3df67bc20412a26d5bd18561dc3899833e
|
7
|
+
data.tar.gz: 3b2d6a1ed2a1e79e55e9569959a5fcc86203e22696c03bbce33b788681385072026c4dcab2888346249856ffd0ea9a66a13071caa5309ba8c8cb7040af9a7d2e
|
data/CHANGELOG.md
CHANGED
@@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog],
|
6
6
|
and this project adheres to [Semantic Versioning].
|
7
7
|
|
8
|
-
## [
|
8
|
+
## [0.2.2] - 2023-11-25
|
9
|
+
|
10
|
+
### Changed
|
11
|
+
|
12
|
+
- Internal implementation moved to regex-based algorithm to improve performance. ([@skryukov])
|
9
13
|
|
10
14
|
## [0.2.1] - 2023-11-15
|
11
15
|
|
@@ -37,7 +41,9 @@ and this project adheres to [Semantic Versioning].
|
|
37
41
|
|
38
42
|
[@skryukov]: https://github.com/skryukov
|
39
43
|
|
40
|
-
[Unreleased]: https://github.com/skryukov/uri-idna/compare/v0.2.
|
44
|
+
[Unreleased]: https://github.com/skryukov/uri-idna/compare/v0.2.2...HEAD
|
45
|
+
[0.2.2]: https://github.com/skryukov/uri-idna/compare/v0.2.1...v0.2.2
|
46
|
+
[0.2.1]: https://github.com/skryukov/uri-idna/compare/v0.2.0...v0.2.1
|
41
47
|
[0.2.0]: https://github.com/skryukov/uri-idna/compare/v0.1.0...v0.2.0
|
42
48
|
[0.1.0]: https://github.com/skryukov/uri-idna/commits/v0.1.0
|
43
49
|
|
@@ -1,27 +1,33 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "validation/label"
|
4
|
-
require_relative "validation/codepoint"
|
5
4
|
require_relative "validation/bidi"
|
6
5
|
|
7
6
|
module URI
|
8
7
|
module IDNA
|
9
8
|
class BaseProcessing
|
9
|
+
class << self
|
10
|
+
def default_options
|
11
|
+
@default_options ||= options_class.new
|
12
|
+
end
|
13
|
+
|
14
|
+
def options_class
|
15
|
+
raise NotImplementedError, "Implement #options_class method"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
10
19
|
def initialize(domain_name, **options)
|
11
20
|
@domain_name = domain_name
|
12
|
-
@options = options_class.new(**options)
|
21
|
+
@options = options.any? ? self.class.options_class.new(**options) : self.class.default_options
|
13
22
|
end
|
14
23
|
|
15
24
|
private
|
16
25
|
|
17
26
|
attr_reader :domain_name, :options
|
18
27
|
|
19
|
-
def options_class
|
20
|
-
raise NotImplementedError, "Implement #options_class method"
|
21
|
-
end
|
22
|
-
|
23
28
|
def punycode_decode(label)
|
24
29
|
raise Error, "Label contains non-ASCII code point" unless label.ascii_only?
|
30
|
+
raise Error, "A-label must not end with a hyphen" if label[-1] == "-"
|
25
31
|
|
26
32
|
code = label[ACE_PREFIX.length..]
|
27
33
|
raise Error, "Malformed A-label, no Punycode eligible content found" if code.empty?
|