simpleidn 0.0.2 → 0.0.3
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.
- data.tar.gz.sig +0 -0
- data/Rakefile +1 -1
- data/lib/simpleidn.rb +2 -0
- data/simpleidn.gemspec +2 -2
- data/spec/idn.rb +11 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
|
|
3
3
|
require 'rake'
|
4
4
|
require 'echoe'
|
5
5
|
|
6
|
-
Echoe.new('simpleidn', '0.0.
|
6
|
+
Echoe.new('simpleidn', '0.0.3') do |p|
|
7
7
|
p.description = "This gem allows easy conversion from punycode ACE strings to unicode UTF-8 strings and visa versa."
|
8
8
|
p.url = "http://github.com/mmriis/simpleidn"
|
9
9
|
p.author = "Morten Møller Riis"
|
data/lib/simpleidn.rb
CHANGED
@@ -223,6 +223,7 @@ module SimpleIDN
|
|
223
223
|
# SimpleIDN.to_ascii("møllerriis.com")
|
224
224
|
# => "xn--mllerriis-l8a.com"
|
225
225
|
def to_ascii(domain)
|
226
|
+
return if domain.nil?
|
226
227
|
domain_array = domain.split(".")
|
227
228
|
out = []
|
228
229
|
i = 0
|
@@ -239,6 +240,7 @@ module SimpleIDN
|
|
239
240
|
# SimpleIDN.to_unicode("xn--mllerriis-l8a.com")
|
240
241
|
# => "møllerriis.com"
|
241
242
|
def to_unicode(domain)
|
243
|
+
return if domain.nil?
|
242
244
|
domain_array = domain.split(".")
|
243
245
|
out = []
|
244
246
|
i = 0
|
data/simpleidn.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "simpleidn"
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Morten M\303\270ller Riis"]
|
9
9
|
s.cert_chain = ["/Users/mmr/gem-public_cert.pem"]
|
10
|
-
s.date = "2011-10-
|
10
|
+
s.date = "2011-10-24"
|
11
11
|
s.description = "This gem allows easy conversion from punycode ACE strings to unicode UTF-8 strings and visa versa."
|
12
12
|
s.email = "mortenmoellerriis _AT_ gmail.com"
|
13
13
|
s.extra_rdoc_files = ["README.rdoc", "lib/simpleidn.rb"]
|
data/spec/idn.rb
CHANGED
@@ -14,7 +14,13 @@ describe "SimpleIDN" do
|
|
14
14
|
it "should respect * and not try to decode it" do
|
15
15
|
SimpleIDN.to_unicode("*.xn--mllerriis-l8a.com").should == "*.møllerriis.com"
|
16
16
|
end
|
17
|
+
|
18
|
+
it "should return nil for nil" do
|
19
|
+
SimpleIDN.to_unicode(nil).should be_nil
|
20
|
+
end
|
21
|
+
|
17
22
|
end
|
23
|
+
|
18
24
|
describe "to_ascii" do
|
19
25
|
it "should pass all test cases" do
|
20
26
|
TESTCASES_JOSEFSSON.sort.each do |testcase, vector|
|
@@ -25,5 +31,10 @@ describe "SimpleIDN" do
|
|
25
31
|
it "should respect * and not try to encode it" do
|
26
32
|
SimpleIDN.to_ascii("*.hello.com").should == "*.hello.com"
|
27
33
|
end
|
34
|
+
|
35
|
+
|
36
|
+
it "should return nil for nil" do
|
37
|
+
SimpleIDN.to_ascii(nil).should be_nil
|
38
|
+
end
|
28
39
|
end
|
29
40
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simpleidn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Morten M\xC3\xB8ller Riis"
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
Pv5fihHPGcYA3voHCFu2/KGlBiF8TBQ6
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date: 2011-10-
|
39
|
+
date: 2011-10-24 00:00:00 Z
|
40
40
|
dependencies: []
|
41
41
|
|
42
42
|
description: This gem allows easy conversion from punycode ACE strings to unicode UTF-8 strings and visa versa.
|
metadata.gz.sig
CHANGED
Binary file
|