uri-idna 0.2.2 → 0.3.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: a31f65444a2088912d65c6755cf7e1cb16ae1936c801245b29804f55414a6b67
4
- data.tar.gz: 1538c13b89e089e53f7d249ac6b3ce628e163bbd65d30f36cddc2b97007382b3
3
+ metadata.gz: bd8ddf703e0996a727c19429d111bb5dfa9de7c23bd9f1a0cec562a074cff038
4
+ data.tar.gz: b895559c831d332b4db6cb2bfc49fbe271f40a3b0478b404bed2612a344d1c60
5
5
  SHA512:
6
- metadata.gz: d26a6d183474bc619cf282d712874c06a91a522207c539ee9a1c67bf51474b3084e67dea2a1f2315b1852204eeea5b3df67bc20412a26d5bd18561dc3899833e
7
- data.tar.gz: 3b2d6a1ed2a1e79e55e9569959a5fcc86203e22696c03bbce33b788681385072026c4dcab2888346249856ffd0ea9a66a13071caa5309ba8c8cb7040af9a7d2e
6
+ metadata.gz: 1266311d92fbe7ddebd7cdc3bf183af1079f06fdef6b1bad22f8fb80a50136ecb15410f95a17485e50b86bebfa1986a4eeef9a6327ef590ce6d70f30f27c730f
7
+ data.tar.gz: d46b3df6143ef430a30835f7201a9bbac8b9bdf3eb76f8e0deebb9f043c47882dfd2faa2dec4f50cc9556fa6170da0647cde0e609776a6272f40dd10fcd57a22
data/CHANGELOG.md CHANGED
@@ -5,6 +5,21 @@ 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
+ ## [Unreleased]
9
+
10
+ ## [0.3.1] - 2025-06-17
11
+
12
+ ### Fixed
13
+
14
+ - Fix Ruby warnings. ([@y-yagi])
15
+
16
+ ## [0.3.0] - 2025-05-09
17
+
18
+ ### Fixed
19
+
20
+ - Allow empty labels in UTS46 and WHATWG. ([@skryukov])
21
+ - Update comment in data-files to mention rake command. ([@skryukov])
22
+
8
23
  ## [0.2.2] - 2023-11-25
9
24
 
10
25
  ### Changed
@@ -40,8 +55,11 @@ and this project adheres to [Semantic Versioning].
40
55
  - Initial implementation. ([@skryukov])
41
56
 
42
57
  [@skryukov]: https://github.com/skryukov
58
+ [@y-yagi]: https://github.com/y-yagi
43
59
 
44
- [Unreleased]: https://github.com/skryukov/uri-idna/compare/v0.2.2...HEAD
60
+ [Unreleased]: https://github.com/skryukov/uri-idna/compare/v0.3.1...HEAD
61
+ [0.3.1]: https://github.com/skryukov/uri-idna/compare/v0.3.0...v0.3.1
62
+ [0.3.0]: https://github.com/skryukov/uri-idna/compare/v0.2.2...v0.3.0
45
63
  [0.2.2]: https://github.com/skryukov/uri-idna/compare/v0.2.1...v0.2.2
46
64
  [0.2.1]: https://github.com/skryukov/uri-idna/compare/v0.2.0...v0.2.1
47
65
  [0.2.0]: https://github.com/skryukov/uri-idna/compare/v0.1.0...v0.2.0
data/README.md CHANGED
@@ -155,7 +155,7 @@ char.downcase.ord
155
155
  #=> 12068
156
156
 
157
157
  # but UTS46 mapping does it's thing:
158
- URI::IDNA::UTS46::Mapping.call(char).ord
158
+ URI::IDNA::UTS46::Mapping.call(char).ord
159
159
  #=> 22823
160
160
 
161
161
  # so here is a full example:
@@ -203,7 +203,7 @@ URI::IDNA.whatwg_to_ascii("2003_rules.com")
203
203
 
204
204
  ##### Options
205
205
 
206
- - `be_strict`: `true` - `be_strict`: `true` – defines value of `use_std3_ascii_rules` UTS46 option.
206
+ - `be_strict`: `true` - defines value of `use_std3_ascii_rules` UTS46 option.
207
207
 
208
208
  ```ruby
209
209
  require "uri/idna"
@@ -260,6 +260,8 @@ To set directory for generated files, use `DEST_DIR` environment variable, e.g.
260
260
 
261
261
  Unicode data cached in the `tmp` directory by default, to change it, use `CACHE_DIR` environment variable, e.g. `CACHE_DIR=~/.cache/unicode_data bundle exec rake idna:generate`.
262
262
 
263
+ _Note: `rake idna:generate` might generate different results on different versions of Ruby due to usage of built-in Unicode normalization methods._
264
+
263
265
  ### Inspect Unicode data
264
266
 
265
267
  To inspect Unicode data, run `bundle exec rake 'idna:inspect[<HEX_CODE>]'`.
@@ -45,7 +45,7 @@ module URI
45
45
  labels, trailing_dot = split_domain(domain)
46
46
 
47
47
  labels.map! do |label|
48
- raise Error, "Empty label" if label.empty?
48
+ raise Error, "Empty label" if label.empty? && options.verify_dns_length?
49
49
 
50
50
  yield label
51
51
  end
@@ -62,7 +62,7 @@ module URI
62
62
  labels = domain.split(".", -1)
63
63
  trailing_dot = labels[-1] && labels[-1].empty? ? labels.pop : false
64
64
 
65
- raise Error, "Empty domain" if labels.empty? || labels == [""]
65
+ raise Error, "Empty domain" if (labels.empty? || labels == [""]) && options.verify_dns_length?
66
66
 
67
67
  [labels, trailing_dot]
68
68
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # This file is automatically generated by bin/generate
3
+ # This file is automatically generated by rake idna:generate
4
4
  # Unicode version 15.1.0
5
5
 
6
6
  module URI
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # This file is automatically generated by bin/generate
3
+ # This file is automatically generated by rake idna:generate
4
4
  # Unicode version 15.1.0
5
5
 
6
6
  module URI
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # This file is automatically generated by bin/generate
3
+ # This file is automatically generated by rake idna:generate
4
4
  # Unicode version 15.1.0
5
5
 
6
6
  module URI
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # This file is automatically generated by bin/generate
3
+ # This file is automatically generated by rake idna:generate
4
4
  # Unicode version 15.1.0
5
5
 
6
6
  module URI
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # This file is automatically generated by bin/generate
3
+ # This file is automatically generated by rake idna:generate
4
4
  # Unicode version 15.1.0
5
5
 
6
6
  module URI
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # This file is automatically generated by bin/generate
3
+ # This file is automatically generated by rake idna:generate
4
4
  # Unicode version 15.1.0
5
5
 
6
6
  module URI
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # This file is automatically generated by bin/generate
3
+ # This file is automatically generated by rake idna:generate
4
4
  # Unicode version 15.1.0
5
5
 
6
6
  module URI
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # This file is automatically generated by bin/generate
3
+ # This file is automatically generated by rake idna:generate
4
4
  # Unicode version 15.1.0
5
5
 
6
6
  module URI
@@ -13,10 +13,10 @@ module URI
13
13
 
14
14
  MAP_REGEX = Regexp.new("#{REGEX_M_STRING}|#{REGEX_I_STRING}").freeze
15
15
  REGEX_NOT_V = Regexp.new("[^#{REGEX_V_STRING}]").freeze
16
- REGEX_NOT_VD = Regexp.new("[^#{REGEX_V_STRING}|#{REGEX_D_STRING}]").freeze
17
- REGEX_NOT_V3 = Regexp.new("[^#{REGEX_V_STRING}|#{REGEX_STD3_M_STRING}|#{REGEX_STD3_V_STRING}]").freeze
16
+ REGEX_NOT_VD = Regexp.new("[^#{REGEX_V_STRING}#{REGEX_D_STRING}]").freeze
17
+ REGEX_NOT_V3 = Regexp.new("[^#{REGEX_V_STRING}#{REGEX_STD3_M_STRING}#{REGEX_STD3_V_STRING}]").freeze
18
18
  REGEX_NOT_VD3 = Regexp.new(
19
- "[^#{REGEX_V_STRING}|#{REGEX_D_STRING}|#{REGEX_STD3_M_STRING}|#{REGEX_STD3_V_STRING}]",
19
+ "[^#{REGEX_V_STRING}#{REGEX_D_STRING}#{REGEX_STD3_M_STRING}#{REGEX_STD3_V_STRING}]",
20
20
  ).freeze
21
21
 
22
22
  def call(domain_name, transitional_processing: false, use_std3_ascii_rules: true)
@@ -53,6 +53,10 @@ module URI
53
53
  def ignore_invalid_punycode?
54
54
  (@flags & IGNORE_INVALID_PUNYCODE) != 0
55
55
  end
56
+
57
+ def verify_dns_length?
58
+ false
59
+ end
56
60
  end
57
61
 
58
62
  # Options for ToASCII operation
@@ -8,7 +8,7 @@ module URI
8
8
  module IDNAPermitted
9
9
  class << self
10
10
  IDNA_REGEX = Regexp.new(
11
- "[^(#{CODEPOINT_CLASSES['PVALID']}|#{CODEPOINT_CLASSES['CONTEXTJ']}|#{CODEPOINT_CLASSES['CONTEXTO']})]",
11
+ "[^#{CODEPOINT_CLASSES['PVALID']}#{CODEPOINT_CLASSES['CONTEXTJ']}#{CODEPOINT_CLASSES['CONTEXTO']}]",
12
12
  ).freeze
13
13
 
14
14
  # https://datatracker.ietf.org/doc/html/rfc5891#section-4.2.2
@@ -2,6 +2,6 @@
2
2
 
3
3
  module URI
4
4
  module IDNA
5
- VERSION = "0.2.2"
5
+ VERSION = "0.3.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uri-idna
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svyatoslav Kryukov
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-11-25 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: Internationalized Domain Names in Applications (IDNA)
14
13
  email:
@@ -55,7 +54,6 @@ metadata:
55
54
  homepage_uri: https://github.com/skryukov/uri-idna
56
55
  source_code_uri: https://github.com/skryukov/uri-idna
57
56
  rubygems_mfa_required: 'true'
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.3.7
74
- signing_key:
71
+ rubygems_version: 3.6.7
75
72
  specification_version: 4
76
73
  summary: Internationalized Domain Names for Ruby (IDNA2008, UTS46 and WHATWG)
77
74
  test_files: []