simpleidn 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +3 -1
- data/lib/simpleidn.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbff0e8f2c02135040f6ce79aa7400f1fb4e4329
|
4
|
+
data.tar.gz: 755dfe2f0c621b57080bea4c5793816e92ced4c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 670cbaa7ada6f97efcfa5170e64cde78d5d43ae054ab32fec1bd77c669f32888c69f4af54d8109ae6ce29afc1282b2e325174f2d14aee6960991c13498416696
|
7
|
+
data.tar.gz: 023b37009fe2128e99da467cb9771a195dcb8523430b7008c4417450e8dc1a9cef53caa1e2d37441e54ab4c6a2c4f71f28746e86cef24c059030b7e9f241efc6
|
data/README.rdoc
CHANGED
@@ -34,4 +34,6 @@ http://www.gnu.org/software/libidn/draft-josefsson-idn-test-vectors.html
|
|
34
34
|
|
35
35
|
== Known issues
|
36
36
|
|
37
|
-
|
37
|
+
Does not preserve uppercase. So if, for some reason, you use uppercase characters (eg. Ø instead of ø), please take note of that.
|
38
|
+
|
39
|
+
Please report any issues!
|
data/lib/simpleidn.rb
CHANGED
@@ -18,7 +18,7 @@ end
|
|
18
18
|
|
19
19
|
module SimpleIDN
|
20
20
|
|
21
|
-
VERSION = "0.0.
|
21
|
+
VERSION = "0.0.7"
|
22
22
|
|
23
23
|
# The ConversionError is raised when an error occurs during a
|
24
24
|
# Punycode <-> Unicode conversion.
|
@@ -151,7 +151,7 @@ module SimpleIDN
|
|
151
151
|
|
152
152
|
# Main encode function
|
153
153
|
def encode(input)
|
154
|
-
input = input.
|
154
|
+
input = input.unpack("U*")
|
155
155
|
output = []
|
156
156
|
|
157
157
|
# Initialize the state:
|
@@ -235,7 +235,7 @@ module SimpleIDN
|
|
235
235
|
i = 0
|
236
236
|
while i < domain_array.length
|
237
237
|
s = domain_array[i]
|
238
|
-
out << (s =~ /[^A-Z0-9
|
238
|
+
out << (s =~ /[^A-Z0-9@\-*_]/i ? "xn--" + Punycode.encode(s) : s)
|
239
239
|
i += 1
|
240
240
|
end
|
241
241
|
return out.join(".")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simpleidn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Morten Møller Riis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|