dub 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dub might be problematic. Click here for more details.

Files changed (142) hide show
  1. data/.gitignore +8 -0
  2. data/History.txt +5 -0
  3. data/LICENSE +20 -0
  4. data/README.rdoc +53 -0
  5. data/Rakefile +58 -0
  6. data/dub.gemspec +194 -0
  7. data/lib/dub/argument.rb +261 -0
  8. data/lib/dub/entities_unescape.rb +16 -0
  9. data/lib/dub/function.rb +111 -0
  10. data/lib/dub/function_group.rb +74 -0
  11. data/lib/dub/generator.rb +15 -0
  12. data/lib/dub/group.rb +10 -0
  13. data/lib/dub/klass.rb +231 -0
  14. data/lib/dub/lua/class.cpp.erb +75 -0
  15. data/lib/dub/lua/class_gen.rb +78 -0
  16. data/lib/dub/lua/function.cpp.erb +4 -0
  17. data/lib/dub/lua/function_gen.rb +223 -0
  18. data/lib/dub/lua/group.cpp.erb +10 -0
  19. data/lib/dub/lua/lua_cpp_helper.h +141 -0
  20. data/lib/dub/lua/namespace.cpp.erb +35 -0
  21. data/lib/dub/lua/namespace_gen.rb +86 -0
  22. data/lib/dub/lua.rb +24 -0
  23. data/lib/dub/member_extraction.rb +88 -0
  24. data/lib/dub/namespace.rb +276 -0
  25. data/lib/dub/parser.rb +46 -0
  26. data/lib/dub/templates/lua_template.erb +21 -0
  27. data/lib/dub/version.rb +3 -0
  28. data/lib/dub.rb +26 -0
  29. data/test/argument_test.rb +423 -0
  30. data/test/fixtures/app/CMakeLists.txt +54 -0
  31. data/test/fixtures/app/Doxyfile +1600 -0
  32. data/test/fixtures/app/bindings/all_lua.cpp +299 -0
  33. data/test/fixtures/app/include/matrix.h +123 -0
  34. data/test/fixtures/app/make_lua_bindings.rb +13 -0
  35. data/test/fixtures/app/vendor/lua/CMakeLists.txt +25 -0
  36. data/test/fixtures/app/vendor/lua/COPYRIGHT +34 -0
  37. data/test/fixtures/app/vendor/lua/HISTORY +183 -0
  38. data/test/fixtures/app/vendor/lua/INSTALL +99 -0
  39. data/test/fixtures/app/vendor/lua/Makefile +183 -0
  40. data/test/fixtures/app/vendor/lua/README +37 -0
  41. data/test/fixtures/app/vendor/lua/lapi.c +1080 -0
  42. data/test/fixtures/app/vendor/lua/lapi.h +16 -0
  43. data/test/fixtures/app/vendor/lua/lauxlib.c +653 -0
  44. data/test/fixtures/app/vendor/lua/lauxlib.h +174 -0
  45. data/test/fixtures/app/vendor/lua/lbaselib.c +643 -0
  46. data/test/fixtures/app/vendor/lua/lcode.c +839 -0
  47. data/test/fixtures/app/vendor/lua/lcode.h +76 -0
  48. data/test/fixtures/app/vendor/lua/ldblib.c +397 -0
  49. data/test/fixtures/app/vendor/lua/ldebug.c +622 -0
  50. data/test/fixtures/app/vendor/lua/ldebug.h +33 -0
  51. data/test/fixtures/app/vendor/lua/ldo.c +516 -0
  52. data/test/fixtures/app/vendor/lua/ldo.h +57 -0
  53. data/test/fixtures/app/vendor/lua/ldump.c +164 -0
  54. data/test/fixtures/app/vendor/lua/lfunc.c +174 -0
  55. data/test/fixtures/app/vendor/lua/lfunc.h +34 -0
  56. data/test/fixtures/app/vendor/lua/lgc.c +711 -0
  57. data/test/fixtures/app/vendor/lua/lgc.h +110 -0
  58. data/test/fixtures/app/vendor/lua/liblua.a +0 -0
  59. data/test/fixtures/app/vendor/lua/linit.c +38 -0
  60. data/test/fixtures/app/vendor/lua/liolib.c +532 -0
  61. data/test/fixtures/app/vendor/lua/llex.c +461 -0
  62. data/test/fixtures/app/vendor/lua/llex.h +81 -0
  63. data/test/fixtures/app/vendor/lua/llimits.h +128 -0
  64. data/test/fixtures/app/vendor/lua/lmathlib.c +263 -0
  65. data/test/fixtures/app/vendor/lua/lmem.c +86 -0
  66. data/test/fixtures/app/vendor/lua/lmem.h +49 -0
  67. data/test/fixtures/app/vendor/lua/loadlib.c +664 -0
  68. data/test/fixtures/app/vendor/lua/lobject.c +214 -0
  69. data/test/fixtures/app/vendor/lua/lobject.h +381 -0
  70. data/test/fixtures/app/vendor/lua/lopcodes.c +102 -0
  71. data/test/fixtures/app/vendor/lua/lopcodes.h +268 -0
  72. data/test/fixtures/app/vendor/lua/loslib.c +244 -0
  73. data/test/fixtures/app/vendor/lua/lparser.c +1337 -0
  74. data/test/fixtures/app/vendor/lua/lparser.h +82 -0
  75. data/test/fixtures/app/vendor/lua/lstate.c +214 -0
  76. data/test/fixtures/app/vendor/lua/lstate.h +168 -0
  77. data/test/fixtures/app/vendor/lua/lstring.c +111 -0
  78. data/test/fixtures/app/vendor/lua/lstring.h +31 -0
  79. data/test/fixtures/app/vendor/lua/lstrlib.c +868 -0
  80. data/test/fixtures/app/vendor/lua/ltable.c +588 -0
  81. data/test/fixtures/app/vendor/lua/ltable.h +40 -0
  82. data/test/fixtures/app/vendor/lua/ltablib.c +278 -0
  83. data/test/fixtures/app/vendor/lua/ltm.c +75 -0
  84. data/test/fixtures/app/vendor/lua/ltm.h +54 -0
  85. data/test/fixtures/app/vendor/lua/lua.c +695 -0
  86. data/test/fixtures/app/vendor/lua/lua.h +385 -0
  87. data/test/fixtures/app/vendor/lua/lua_dub_helper.h +77 -0
  88. data/test/fixtures/app/vendor/lua/luac +0 -0
  89. data/test/fixtures/app/vendor/lua/luac.c +200 -0
  90. data/test/fixtures/app/vendor/lua/luaconf.h +762 -0
  91. data/test/fixtures/app/vendor/lua/lualib.h +53 -0
  92. data/test/fixtures/app/vendor/lua/lundump.c +223 -0
  93. data/test/fixtures/app/vendor/lua/lundump.h +36 -0
  94. data/test/fixtures/app/vendor/lua/lvm.c +765 -0
  95. data/test/fixtures/app/vendor/lua/lvm.h +36 -0
  96. data/test/fixtures/app/vendor/lua/lzio.c +82 -0
  97. data/test/fixtures/app/vendor/lua/lzio.h +67 -0
  98. data/test/fixtures/app/vendor/lua/matrix.h +102 -0
  99. data/test/fixtures/app/vendor/lua/print.c +227 -0
  100. data/test/fixtures/app/vendor/lua/test/README +26 -0
  101. data/test/fixtures/app/vendor/lua/test/bisect.lua +27 -0
  102. data/test/fixtures/app/vendor/lua/test/cf.lua +16 -0
  103. data/test/fixtures/app/vendor/lua/test/echo.lua +5 -0
  104. data/test/fixtures/app/vendor/lua/test/env.lua +7 -0
  105. data/test/fixtures/app/vendor/lua/test/factorial.lua +32 -0
  106. data/test/fixtures/app/vendor/lua/test/fib.lua +40 -0
  107. data/test/fixtures/app/vendor/lua/test/fibfor.lua +13 -0
  108. data/test/fixtures/app/vendor/lua/test/globals.lua +13 -0
  109. data/test/fixtures/app/vendor/lua/test/hello.lua +3 -0
  110. data/test/fixtures/app/vendor/lua/test/life.lua +111 -0
  111. data/test/fixtures/app/vendor/lua/test/luac.lua +7 -0
  112. data/test/fixtures/app/vendor/lua/test/printf.lua +7 -0
  113. data/test/fixtures/app/vendor/lua/test/readonly.lua +12 -0
  114. data/test/fixtures/app/vendor/lua/test/sieve.lua +29 -0
  115. data/test/fixtures/app/vendor/lua/test/sort.lua +66 -0
  116. data/test/fixtures/app/vendor/lua/test/table.lua +12 -0
  117. data/test/fixtures/app/vendor/lua/test/trace-calls.lua +32 -0
  118. data/test/fixtures/app/vendor/lua/test/trace-globals.lua +38 -0
  119. data/test/fixtures/app/vendor/lua/test/xd.lua +14 -0
  120. data/test/fixtures/app/xml/classdub_1_1_matrix.xml +239 -0
  121. data/test/fixtures/app/xml/classdub_1_1_t_mat.xml +233 -0
  122. data/test/fixtures/app/xml/combine.xslt +15 -0
  123. data/test/fixtures/app/xml/compound.xsd +814 -0
  124. data/test/fixtures/app/xml/dir_53661a2bdeb1d55e60581a7e15deb763.xml +12 -0
  125. data/test/fixtures/app/xml/index.xml +42 -0
  126. data/test/fixtures/app/xml/index.xsd +66 -0
  127. data/test/fixtures/app/xml/matrix_8h.xml +149 -0
  128. data/test/fixtures/app/xml/namespacedub.xml +41 -0
  129. data/test/fixtures/classcv_1_1_mat.xml +1996 -0
  130. data/test/fixtures/classcv_1_1_point__.xml +341 -0
  131. data/test/fixtures/classcv_1_1_size__.xml +270 -0
  132. data/test/fixtures/group___magic_type.xml +406 -0
  133. data/test/fixtures/namespacecv.xml +12659 -0
  134. data/test/function_group_test.rb +15 -0
  135. data/test/function_test.rb +252 -0
  136. data/test/group_test.rb +155 -0
  137. data/test/helper.rb +34 -0
  138. data/test/klass_test.rb +297 -0
  139. data/test/lua_function_gen_test.rb +179 -0
  140. data/test/namespace_test.rb +220 -0
  141. data/test/parser_test.rb +36 -0
  142. metadata +216 -0
@@ -0,0 +1,36 @@
1
+ require 'helper'
2
+
3
+ class ParserTest < Test::Unit::TestCase
4
+ # cache parsing to speed things up
5
+ @@namespace = Dub.parse(fixture('namespacecv.xml'))
6
+ @@group = Dub.parse(fixture('group___magic_type.xml'))
7
+
8
+ context 'Parsing a namespace' do
9
+ setup do
10
+ @parser = @@namespace
11
+ end
12
+
13
+ should 'find cv namespace with namespace method' do
14
+ assert_kind_of Dub::Namespace, @parser.namespace(:cv)
15
+ end
16
+
17
+ should 'find namespace with array index' do
18
+ assert_kind_of Dub::Namespace, @parser[:cv]
19
+ end
20
+ end
21
+
22
+ context 'Parsing a group' do
23
+ setup do
24
+ @parser = @@group
25
+ end
26
+
27
+ should 'find MagicType group with group method' do
28
+ assert_kind_of Dub::Namespace, @parser.group(:MagicType)
29
+ end
30
+
31
+ should 'find group with array index' do
32
+ assert_kind_of Dub::Namespace, @parser[:MagicType]
33
+ end
34
+ end
35
+
36
+ end
metadata ADDED
@@ -0,0 +1,216 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dub
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ platform: ruby
6
+ authors:
7
+ - Gaspard Bucher
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-03-03 00:00:00 +01:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: shoulda
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ description: |-
26
+ This is a tool to ease the creation of scripting language bindings for a C++ library.
27
+ It is currently developed to crete the OpenCV bindings for Lua in Rubyk (http://rubyk.org). The generator uses the xml output from Doxygen to avoid parsing C++ code by itself.
28
+ email: gaspard@teti.ch
29
+ executables: []
30
+
31
+ extensions: []
32
+
33
+ extra_rdoc_files:
34
+ - LICENSE
35
+ - README.rdoc
36
+ files:
37
+ - .gitignore
38
+ - History.txt
39
+ - LICENSE
40
+ - README.rdoc
41
+ - Rakefile
42
+ - dub.gemspec
43
+ - lib/dub.rb
44
+ - lib/dub/argument.rb
45
+ - lib/dub/entities_unescape.rb
46
+ - lib/dub/function.rb
47
+ - lib/dub/function_group.rb
48
+ - lib/dub/generator.rb
49
+ - lib/dub/group.rb
50
+ - lib/dub/klass.rb
51
+ - lib/dub/lua.rb
52
+ - lib/dub/lua/class.cpp.erb
53
+ - lib/dub/lua/class_gen.rb
54
+ - lib/dub/lua/function.cpp.erb
55
+ - lib/dub/lua/function_gen.rb
56
+ - lib/dub/lua/group.cpp.erb
57
+ - lib/dub/lua/lua_cpp_helper.h
58
+ - lib/dub/lua/namespace.cpp.erb
59
+ - lib/dub/lua/namespace_gen.rb
60
+ - lib/dub/member_extraction.rb
61
+ - lib/dub/namespace.rb
62
+ - lib/dub/parser.rb
63
+ - lib/dub/templates/lua_template.erb
64
+ - lib/dub/version.rb
65
+ - test/argument_test.rb
66
+ - test/fixtures/app/CMakeLists.txt
67
+ - test/fixtures/app/Doxyfile
68
+ - test/fixtures/app/bindings/all_lua.cpp
69
+ - test/fixtures/app/include/matrix.h
70
+ - test/fixtures/app/make_lua_bindings.rb
71
+ - test/fixtures/app/vendor/lua/CMakeLists.txt
72
+ - test/fixtures/app/vendor/lua/COPYRIGHT
73
+ - test/fixtures/app/vendor/lua/HISTORY
74
+ - test/fixtures/app/vendor/lua/INSTALL
75
+ - test/fixtures/app/vendor/lua/Makefile
76
+ - test/fixtures/app/vendor/lua/README
77
+ - test/fixtures/app/vendor/lua/lapi.c
78
+ - test/fixtures/app/vendor/lua/lapi.h
79
+ - test/fixtures/app/vendor/lua/lauxlib.c
80
+ - test/fixtures/app/vendor/lua/lauxlib.h
81
+ - test/fixtures/app/vendor/lua/lbaselib.c
82
+ - test/fixtures/app/vendor/lua/lcode.c
83
+ - test/fixtures/app/vendor/lua/lcode.h
84
+ - test/fixtures/app/vendor/lua/ldblib.c
85
+ - test/fixtures/app/vendor/lua/ldebug.c
86
+ - test/fixtures/app/vendor/lua/ldebug.h
87
+ - test/fixtures/app/vendor/lua/ldo.c
88
+ - test/fixtures/app/vendor/lua/ldo.h
89
+ - test/fixtures/app/vendor/lua/ldump.c
90
+ - test/fixtures/app/vendor/lua/lfunc.c
91
+ - test/fixtures/app/vendor/lua/lfunc.h
92
+ - test/fixtures/app/vendor/lua/lgc.c
93
+ - test/fixtures/app/vendor/lua/lgc.h
94
+ - test/fixtures/app/vendor/lua/liblua.a
95
+ - test/fixtures/app/vendor/lua/linit.c
96
+ - test/fixtures/app/vendor/lua/liolib.c
97
+ - test/fixtures/app/vendor/lua/llex.c
98
+ - test/fixtures/app/vendor/lua/llex.h
99
+ - test/fixtures/app/vendor/lua/llimits.h
100
+ - test/fixtures/app/vendor/lua/lmathlib.c
101
+ - test/fixtures/app/vendor/lua/lmem.c
102
+ - test/fixtures/app/vendor/lua/lmem.h
103
+ - test/fixtures/app/vendor/lua/loadlib.c
104
+ - test/fixtures/app/vendor/lua/lobject.c
105
+ - test/fixtures/app/vendor/lua/lobject.h
106
+ - test/fixtures/app/vendor/lua/lopcodes.c
107
+ - test/fixtures/app/vendor/lua/lopcodes.h
108
+ - test/fixtures/app/vendor/lua/loslib.c
109
+ - test/fixtures/app/vendor/lua/lparser.c
110
+ - test/fixtures/app/vendor/lua/lparser.h
111
+ - test/fixtures/app/vendor/lua/lstate.c
112
+ - test/fixtures/app/vendor/lua/lstate.h
113
+ - test/fixtures/app/vendor/lua/lstring.c
114
+ - test/fixtures/app/vendor/lua/lstring.h
115
+ - test/fixtures/app/vendor/lua/lstrlib.c
116
+ - test/fixtures/app/vendor/lua/ltable.c
117
+ - test/fixtures/app/vendor/lua/ltable.h
118
+ - test/fixtures/app/vendor/lua/ltablib.c
119
+ - test/fixtures/app/vendor/lua/ltm.c
120
+ - test/fixtures/app/vendor/lua/ltm.h
121
+ - test/fixtures/app/vendor/lua/lua.c
122
+ - test/fixtures/app/vendor/lua/lua.h
123
+ - test/fixtures/app/vendor/lua/lua_dub_helper.h
124
+ - test/fixtures/app/vendor/lua/luac
125
+ - test/fixtures/app/vendor/lua/luac.c
126
+ - test/fixtures/app/vendor/lua/luaconf.h
127
+ - test/fixtures/app/vendor/lua/lualib.h
128
+ - test/fixtures/app/vendor/lua/lundump.c
129
+ - test/fixtures/app/vendor/lua/lundump.h
130
+ - test/fixtures/app/vendor/lua/lvm.c
131
+ - test/fixtures/app/vendor/lua/lvm.h
132
+ - test/fixtures/app/vendor/lua/lzio.c
133
+ - test/fixtures/app/vendor/lua/lzio.h
134
+ - test/fixtures/app/vendor/lua/matrix.h
135
+ - test/fixtures/app/vendor/lua/print.c
136
+ - test/fixtures/app/vendor/lua/test/README
137
+ - test/fixtures/app/vendor/lua/test/bisect.lua
138
+ - test/fixtures/app/vendor/lua/test/cf.lua
139
+ - test/fixtures/app/vendor/lua/test/echo.lua
140
+ - test/fixtures/app/vendor/lua/test/env.lua
141
+ - test/fixtures/app/vendor/lua/test/factorial.lua
142
+ - test/fixtures/app/vendor/lua/test/fib.lua
143
+ - test/fixtures/app/vendor/lua/test/fibfor.lua
144
+ - test/fixtures/app/vendor/lua/test/globals.lua
145
+ - test/fixtures/app/vendor/lua/test/hello.lua
146
+ - test/fixtures/app/vendor/lua/test/life.lua
147
+ - test/fixtures/app/vendor/lua/test/luac.lua
148
+ - test/fixtures/app/vendor/lua/test/printf.lua
149
+ - test/fixtures/app/vendor/lua/test/readonly.lua
150
+ - test/fixtures/app/vendor/lua/test/sieve.lua
151
+ - test/fixtures/app/vendor/lua/test/sort.lua
152
+ - test/fixtures/app/vendor/lua/test/table.lua
153
+ - test/fixtures/app/vendor/lua/test/trace-calls.lua
154
+ - test/fixtures/app/vendor/lua/test/trace-globals.lua
155
+ - test/fixtures/app/vendor/lua/test/xd.lua
156
+ - test/fixtures/app/xml/classdub_1_1_matrix.xml
157
+ - test/fixtures/app/xml/classdub_1_1_t_mat.xml
158
+ - test/fixtures/app/xml/combine.xslt
159
+ - test/fixtures/app/xml/compound.xsd
160
+ - test/fixtures/app/xml/dir_53661a2bdeb1d55e60581a7e15deb763.xml
161
+ - test/fixtures/app/xml/index.xml
162
+ - test/fixtures/app/xml/index.xsd
163
+ - test/fixtures/app/xml/matrix_8h.xml
164
+ - test/fixtures/app/xml/namespacedub.xml
165
+ - test/fixtures/classcv_1_1_mat.xml
166
+ - test/fixtures/classcv_1_1_point__.xml
167
+ - test/fixtures/classcv_1_1_size__.xml
168
+ - test/fixtures/group___magic_type.xml
169
+ - test/fixtures/namespacecv.xml
170
+ - test/function_group_test.rb
171
+ - test/function_test.rb
172
+ - test/group_test.rb
173
+ - test/helper.rb
174
+ - test/klass_test.rb
175
+ - test/lua_function_gen_test.rb
176
+ - test/namespace_test.rb
177
+ - test/parser_test.rb
178
+ has_rdoc: true
179
+ homepage: http://github.com/ruby/dub
180
+ licenses: []
181
+
182
+ post_install_message:
183
+ rdoc_options:
184
+ - --charset=UTF-8
185
+ require_paths:
186
+ - lib
187
+ required_ruby_version: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ version: "0"
192
+ version:
193
+ required_rubygems_version: !ruby/object:Gem::Requirement
194
+ requirements:
195
+ - - ">="
196
+ - !ruby/object:Gem::Version
197
+ version: "0"
198
+ version:
199
+ requirements: []
200
+
201
+ rubyforge_project:
202
+ rubygems_version: 1.3.5
203
+ signing_key:
204
+ specification_version: 3
205
+ summary: A tool to ease the creation of scripting language bindings for a C++ library.
206
+ test_files:
207
+ - test/argument_test.rb
208
+ - test/fixtures/app/make_lua_bindings.rb
209
+ - test/function_group_test.rb
210
+ - test/function_test.rb
211
+ - test/group_test.rb
212
+ - test/helper.rb
213
+ - test/klass_test.rb
214
+ - test/lua_function_gen_test.rb
215
+ - test/namespace_test.rb
216
+ - test/parser_test.rb