rbgccxml 1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -4
- data/lib/rbgccxml.rb +1 -0
- data/lib/rbgccxml/nodes/method_type.rb +9 -0
- data/lib/rbgccxml/sax_parser.rb +1 -1
- data/{test → spec}/arguments_test.rb +0 -0
- data/{test → spec}/classes_test.rb +0 -0
- data/{test → spec}/enumerations_test.rb +0 -0
- data/{test → spec}/function_pointers_test.rb +0 -0
- data/{test → spec}/functions_test.rb +0 -0
- data/{test → spec}/methods_test.rb +1 -1
- data/{test → spec}/namespaces_test.rb +0 -0
- data/{test → spec}/node_test.rb +0 -0
- data/{test → spec}/parser_test.rb +0 -0
- data/spec/pointer_to_member_test.rb +35 -0
- data/{test → spec}/query_results_test.rb +0 -0
- data/{test → spec}/structs_test.rb +0 -0
- data/{test → spec}/test_helper.rb +0 -0
- data/{test → spec}/types_test.rb +0 -0
- data/{test → spec}/variables_test.rb +0 -0
- metadata +44 -17
data/Rakefile
CHANGED
@@ -5,14 +5,13 @@ require 'rake/gempackagetask'
|
|
5
5
|
require 'rspec/core/rake_task'
|
6
6
|
|
7
7
|
PROJECT_NAME = "rbgccxml"
|
8
|
-
RBGCCXML_VERSION = "1.0"
|
8
|
+
RBGCCXML_VERSION = "1.0.1"
|
9
9
|
|
10
10
|
task :default => :spec
|
11
11
|
|
12
12
|
desc "Run all specs"
|
13
13
|
RSpec::Core::RakeTask.new do |t|
|
14
|
-
t.
|
15
|
-
t.pattern = "test/**/*.rb"
|
14
|
+
t.pattern = "spec/**/*_test.rb"
|
16
15
|
end
|
17
16
|
|
18
17
|
Rake::RDocTask.new do |rd|
|
@@ -73,7 +72,7 @@ what you want out of the C++ source code
|
|
73
72
|
|
74
73
|
s.files = patterns.map {|p| Dir.glob(p) }.flatten
|
75
74
|
|
76
|
-
s.test_files = Dir.glob('
|
75
|
+
s.test_files = Dir.glob('spec/**/*.rb')
|
77
76
|
|
78
77
|
s.require_paths = ['lib']
|
79
78
|
end
|
data/lib/rbgccxml.rb
CHANGED
@@ -24,6 +24,7 @@ module RbGCCXML
|
|
24
24
|
autoload :File, "rbgccxml/nodes/file"
|
25
25
|
autoload :FunctionType, "rbgccxml/nodes/function_type"
|
26
26
|
autoload :Function, "rbgccxml/nodes/function"
|
27
|
+
autoload :MethodType, "rbgccxml/nodes/method_type"
|
27
28
|
autoload :Method, "rbgccxml/nodes/method"
|
28
29
|
autoload :Namespace, "rbgccxml/nodes/namespace"
|
29
30
|
autoload :Struct, "rbgccxml/nodes/struct"
|
data/lib/rbgccxml/sax_parser.rb
CHANGED
@@ -35,7 +35,7 @@ module RbGCCXML
|
|
35
35
|
NESTED_NODES = %w(Argument Base EnumValue)
|
36
36
|
|
37
37
|
def start_element(name, attributes = [])
|
38
|
-
attr_hash = Hash[*attributes]
|
38
|
+
attr_hash = Hash[*attributes.flatten]
|
39
39
|
|
40
40
|
# Need to build a node in memory for those
|
41
41
|
# that we don't directly support
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/{test → spec}/node_test.rb
RENAMED
File without changes
|
File without changes
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
describe "Pointer to member function or member variable" do
|
4
|
+
before(:all) do
|
5
|
+
@ptm_source = RbGCCXML.parse(
|
6
|
+
full_dir("headers/pointer_to_member.h")).namespaces("pointer_to_member")
|
7
|
+
end
|
8
|
+
|
9
|
+
specify "finds the test struct" do
|
10
|
+
xyz = @ptm_source.structs("xyz_t")
|
11
|
+
xyz.should be_a_kind_of(RbGCCXML::Struct)
|
12
|
+
xyz.methods('do_something').should be_a_kind_of(RbGCCXML::Method)
|
13
|
+
xyz.variables('m_some_member').should be_a_kind_of(RbGCCXML::Field)
|
14
|
+
end
|
15
|
+
|
16
|
+
specify "finds pointer to member variable" do
|
17
|
+
mvar_ptr = @ptm_source.children.find {|c| c.name == 'mvar_ptr_t'}
|
18
|
+
mvar_ptr.should be_a_kind_of(RbGCCXML::Typedef)
|
19
|
+
|
20
|
+
mvar_ptr_type = RbGCCXML::NodeCache.find(mvar_ptr.attributes["type"])
|
21
|
+
mvar_ptr_type.should be_a_kind_of(RbGCCXML::Node) # OffsetType?
|
22
|
+
end
|
23
|
+
|
24
|
+
specify "finds pointer to member function" do
|
25
|
+
mfun_ptr = @ptm_source.children.find {|c| c.name == 'mfun_ptr_t'}
|
26
|
+
mfun_ptr.should be_a_kind_of(RbGCCXML::Typedef)
|
27
|
+
|
28
|
+
mfun_ptr_type = RbGCCXML::NodeCache.find(mfun_ptr.attributes["type"])
|
29
|
+
mfun_ptr_type.should be_a_kind_of(RbGCCXML::PointerType)
|
30
|
+
|
31
|
+
type = RbGCCXML::NodeCache.find(mfun_ptr_type.attributes["type"])
|
32
|
+
type.should be_a_kind_of(RbGCCXML::MethodType)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
File without changes
|
File without changes
|
File without changes
|
data/{test → spec}/types_test.rb
RENAMED
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbgccxml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 1
|
7
8
|
- 0
|
8
|
-
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
9
11
|
platform: ruby
|
10
12
|
authors:
|
11
13
|
- Jason Roelofs
|
@@ -13,16 +15,18 @@ autorequire:
|
|
13
15
|
bindir: bin
|
14
16
|
cert_chain: []
|
15
17
|
|
16
|
-
date: 2010-
|
18
|
+
date: 2010-12-17 00:00:00 -05:00
|
17
19
|
default_executable:
|
18
20
|
dependencies:
|
19
21
|
- !ruby/object:Gem::Dependency
|
20
22
|
name: nokogiri
|
21
23
|
prerelease: false
|
22
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - ~>
|
25
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
26
30
|
segments:
|
27
31
|
- 1
|
28
32
|
- 4
|
@@ -34,9 +38,11 @@ dependencies:
|
|
34
38
|
name: gccxml_gem
|
35
39
|
prerelease: false
|
36
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
43
|
- - ~>
|
39
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 25
|
40
46
|
segments:
|
41
47
|
- 0
|
42
48
|
- 9
|
@@ -73,6 +79,7 @@ files:
|
|
73
79
|
- lib/rbgccxml/nodes/function.rb
|
74
80
|
- lib/rbgccxml/nodes/function_type.rb
|
75
81
|
- lib/rbgccxml/nodes/method.rb
|
82
|
+
- lib/rbgccxml/nodes/method_type.rb
|
76
83
|
- lib/rbgccxml/nodes/namespace.rb
|
77
84
|
- lib/rbgccxml/nodes/struct.rb
|
78
85
|
- lib/rbgccxml/nodes/type.rb
|
@@ -90,6 +97,21 @@ files:
|
|
90
97
|
- lib/rbgccxml/sax_parser.rb
|
91
98
|
- lib/rbgccxml.rb
|
92
99
|
- lib/vendor/facets/once.rb
|
100
|
+
- spec/arguments_test.rb
|
101
|
+
- spec/classes_test.rb
|
102
|
+
- spec/enumerations_test.rb
|
103
|
+
- spec/function_pointers_test.rb
|
104
|
+
- spec/functions_test.rb
|
105
|
+
- spec/methods_test.rb
|
106
|
+
- spec/namespaces_test.rb
|
107
|
+
- spec/node_test.rb
|
108
|
+
- spec/parser_test.rb
|
109
|
+
- spec/pointer_to_member_test.rb
|
110
|
+
- spec/query_results_test.rb
|
111
|
+
- spec/structs_test.rb
|
112
|
+
- spec/test_helper.rb
|
113
|
+
- spec/types_test.rb
|
114
|
+
- spec/variables_test.rb
|
93
115
|
has_rdoc: true
|
94
116
|
homepage: http://rbplusplus.rubyforge.org/rbgccxml
|
95
117
|
licenses: []
|
@@ -100,38 +122,43 @@ rdoc_options: []
|
|
100
122
|
require_paths:
|
101
123
|
- lib
|
102
124
|
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
103
126
|
requirements:
|
104
127
|
- - ">="
|
105
128
|
- !ruby/object:Gem::Version
|
129
|
+
hash: 3
|
106
130
|
segments:
|
107
131
|
- 0
|
108
132
|
version: "0"
|
109
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
|
+
none: false
|
110
135
|
requirements:
|
111
136
|
- - ">="
|
112
137
|
- !ruby/object:Gem::Version
|
138
|
+
hash: 3
|
113
139
|
segments:
|
114
140
|
- 0
|
115
141
|
version: "0"
|
116
142
|
requirements: []
|
117
143
|
|
118
144
|
rubyforge_project: rbplusplus
|
119
|
-
rubygems_version: 1.3.
|
145
|
+
rubygems_version: 1.3.7
|
120
146
|
signing_key:
|
121
147
|
specification_version: 3
|
122
148
|
summary: Ruby interface to GCCXML
|
123
149
|
test_files:
|
124
|
-
-
|
125
|
-
-
|
126
|
-
-
|
127
|
-
-
|
128
|
-
-
|
129
|
-
-
|
130
|
-
-
|
131
|
-
-
|
132
|
-
-
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
136
|
-
-
|
137
|
-
-
|
150
|
+
- spec/arguments_test.rb
|
151
|
+
- spec/classes_test.rb
|
152
|
+
- spec/enumerations_test.rb
|
153
|
+
- spec/function_pointers_test.rb
|
154
|
+
- spec/functions_test.rb
|
155
|
+
- spec/methods_test.rb
|
156
|
+
- spec/namespaces_test.rb
|
157
|
+
- spec/node_test.rb
|
158
|
+
- spec/parser_test.rb
|
159
|
+
- spec/pointer_to_member_test.rb
|
160
|
+
- spec/query_results_test.rb
|
161
|
+
- spec/structs_test.rb
|
162
|
+
- spec/test_helper.rb
|
163
|
+
- spec/types_test.rb
|
164
|
+
- spec/variables_test.rb
|