idn_ffi 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -1
- data/lib/idn_ffi/methods.rb +3 -3
- data/lib/idn_ffi/version.rb +1 -1
- metadata +76 -63
data/README.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
#LibIdn FFI ruby binding
|
2
2
|
|
3
|
+
```
|
4
|
+
sudo apt-get install libidn11
|
5
|
+
```
|
6
|
+
|
7
|
+
Gemfile:
|
3
8
|
```ruby
|
4
9
|
gem 'idn_ffi'
|
5
10
|
```
|
@@ -10,4 +15,4 @@ IDNFFI.to_ascii "топ-site.рф"
|
|
10
15
|
|
11
16
|
IDNFFI.to_unicode "xn---site-iyehw.xn--p1ai"
|
12
17
|
=> "топ-site.рф"
|
13
|
-
```
|
18
|
+
```
|
data/lib/idn_ffi/methods.rb
CHANGED
@@ -21,7 +21,7 @@ private
|
|
21
21
|
return unless str
|
22
22
|
pointer = FFI::MemoryPointer.new :pointer
|
23
23
|
int = IDNFFI::Lib.send(method, str, pointer, flags)
|
24
|
-
raise Error, "bad answer from libidn #{ind}, http://www.gnu.org/software/libidn/reference/libidn-idna.html#IDNA-SUCCESS:CAPS" if int != 0
|
24
|
+
raise IDNFFI::Error, "bad answer from libidn #{ind}, http://www.gnu.org/software/libidn/reference/libidn-idna.html#IDNA-SUCCESS:CAPS" if int != 0
|
25
25
|
strptr = pointer.read_pointer()
|
26
26
|
result = strptr.read_string()
|
27
27
|
pointer.free
|
@@ -33,7 +33,7 @@ private
|
|
33
33
|
return unless str
|
34
34
|
pointer = FFI::MemoryPointer.new :pointer
|
35
35
|
int = IDNFFI::Lib.send(method, str, pointer, flags)
|
36
|
-
raise Error, "bad answer from libidn #{ind}, http://www.gnu.org/software/libidn/reference/libidn-idna.html#IDNA-SUCCESS:CAPS" if int != 0
|
36
|
+
raise IDNFFI::Error, "bad answer from libidn #{ind}, http://www.gnu.org/software/libidn/reference/libidn-idna.html#IDNA-SUCCESS:CAPS" if int != 0
|
37
37
|
strptr = pointer.read_pointer()
|
38
38
|
result = strptr.read_string()
|
39
39
|
pointer.free
|
@@ -41,4 +41,4 @@ private
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
end
|
44
|
+
end
|
data/lib/idn_ffi/version.rb
CHANGED
metadata
CHANGED
@@ -1,71 +1,75 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: idn_ffi
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Konstantin Makarchev
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
|
18
|
+
date: 2012-11-30 00:00:00 +04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
17
23
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
22
|
-
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 3
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
23
31
|
prerelease: false
|
24
|
-
|
32
|
+
type: :runtime
|
33
|
+
requirement: *id001
|
34
|
+
name: ffi
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
25
37
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
hash: 3
|
42
|
+
segments:
|
43
|
+
- 0
|
44
|
+
version: "0"
|
45
|
+
prerelease: false
|
46
|
+
type: :development
|
47
|
+
requirement: *id002
|
31
48
|
name: rake
|
32
|
-
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
33
51
|
none: false
|
34
|
-
requirements:
|
35
|
-
- -
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
|
38
|
-
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
hash: 3
|
56
|
+
segments:
|
57
|
+
- 0
|
58
|
+
version: "0"
|
39
59
|
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: rspec
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
60
|
type: :development
|
55
|
-
|
56
|
-
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
requirement: *id003
|
62
|
+
name: rspec
|
62
63
|
description: LibIdn FFI ruby binding
|
63
|
-
email:
|
64
|
+
email:
|
64
65
|
- kostya27@gmail.com
|
65
66
|
executables: []
|
67
|
+
|
66
68
|
extensions: []
|
69
|
+
|
67
70
|
extra_rdoc_files: []
|
68
|
-
|
71
|
+
|
72
|
+
files:
|
69
73
|
- .gitignore
|
70
74
|
- Gemfile
|
71
75
|
- LICENSE
|
@@ -78,31 +82,40 @@ files:
|
|
78
82
|
- lib/idn_ffi/version.rb
|
79
83
|
- spec/idn_spec.rb
|
80
84
|
- spec/test_vectors.rb
|
85
|
+
has_rdoc: true
|
81
86
|
homepage: https://github.com/kostya/idn_ffi
|
82
87
|
licenses: []
|
88
|
+
|
83
89
|
post_install_message:
|
84
90
|
rdoc_options: []
|
85
|
-
|
91
|
+
|
92
|
+
require_paths:
|
86
93
|
- lib
|
87
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
88
95
|
none: false
|
89
|
-
requirements:
|
90
|
-
- -
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
|
93
|
-
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
hash: 3
|
100
|
+
segments:
|
101
|
+
- 0
|
102
|
+
version: "0"
|
103
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
104
|
none: false
|
95
|
-
requirements:
|
96
|
-
- -
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
hash: 3
|
109
|
+
segments:
|
110
|
+
- 0
|
111
|
+
version: "0"
|
99
112
|
requirements: []
|
113
|
+
|
100
114
|
rubyforge_project:
|
101
|
-
rubygems_version: 1.
|
115
|
+
rubygems_version: 1.4.2
|
102
116
|
signing_key:
|
103
117
|
specification_version: 3
|
104
118
|
summary: LibIdn FFI ruby binding
|
105
|
-
test_files:
|
119
|
+
test_files:
|
106
120
|
- spec/idn_spec.rb
|
107
121
|
- spec/test_vectors.rb
|
108
|
-
has_rdoc:
|