simpleidn 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/Rakefile +1 -1
- data/lib/simpleidn.rb +1 -1
- data/simpleidn.gemspec +11 -11
- data/spec/idn.rb +9 -2
- data/spec/test_vectors.rb +1 -0
- metadata +15 -5
- 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.2') 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
@@ -228,7 +228,7 @@ module SimpleIDN
|
|
228
228
|
i = 0
|
229
229
|
while i < domain_array.length
|
230
230
|
s = domain_array[i]
|
231
|
-
out << (s =~ /[^A-Z0-9
|
231
|
+
out << (s =~ /[^A-Z0-9\-*]/i ? "xn--" + Punycode.encode(s) : s)
|
232
232
|
i += 1
|
233
233
|
end
|
234
234
|
return out.join(".")
|
data/simpleidn.gemspec
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
|
-
s.name =
|
5
|
-
s.version = "0.0.
|
4
|
+
s.name = "simpleidn"
|
5
|
+
s.version = "0.0.2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = ["Morten
|
8
|
+
s.authors = ["Morten M\303\270ller Riis"]
|
9
9
|
s.cert_chain = ["/Users/mmr/gem-public_cert.pem"]
|
10
|
-
s.date =
|
11
|
-
s.description =
|
12
|
-
s.email =
|
10
|
+
s.date = "2011-10-10"
|
11
|
+
s.description = "This gem allows easy conversion from punycode ACE strings to unicode UTF-8 strings and visa versa."
|
12
|
+
s.email = "mortenmoellerriis _AT_ gmail.com"
|
13
13
|
s.extra_rdoc_files = ["README.rdoc", "lib/simpleidn.rb"]
|
14
14
|
s.files = ["LICENCE", "Manifest", "README.rdoc", "Rakefile", "lib/simpleidn.rb", "simpleidn.gemspec", "spec/idn.rb", "spec/test_vectors.rb"]
|
15
|
-
s.homepage =
|
15
|
+
s.homepage = "http://github.com/mmriis/simpleidn"
|
16
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Simpleidn", "--main", "README.rdoc"]
|
17
17
|
s.require_paths = ["lib"]
|
18
|
-
s.rubyforge_project =
|
19
|
-
s.rubygems_version =
|
20
|
-
s.signing_key =
|
21
|
-
s.summary =
|
18
|
+
s.rubyforge_project = "simpleidn"
|
19
|
+
s.rubygems_version = "1.8.11"
|
20
|
+
s.signing_key = "/Users/mmr/gem-private_key.pem"
|
21
|
+
s.summary = "This gem allows easy conversion from punycode ACE strings to unicode UTF-8 strings and visa versa."
|
22
22
|
|
23
23
|
if s.respond_to? :specification_version then
|
24
24
|
s.specification_version = 3
|
data/spec/idn.rb
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
require 'rspec'
|
3
3
|
require 'simpleidn'
|
4
4
|
require 'test_vectors'
|
5
|
-
|
6
5
|
|
7
6
|
describe "SimpleIDN" do
|
8
7
|
describe "to_unicode" do
|
@@ -11,12 +10,20 @@ describe "SimpleIDN" do
|
|
11
10
|
SimpleIDN.to_unicode(vector[1]).should == vector[0]
|
12
11
|
end
|
13
12
|
end
|
13
|
+
|
14
|
+
it "should respect * and not try to decode it" do
|
15
|
+
SimpleIDN.to_unicode("*.xn--mllerriis-l8a.com").should == "*.møllerriis.com"
|
16
|
+
end
|
14
17
|
end
|
15
18
|
describe "to_ascii" do
|
16
19
|
it "should pass all test cases" do
|
17
20
|
TESTCASES_JOSEFSSON.sort.each do |testcase, vector|
|
18
|
-
|
21
|
+
SimpleIDN.to_ascii(vector[0]).should == vector[1].downcase
|
19
22
|
end
|
20
23
|
end
|
24
|
+
|
25
|
+
it "should respect * and not try to encode it" do
|
26
|
+
SimpleIDN.to_ascii("*.hello.com").should == "*.hello.com"
|
27
|
+
end
|
21
28
|
end
|
22
29
|
end
|
data/spec/test_vectors.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simpleidn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- "Morten M\xC3\xB8ller Riis"
|
@@ -31,8 +36,7 @@ cert_chain:
|
|
31
36
|
Pv5fihHPGcYA3voHCFu2/KGlBiF8TBQ6
|
32
37
|
-----END CERTIFICATE-----
|
33
38
|
|
34
|
-
date: 2011-
|
35
|
-
default_executable:
|
39
|
+
date: 2011-10-10 00:00:00 Z
|
36
40
|
dependencies: []
|
37
41
|
|
38
42
|
description: This gem allows easy conversion from punycode ACE strings to unicode UTF-8 strings and visa versa.
|
@@ -53,7 +57,6 @@ files:
|
|
53
57
|
- simpleidn.gemspec
|
54
58
|
- spec/idn.rb
|
55
59
|
- spec/test_vectors.rb
|
56
|
-
has_rdoc: true
|
57
60
|
homepage: http://github.com/mmriis/simpleidn
|
58
61
|
licenses: []
|
59
62
|
|
@@ -72,17 +75,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
72
75
|
requirements:
|
73
76
|
- - ">="
|
74
77
|
- !ruby/object:Gem::Version
|
78
|
+
hash: 3
|
79
|
+
segments:
|
80
|
+
- 0
|
75
81
|
version: "0"
|
76
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
83
|
none: false
|
78
84
|
requirements:
|
79
85
|
- - ">="
|
80
86
|
- !ruby/object:Gem::Version
|
87
|
+
hash: 11
|
88
|
+
segments:
|
89
|
+
- 1
|
90
|
+
- 2
|
81
91
|
version: "1.2"
|
82
92
|
requirements: []
|
83
93
|
|
84
94
|
rubyforge_project: simpleidn
|
85
|
-
rubygems_version: 1.
|
95
|
+
rubygems_version: 1.8.11
|
86
96
|
signing_key:
|
87
97
|
specification_version: 3
|
88
98
|
summary: This gem allows easy conversion from punycode ACE strings to unicode UTF-8 strings and visa versa.
|
metadata.gz.sig
CHANGED
Binary file
|