tidy_ffi 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +1 -0
- data/Rakefile +2 -1
- data/lib/tidy_ffi/interface.rb +11 -11
- data/tidy_ffi.gemspec +8 -9
- metadata +8 -9
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -5,9 +5,10 @@ begin
|
|
5
5
|
p.author = 'Eugene Pimenov'
|
6
6
|
p.summary = 'Tidy library interface via FFI'
|
7
7
|
p.url = 'http://github.com/libc/tidy_ffi'
|
8
|
-
p.runtime_dependencies = ['ffi >=
|
8
|
+
p.runtime_dependencies = ['ffi >=0.3.5']
|
9
9
|
# p.development_dependencies = ['rr', 'matchy', 'context']
|
10
10
|
p.project = 'tidy-ffi'
|
11
|
+
p.email = 'libc@libc.st'
|
11
12
|
p.rdoc_pattern = /^(lib|bin|tasks|ext)|^README\.rdoc|^CHANGELOG|^TODO|^LICENSE|^COPYING$/
|
12
13
|
p.retain_gemspec = true
|
13
14
|
end
|
data/lib/tidy_ffi/interface.rb
CHANGED
@@ -90,24 +90,24 @@ class TidyFFI::Interface
|
|
90
90
|
#
|
91
91
|
# Some tidy options might try to trespass as integer, and in order to caught
|
92
92
|
# perpertraitors we need to call tidyOptGetPickList
|
93
|
-
def
|
93
|
+
def pick_list_for(opt)
|
94
94
|
iterator = LibTidy.tidyOptGetPickList(opt)
|
95
95
|
|
96
96
|
return nil if iterator.null?
|
97
97
|
|
98
|
-
|
98
|
+
pick_list = []
|
99
99
|
|
100
|
-
MemoryPointer.new(:pointer) do |pointer|
|
100
|
+
FFI::MemoryPointer.new(:pointer, 1) do |pointer|
|
101
101
|
pointer.put_pointer(0, iterator)
|
102
102
|
until iterator.null?
|
103
|
-
|
103
|
+
pick_list << LibTidy.tidyOptGetNextPick(opt, pointer)
|
104
104
|
iterator = pointer.get_pointer(0)
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
|
-
|
108
|
+
pick_list
|
109
109
|
end
|
110
|
-
private :
|
110
|
+
private :pick_list_for
|
111
111
|
|
112
112
|
# Loads default options.
|
113
113
|
def load_default_options
|
@@ -118,7 +118,7 @@ class TidyFFI::Interface
|
|
118
118
|
|
119
119
|
@default_options = {}
|
120
120
|
|
121
|
-
MemoryPointer.new(:pointer) do |pointer|
|
121
|
+
FFI::MemoryPointer.new(:pointer, 1) do |pointer|
|
122
122
|
pointer.put_pointer(0, iterator)
|
123
123
|
|
124
124
|
until iterator.null?
|
@@ -133,10 +133,10 @@ class TidyFFI::Interface
|
|
133
133
|
when :string
|
134
134
|
(LibTidy.tidyOptGetDefault(opt) rescue "")
|
135
135
|
when :integer
|
136
|
-
if
|
136
|
+
if pick_list = pick_list_for(opt)
|
137
137
|
option[:type] = :enum
|
138
|
-
option[:values] =
|
139
|
-
|
138
|
+
option[:values] = pick_list
|
139
|
+
pick_list[LibTidy.tidyOptGetDefaultInt(opt)]
|
140
140
|
else
|
141
141
|
LibTidy.tidyOptGetDefaultInt(opt)
|
142
142
|
end
|
@@ -149,8 +149,8 @@ class TidyFFI::Interface
|
|
149
149
|
iterator = pointer.get_pointer(0)
|
150
150
|
end
|
151
151
|
|
152
|
-
@default_options.freeze
|
153
152
|
end
|
153
|
+
@default_options.freeze
|
154
154
|
ensure
|
155
155
|
LibTidy.tidyRelease(doc)
|
156
156
|
end
|
data/tidy_ffi.gemspec
CHANGED
@@ -2,34 +2,33 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{tidy_ffi}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Eugene Pimenov"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-06-07}
|
10
10
|
s.description = %q{Tidy library interface via FFI}
|
11
|
-
s.email = %q{}
|
11
|
+
s.email = %q{libc@libc.st}
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.rdoc", "lib/tidy_ffi/interface.rb", "lib/tidy_ffi/lib_tidy.rb", "lib/tidy_ffi/options_container.rb", "lib/tidy_ffi/tidy.rb", "lib/tidy_ffi/tidy_ffi_extensions.rb", "lib/tidy_ffi.rb"]
|
13
13
|
s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.rdoc", "Rakefile", "lib/tidy_ffi/interface.rb", "lib/tidy_ffi/lib_tidy.rb", "lib/tidy_ffi/options_container.rb", "lib/tidy_ffi/tidy.rb", "lib/tidy_ffi/tidy_ffi_extensions.rb", "lib/tidy_ffi.rb", "test/test_helper.rb", "test/test_lowlevel.rb", "test/test_options.rb", "test/test_simple.rb", "tidy_ffi.gemspec"]
|
14
|
-
s.has_rdoc = true
|
15
14
|
s.homepage = %q{http://github.com/libc/tidy_ffi}
|
16
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Tidy_ffi", "--main", "README.rdoc"]
|
17
16
|
s.require_paths = ["lib"]
|
18
17
|
s.rubyforge_project = %q{tidy-ffi}
|
19
|
-
s.rubygems_version = %q{1.3.
|
18
|
+
s.rubygems_version = %q{1.3.3}
|
20
19
|
s.summary = %q{Tidy library interface via FFI}
|
21
20
|
s.test_files = ["test/test_helper.rb", "test/test_lowlevel.rb", "test/test_options.rb", "test/test_simple.rb"]
|
22
21
|
|
23
22
|
if s.respond_to? :specification_version then
|
24
23
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
25
|
-
s.specification_version =
|
24
|
+
s.specification_version = 3
|
26
25
|
|
27
26
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
28
|
-
s.add_runtime_dependency(%q<ffi>, [">= 0
|
27
|
+
s.add_runtime_dependency(%q<ffi>, [">= 0.3.5"])
|
29
28
|
else
|
30
|
-
s.add_dependency(%q<ffi>, [">= 0
|
29
|
+
s.add_dependency(%q<ffi>, [">= 0.3.5"])
|
31
30
|
end
|
32
31
|
else
|
33
|
-
s.add_dependency(%q<ffi>, [">= 0
|
32
|
+
s.add_dependency(%q<ffi>, [">= 0.3.5"])
|
34
33
|
end
|
35
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tidy_ffi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eugene Pimenov
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-06-07 00:00:00 +04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,13 +20,10 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version:
|
24
|
-
- - "="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 0.2.0
|
23
|
+
version: 0.3.5
|
27
24
|
version:
|
28
25
|
description: Tidy library interface via FFI
|
29
|
-
email:
|
26
|
+
email: libc@libc.st
|
30
27
|
executables: []
|
31
28
|
|
32
29
|
extensions: []
|
@@ -60,6 +57,8 @@ files:
|
|
60
57
|
- tidy_ffi.gemspec
|
61
58
|
has_rdoc: true
|
62
59
|
homepage: http://github.com/libc/tidy_ffi
|
60
|
+
licenses: []
|
61
|
+
|
63
62
|
post_install_message:
|
64
63
|
rdoc_options:
|
65
64
|
- --line-numbers
|
@@ -85,9 +84,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
84
|
requirements: []
|
86
85
|
|
87
86
|
rubyforge_project: tidy-ffi
|
88
|
-
rubygems_version: 1.3.
|
87
|
+
rubygems_version: 1.3.3
|
89
88
|
signing_key:
|
90
|
-
specification_version:
|
89
|
+
specification_version: 3
|
91
90
|
summary: Tidy library interface via FFI
|
92
91
|
test_files:
|
93
92
|
- test/test_helper.rb
|