uri-idna 0.2.2 → 0.3.0

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: e0be96c995cea54b44d066d20834e442c4f228ddaeccfb47288c61ebcc35f120
4
+ data.tar.gz: 366f2c3f1c9e20e9ad5bd65b61a4c8a6bda1612d35f30089858424dcdc2af3a3
5
5
  SHA512:
6
- metadata.gz: d26a6d183474bc619cf282d712874c06a91a522207c539ee9a1c67bf51474b3084e67dea2a1f2315b1852204eeea5b3df67bc20412a26d5bd18561dc3899833e
7
- data.tar.gz: 3b2d6a1ed2a1e79e55e9569959a5fcc86203e22696c03bbce33b788681385072026c4dcab2888346249856ffd0ea9a66a13071caa5309ba8c8cb7040af9a7d2e
6
+ metadata.gz: 90bf436ab38aee10300a5d3f0ccc9700884ce7b98f99552cf9092f3b60224e75c79d7fb611e3791bdd9965b74717fef8e1425efcebbee0ee21dff5987bf2201f
7
+ data.tar.gz: 4e03e4bbf53ae6f2f1349efef8fed20869d2dd3f9b3af1a4e15e826899ed0ea58be2803ab866ce83bdc34198bdba184ef5c27aa19b3b4e3dd2547d3850d6cb8f
data/CHANGELOG.md CHANGED
@@ -5,6 +5,15 @@ 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.0] - 2025-05-09
11
+
12
+ ### Fixed
13
+
14
+ - Allow empty labels in UTS46 and WHATWG. ([@skryukov])
15
+ - Update comment in data-files to mention rake command. ([@skryukov])
16
+
8
17
  ## [0.2.2] - 2023-11-25
9
18
 
10
19
  ### Changed
@@ -41,7 +50,8 @@ and this project adheres to [Semantic Versioning].
41
50
 
42
51
  [@skryukov]: https://github.com/skryukov
43
52
 
44
- [Unreleased]: https://github.com/skryukov/uri-idna/compare/v0.2.2...HEAD
53
+ [Unreleased]: https://github.com/skryukov/uri-idna/compare/v0.3.0...HEAD
54
+ [0.3.0]: https://github.com/skryukov/uri-idna/compare/v0.2.2...v0.3.0
45
55
  [0.2.2]: https://github.com/skryukov/uri-idna/compare/v0.2.1...v0.2.2
46
56
  [0.2.1]: https://github.com/skryukov/uri-idna/compare/v0.2.0...v0.2.1
47
57
  [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
@@ -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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module URI
4
4
  module IDNA
5
- VERSION = "0.2.2"
5
+ VERSION = "0.3.0"
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.0
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: 2025-05-09 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.2
75
72
  specification_version: 4
76
73
  summary: Internationalized Domain Names for Ruby (IDNA2008, UTS46 and WHATWG)
77
74
  test_files: []