dub 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,13 @@
1
- == 0.6.1
1
+ == 0.6.2 2010-07-07
2
+
3
+ * 1 enhancement
4
+ * Added an option define (DUB_LUA_NO_OPEN) to prevent replaxe luaopen_xx by luaload_xx
5
+ * Added char in the list of 'int' types.
6
+
7
+ == 0.6.1 2010-03-12
2
8
 
3
9
  * 2 enhancements
4
- * Wrapping all function call in a try.. catch block
10
+ * Wrapping all function calls in try.. catch blocks
5
11
  * Added support for custome templates (customize exception handling for example)
6
12
 
7
13
  == 0.6.0 2010-03-11
@@ -46,8 +46,3 @@ All these typedefs and templates will generate two class bindings with some alia
46
46
 
47
47
  And what's really good is that in the definition for the <tt>Size</tt> constructor, <tt>Point_<T></tt> is
48
48
  recognized as <tt>Point</tt> !
49
-
50
- === Lua Generator
51
-
52
- Since this generator uses C++ code and memory allocation, you *MUST* compile Lua as C++ code
53
- to avoid memory leaks (error handling should use exceptions instead of longjmp).
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{dub}
8
- s.version = "0.6.1"
8
+ s.version = "0.6.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gaspard Bucher"]
12
- s.date = %q{2010-03-12}
12
+ s.date = %q{2010-07-07}
13
13
  s.description = %q{This is a tool to ease the creation of scripting language bindings for a C++ library.
14
14
  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.}
15
15
  s.email = %q{gaspard@teti.ch}
@@ -166,7 +166,7 @@ Gem::Specification.new do |s|
166
166
  s.homepage = %q{http://github.com/ruby/dub}
167
167
  s.rdoc_options = ["--charset=UTF-8"]
168
168
  s.require_paths = ["lib"]
169
- s.rubygems_version = %q{1.3.5}
169
+ s.rubygems_version = %q{1.3.6}
170
170
  s.summary = %q{A tool to ease the creation of scripting language bindings for a C++ library.}
171
171
  s.test_files = [
172
172
  "test/argument_test.rb",
@@ -19,6 +19,7 @@ module Dub
19
19
  'uint',
20
20
  'bool',
21
21
  'uchar',
22
+ 'char',
22
23
  'void',
23
24
  'int64'
24
25
  ]
@@ -58,7 +58,11 @@ static const struct lua_constants_Reg <%= @class.name %>_namespace_constants[] =
58
58
  };
59
59
  <% end %>
60
60
 
61
- void luaopen_<%= @class.lib_name %>(lua_State *L) {
61
+ #ifdef DUB_LUA_NO_OPEN
62
+ int luaload_<%= @class.lib_name %>(lua_State *L) {
63
+ #else
64
+ extern "C" int luaopen_<%= @class.lib_name %>(lua_State *L) {
65
+ #endif
62
66
  // Create the metatable which will contain all the member methods
63
67
  luaL_newmetatable(L, <%= @class.id_name.inspect %>);
64
68
 
@@ -18,6 +18,7 @@ module Dub
18
18
  'unsigned int',
19
19
  'uint',
20
20
  'uchar',
21
+ 'char',
21
22
  ]
22
23
 
23
24
  BOOL_TYPES = [
@@ -27,12 +28,12 @@ module Dub
27
28
  def initialize
28
29
  load_erb
29
30
  end
30
-
31
+
31
32
  def template_path=(template_path)
32
33
  @template_path = template_path
33
34
  load_erb
34
35
  end
35
-
36
+
36
37
  # Produce bindings for a group of overloaded functions
37
38
  def group(group)
38
39
  @group = group
@@ -247,7 +248,7 @@ module Dub
247
248
  end
248
249
  list.flatten
249
250
  end
250
-
251
+
251
252
  def load_erb
252
253
  @function_template = ::ERB.new(File.read(@template_path ||File.join(File.dirname(__FILE__), 'function.cpp.erb')))
253
254
  @group_template = ::ERB.new(File.read(File.join(File.dirname(__FILE__), 'group.cpp.erb')))
@@ -25,11 +25,16 @@ static const struct lua_constants_Reg <%= @namespace.name %>_namespace_constants
25
25
  };
26
26
  <% end %>
27
27
 
28
- void luaopen_<%= @namespace.lib_name %>(lua_State *L) {
28
+ #ifdef DUB_LUA_NO_OPEN
29
+ int luaload_<%= @namespace.lib_name %>(lua_State *L) {
30
+ #else
31
+ extern "C" int luaopen_<%= @namespace.lib_name %>(lua_State *L) {
32
+ #endif
29
33
  // register functions
30
34
  luaL_register(L, <%= @namespace.name.inspect %>, <%= @namespace.name %>_functions);
31
35
  <% if @namespace.has_constants? %>
32
36
  // register namespace enums
33
37
  register_constants(L, <%= @namespace.id_name.inspect %>, <%= @namespace.name %>_namespace_constants);
34
38
  <% end %>
39
+ return 0;
35
40
  }
@@ -1,3 +1,3 @@
1
1
  module Dub
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 6
8
+ - 2
9
+ version: 0.6.2
5
10
  platform: ruby
6
11
  authors:
7
12
  - Gaspard Bucher
@@ -9,19 +14,21 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-03-12 00:00:00 +01:00
17
+ date: 2010-07-07 00:00:00 +02:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: shoulda
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
23
29
  version: "0"
24
- version:
30
+ type: :development
31
+ version_requirements: *id001
25
32
  description: |-
26
33
  This is a tool to ease the creation of scripting language bindings for a C++ library.
27
34
  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.
@@ -191,18 +198,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
198
  requirements:
192
199
  - - ">="
193
200
  - !ruby/object:Gem::Version
201
+ segments:
202
+ - 0
194
203
  version: "0"
195
- version:
196
204
  required_rubygems_version: !ruby/object:Gem::Requirement
197
205
  requirements:
198
206
  - - ">="
199
207
  - !ruby/object:Gem::Version
208
+ segments:
209
+ - 0
200
210
  version: "0"
201
- version:
202
211
  requirements: []
203
212
 
204
213
  rubyforge_project:
205
- rubygems_version: 1.3.5
214
+ rubygems_version: 1.3.6
206
215
  signing_key:
207
216
  specification_version: 3
208
217
  summary: A tool to ease the creation of scripting language bindings for a C++ library.