idn-ruby 0.1.2 → 0.1.5
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/CHANGES +13 -0
- data/README.md +8 -3
- data/ext/extconf.rb +2 -0
- data/ext/stringprep.c +4 -1
- data/test/tc_Stringprep.rb +4 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2adb4d83908e191f088eb24930ba0b5abad1b1965196a358cd5ab937c50f347f
|
4
|
+
data.tar.gz: 024ce9f73c14ac9041b88d014dc3f1d5021ac2819190341bcd22f8ba10c34b79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27ae3f1953fb321d497d8024c4c23f3e3fa398180a3f5692821fc489056d29e5785d7efb4fb8ae7b7813505a059809bd5dda9e84ca475c809d7fd26a08f656c9
|
7
|
+
data.tar.gz: 229386ef58c08aebc05998d3871a3d0fbd15845426e99057046342b8b9b9affb2abb42f20143196552a6762e8c8b679177a1e5b7f3e3cf38ebe3396adaee02cc
|
data/CHANGES
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
Changes with IDN 0.1.5 (2022-11-16)
|
2
|
+
|
3
|
+
* Minor updates to support compilation of M1 silicon.
|
4
|
+
|
5
|
+
Changes with IDN 0.1.4 (2021-11-02)
|
6
|
+
|
7
|
+
* nfkc_normalize raises ArgumentError instead of returning nil for
|
8
|
+
invalid utf-8 strings.
|
9
|
+
|
10
|
+
Changes with IDN 0.1.3 (2021-11-01)
|
11
|
+
|
12
|
+
* Fixed segv in latest ruby-head with bad utf-8
|
13
|
+
|
1
14
|
Changes with IDN 0.1.2 (2021-06-10)
|
2
15
|
|
3
16
|
* add missing includes
|
data/README.md
CHANGED
@@ -52,24 +52,29 @@ Simply invoke the standard RubyGems commands (install, update, ...),
|
|
52
52
|
for example:
|
53
53
|
|
54
54
|
```bash
|
55
|
-
gem install --remote
|
55
|
+
gem install --remote idn-ruby
|
56
56
|
```
|
57
57
|
|
58
58
|
or if the GNU LibIDN library can only be found in a non-standard location
|
59
59
|
|
60
60
|
```bash
|
61
|
-
gem install --remote
|
61
|
+
gem install --remote idn-ruby \
|
62
62
|
--with-idn-dir=/path/to/non/standard/location
|
63
63
|
```
|
64
64
|
|
65
65
|
or in an even more complex setup
|
66
66
|
|
67
67
|
```bash
|
68
|
-
gem install --remote
|
68
|
+
gem install --remote idn-ruby -- \
|
69
69
|
--with-idn-lib=/path/to/non/standard/location/lib \
|
70
70
|
--with-idn-include=/path/to/non/standard/location/include
|
71
71
|
```
|
72
72
|
|
73
|
+
#### Apple silicon
|
74
|
+
```
|
75
|
+
gem install idn-ruby -- --with-idn-dir=$(brew --prefix libidn)
|
76
|
+
```
|
77
|
+
|
73
78
|
#### Semi-automatic installation with Rake
|
74
79
|
|
75
80
|
If you are not able to or don't want to use RubyGems you can simply
|
data/ext/extconf.rb
CHANGED
data/ext/stringprep.c
CHANGED
@@ -155,7 +155,10 @@ static VALUE nfkc_normalize(VALUE self, VALUE str)
|
|
155
155
|
|
156
156
|
str = rb_check_convert_type(str, T_STRING, "String", "to_s");
|
157
157
|
buf = stringprep_utf8_nfkc_normalize(RSTRING_PTR(str), RSTRING_LEN(str));
|
158
|
-
|
158
|
+
if (!buf) {
|
159
|
+
rb_raise(rb_eArgError, "Invalid string or encoding, normalize failed");
|
160
|
+
return Qnil;
|
161
|
+
}
|
159
162
|
retv = rb_utf8_str_new_cstr(buf);
|
160
163
|
idn_free(buf);
|
161
164
|
return retv;
|
data/test/tc_Stringprep.rb
CHANGED
@@ -77,5 +77,9 @@ class Test_Stringprep < Test::Unit::TestCase
|
|
77
77
|
rc = Stringprep.nfkc_normalize(val[0])
|
78
78
|
assert_equal(val[1], rc, "TestCase #{key} failed")
|
79
79
|
end
|
80
|
+
|
81
|
+
assert_raise(ArgumentError, "TestCase \xE8 failed") do
|
82
|
+
Stringprep.nfkc_normalize("\xE8")
|
83
|
+
end
|
80
84
|
end
|
81
85
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idn-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Abele
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-11-01 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: "\n Ruby Bindings for the GNU LibIDN library, an implementation of
|
15
15
|
the\n Stringprep, Punycode and IDNA specifications defined by the IETF\n Internationalized
|
@@ -58,8 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '0'
|
60
60
|
requirements: []
|
61
|
-
|
62
|
-
rubygems_version: 2.7.6
|
61
|
+
rubygems_version: 3.2.19
|
63
62
|
signing_key:
|
64
63
|
specification_version: 3
|
65
64
|
summary: LibIDN Ruby Bindings.
|