gir_ffi 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -0
- data/Rakefile +0 -18
- data/TODO.rdoc +1 -1
- data/lib/gir_ffi/arg_helper.rb +165 -35
- data/lib/gir_ffi/builder.rb +4 -3
- data/lib/gir_ffi/class_base.rb +11 -3
- data/lib/gir_ffi/class_builder.rb +49 -35
- data/lib/gir_ffi/function_definition_builder.rb +194 -64
- data/lib/gir_ffi/i_arg_info.rb +3 -0
- data/lib/gir_ffi/i_callback_info.rb +1 -1
- data/lib/gir_ffi/i_interface_info.rb +67 -2
- data/lib/gir_ffi/i_repository.rb +5 -0
- data/lib/gir_ffi/lib.rb +22 -1
- data/lib/gir_ffi/module_builder.rb +1 -0
- data/lib/gir_ffi/overrides/gobject.rb +16 -13
- data/lib/gir_ffi/overrides/gtk.rb +1 -1
- data/tasks/notes.rake +12 -25
- data/tasks/setup.rb +0 -132
- data/tasks/test.rake +4 -12
- data/test/arg_helper_test.rb +25 -7
- data/test/builder_test.rb +36 -21
- data/test/class_base_test.rb +0 -7
- data/test/class_builder_test.rb +6 -0
- data/test/everything_test.rb +427 -1
- data/test/function_definition_builder_test.rb +69 -12
- data/test/gobject_overrides_test.rb +12 -3
- data/test/test_helper.rb +5 -0
- metadata +8 -10
- data/tasks/bones.rake +0 -87
- data/tasks/post_load.rake +0 -25
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gir_ffi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matijs van Zuijlen
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-12-
|
18
|
+
date: 2010-12-30 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -26,12 +26,12 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 31
|
30
30
|
segments:
|
31
|
+
- 1
|
31
32
|
- 0
|
32
|
-
-
|
33
|
-
|
34
|
-
version: 0.6.3
|
33
|
+
- 4
|
34
|
+
version: 1.0.4
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|
@@ -131,9 +131,7 @@ files:
|
|
131
131
|
- test/everything_test.rb
|
132
132
|
- test/builder_test.rb
|
133
133
|
- test/gtk_overrides_test.rb
|
134
|
-
- tasks/bones.rake
|
135
134
|
- tasks/test.rake
|
136
|
-
- tasks/post_load.rake
|
137
135
|
- tasks/setup.rb
|
138
136
|
- tasks/notes.rake
|
139
137
|
- examples/demo_ffi_safe_inherited_layout.rb
|
data/tasks/bones.rake
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
# The following code is copied straight from Bones 2.5.1
|
2
|
-
#
|
3
|
-
require 'pp'
|
4
|
-
require 'stringio'
|
5
|
-
|
6
|
-
module Bones
|
7
|
-
|
8
|
-
# Helper module that will pretty print OpenStruct objects. It is used mainly
|
9
|
-
# for debugging the Mr Bones project open struct.
|
10
|
-
#
|
11
|
-
module Debug
|
12
|
-
|
13
|
-
# :stopdoc:
|
14
|
-
KEY_LENGTH = 20
|
15
|
-
VAR_LENGTH = 78 - 6 - KEY_LENGTH
|
16
|
-
SEP = "\n" + ' '*(KEY_LENGTH+6)
|
17
|
-
FMT = " %-#{KEY_LENGTH}s => %s"
|
18
|
-
# :startdoc:
|
19
|
-
|
20
|
-
# Print all the keys for the given _ostruct_ to stdout. If a _prefix_ is
|
21
|
-
# given, then the open struct keys will be prefixed with this string.
|
22
|
-
#
|
23
|
-
def self.show( ostruct, prefix = '' )
|
24
|
-
sio = StringIO.new
|
25
|
-
|
26
|
-
h = ostruct.instance_variable_get(:@table)
|
27
|
-
h.keys.map {|k| k.to_s}.sort.each do |k|
|
28
|
-
sio.seek 0
|
29
|
-
sio.truncate 0
|
30
|
-
next if k =~ %r/^_/o
|
31
|
-
|
32
|
-
val = h[k.to_sym]
|
33
|
-
if val.instance_of?(OpenStruct)
|
34
|
-
self.show(val, prefix + k + '.')
|
35
|
-
else
|
36
|
-
PP.pp(val, sio, VAR_LENGTH)
|
37
|
-
sio.seek 0
|
38
|
-
val = sio.read
|
39
|
-
val = val.split("\n").join(SEP)
|
40
|
-
|
41
|
-
key = prefix + k
|
42
|
-
key[(KEY_LENGTH-3)..-1] = '...' if key.length > KEY_LENGTH
|
43
|
-
puts(FMT % [key, val])
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# Print a single attribute from the given _ostruct_ to stdout. The
|
49
|
-
# attributed is identified by the given _key_.
|
50
|
-
#
|
51
|
-
def self.show_attr( ostruct, key )
|
52
|
-
sio = StringIO.new
|
53
|
-
|
54
|
-
key = key.dup if key.frozen?
|
55
|
-
val = key.split('.').inject(ostruct) {|os,k| os.send(k)}
|
56
|
-
|
57
|
-
if val.instance_of?(OpenStruct)
|
58
|
-
self.show(val, key + '.')
|
59
|
-
else
|
60
|
-
PP.pp(val, sio, VAR_LENGTH)
|
61
|
-
sio.seek 0
|
62
|
-
val = sio.read
|
63
|
-
val = val.split("\n").join(SEP)
|
64
|
-
|
65
|
-
key[(KEY_LENGTH-3)..-1] = '...' if key.length > KEY_LENGTH
|
66
|
-
puts(FMT % [key, val])
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
end # module Debug
|
71
|
-
end # module Bones
|
72
|
-
|
73
|
-
namespace :bones do
|
74
|
-
|
75
|
-
desc 'Show the PROJ open struct'
|
76
|
-
task :debug do |t|
|
77
|
-
atr = if t.application.top_level_tasks.length == 2
|
78
|
-
t.application.top_level_tasks.pop
|
79
|
-
end
|
80
|
-
|
81
|
-
if atr then Bones::Debug.show_attr(PROJ, atr)
|
82
|
-
else Bones::Debug.show PROJ end
|
83
|
-
end
|
84
|
-
|
85
|
-
end # namespace :bones
|
86
|
-
|
87
|
-
# EOF
|
data/tasks/post_load.rake
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
|
2
|
-
# This file does not define any rake tasks. It is used to load some project
|
3
|
-
# settings if they are not defined by the user.
|
4
|
-
|
5
|
-
PROJ.exclude << ["^#{Regexp.escape(PROJ.ignore_file)}$"]
|
6
|
-
|
7
|
-
flatten_arrays = lambda do |this,os|
|
8
|
-
os.instance_variable_get(:@table).each do |key,val|
|
9
|
-
next if key == :dependencies \
|
10
|
-
or key == :development_dependencies
|
11
|
-
case val
|
12
|
-
when Array; val.flatten!
|
13
|
-
when OpenStruct; this.call(this,val)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
flatten_arrays.call(flatten_arrays,PROJ)
|
18
|
-
|
19
|
-
PROJ.changes ||= paragraphs_of(PROJ.history_file, 0..1).join("\n\n")
|
20
|
-
|
21
|
-
PROJ.description ||= paragraphs_of(PROJ.readme_file, 'description').join("\n\n")
|
22
|
-
|
23
|
-
PROJ.summary ||= PROJ.description.split('.').first
|
24
|
-
|
25
|
-
# EOF
|