rice 2.2.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/COPYING +2 -2
- data/Doxyfile +1 -1
- data/Makefile.in +15 -7
- data/README.md +115 -117
- data/aclocal.m4 +25 -28
- data/ax_cxx_compile_stdcxx.m4 +951 -0
- data/configure +486 -61
- data/configure.ac +3 -3
- data/extconf.rb +6 -2
- data/rice/Array.hpp +16 -16
- data/rice/Array.ipp +11 -11
- data/rice/Class_defn.hpp +1 -0
- data/rice/Constructor.hpp +27 -371
- data/rice/Director.hpp +3 -3
- data/rice/Exception.cpp +2 -7
- data/rice/Hash.hpp +8 -5
- data/rice/Makefile.am +0 -4
- data/rice/Makefile.in +6 -10
- data/rice/Object.cpp +1 -1
- data/rice/Object.ipp +15 -1
- data/rice/Object_defn.hpp +24 -1
- data/rice/String.cpp +2 -7
- data/rice/Struct.cpp +2 -2
- data/rice/Struct.hpp +1 -1
- data/rice/Struct.ipp +1 -1
- data/rice/config.hpp +2 -2
- data/rice/config.hpp.in +2 -2
- data/rice/detail/Arguments.hpp +1 -1
- data/rice/detail/Auto_Function_Wrapper.ipp +512 -1025
- data/rice/detail/Auto_Member_Function_Wrapper.ipp +272 -545
- data/rice/detail/ruby.hpp +0 -4
- data/rice/detail/ruby_version_code.hpp +1 -1
- data/rice/detail/wrap_function.hpp +32 -307
- data/rice/protect.hpp +3 -57
- data/rice/to_from_ruby.ipp +3 -3
- data/ruby/Makefile.in +4 -4
- data/ruby/lib/Makefile.in +4 -4
- data/ruby/lib/version.rb +1 -1
- data/sample/Makefile.am +10 -4
- data/sample/Makefile.in +14 -8
- data/sample/callbacks/extconf.rb +3 -0
- data/sample/callbacks/sample_callbacks.cpp +38 -0
- data/sample/callbacks/test.rb +28 -0
- data/test/Makefile.am +1 -0
- data/test/Makefile.in +15 -9
- data/test/embed_ruby.cpp +21 -0
- data/test/embed_ruby.hpp +4 -0
- data/test/ext/Makefile.in +4 -4
- data/test/test_Address_Registration_Guard.cpp +2 -1
- data/test/test_Array.cpp +2 -1
- data/test/test_Builtin_Object.cpp +2 -1
- data/test/test_Class.cpp +2 -1
- data/test/test_Data_Object.cpp +2 -1
- data/test/test_Data_Type.cpp +2 -1
- data/test/test_Director.cpp +2 -1
- data/test/test_Enum.cpp +2 -1
- data/test/test_Exception.cpp +2 -1
- data/test/test_Hash.cpp +2 -1
- data/test/test_Identifier.cpp +2 -1
- data/test/test_Memory_Management.cpp +2 -1
- data/test/test_Module.cpp +2 -1
- data/test/test_Object.cpp +13 -1
- data/test/test_String.cpp +2 -1
- data/test/test_Struct.cpp +2 -1
- data/test/test_Symbol.cpp +2 -1
- data/test/test_To_From_Ruby.cpp +2 -1
- data/test/test_global_functions.cpp +2 -1
- data/test/test_rice.rb +4 -0
- data/test/unittest.cpp +34 -8
- metadata +26 -11
- data/check_stdcxx_11.ac +0 -103
- data/rice/detail/object_call.hpp +0 -69
- data/rice/detail/object_call.ipp +0 -131
- data/rice/detail/traits.hpp +0 -43
- data/rice/detail/wrap_function.ipp +0 -514
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "unittest.hpp"
|
2
|
+
#include "embed_ruby.hpp"
|
2
3
|
#include "rice/Builtin_Object.hpp"
|
3
4
|
#include "rice/Class.hpp"
|
4
5
|
|
@@ -8,7 +9,7 @@ TESTSUITE(Builtin_Object);
|
|
8
9
|
|
9
10
|
SETUP(Builtin_Object)
|
10
11
|
{
|
11
|
-
|
12
|
+
embed_ruby();
|
12
13
|
}
|
13
14
|
|
14
15
|
TESTCASE(construct_with_object)
|
data/test/test_Class.cpp
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "unittest.hpp"
|
2
|
+
#include "embed_ruby.hpp"
|
2
3
|
#include "rice/Class.hpp"
|
3
4
|
#include "rice/Constructor.hpp"
|
4
5
|
#include "rice/protect.hpp"
|
@@ -15,7 +16,7 @@ TESTSUITE(Class);
|
|
15
16
|
|
16
17
|
SETUP(Class)
|
17
18
|
{
|
18
|
-
|
19
|
+
embed_ruby();
|
19
20
|
}
|
20
21
|
|
21
22
|
TESTCASE(construct)
|
data/test/test_Data_Object.cpp
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "unittest.hpp"
|
2
|
+
#include "embed_ruby.hpp"
|
2
3
|
#include "rice/Data_Object.hpp"
|
3
4
|
#include "rice/Data_Type.hpp"
|
4
5
|
#include "rice/Exception.hpp"
|
@@ -22,7 +23,7 @@ void ruby_mark(Foo * foo)
|
|
22
23
|
|
23
24
|
SETUP(Data_Object)
|
24
25
|
{
|
25
|
-
|
26
|
+
embed_ruby();
|
26
27
|
|
27
28
|
if(!Data_Type<Foo>::is_bound())
|
28
29
|
{
|
data/test/test_Data_Type.cpp
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "unittest.hpp"
|
2
|
+
#include "embed_ruby.hpp"
|
2
3
|
#include "rice/Data_Type.hpp"
|
3
4
|
#include "rice/Exception.hpp"
|
4
5
|
#include "rice/Constructor.hpp"
|
@@ -63,7 +64,7 @@ namespace {
|
|
63
64
|
|
64
65
|
SETUP(Data_Type)
|
65
66
|
{
|
66
|
-
|
67
|
+
embed_ruby();
|
67
68
|
|
68
69
|
define_class<Listener>("Listener")
|
69
70
|
.define_constructor(Constructor<Listener>())
|
data/test/test_Director.cpp
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "unittest.hpp"
|
2
|
+
#include "embed_ruby.hpp"
|
2
3
|
#include "rice/Exception.hpp"
|
3
4
|
#include "rice/Director.hpp"
|
4
5
|
#include "rice/Constructor.hpp"
|
@@ -87,7 +88,7 @@ namespace {
|
|
87
88
|
|
88
89
|
SETUP(Director)
|
89
90
|
{
|
90
|
-
|
91
|
+
embed_ruby();
|
91
92
|
}
|
92
93
|
|
93
94
|
TESTCASE(exposes_worker_as_instantiatable_class)
|
data/test/test_Enum.cpp
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "unittest.hpp"
|
2
|
+
#include "embed_ruby.hpp"
|
2
3
|
#include "rice/Enum.hpp"
|
3
4
|
#include "rice/Array.hpp"
|
4
5
|
#include "rice/String.hpp"
|
@@ -26,7 +27,7 @@ namespace
|
|
26
27
|
|
27
28
|
SETUP(Enum)
|
28
29
|
{
|
29
|
-
|
30
|
+
embed_ruby();
|
30
31
|
}
|
31
32
|
|
32
33
|
TESTCASE(copy_construct)
|
data/test/test_Exception.cpp
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "unittest.hpp"
|
2
|
+
#include "embed_ruby.hpp"
|
2
3
|
#include "rice/Exception.hpp"
|
3
4
|
#include "rice/String.hpp"
|
4
5
|
|
@@ -8,7 +9,7 @@ TESTSUITE(Exception);
|
|
8
9
|
|
9
10
|
SETUP(Exception)
|
10
11
|
{
|
11
|
-
|
12
|
+
embed_ruby();
|
12
13
|
}
|
13
14
|
|
14
15
|
TESTCASE(construct_from_exception_object)
|
data/test/test_Hash.cpp
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "unittest.hpp"
|
2
|
+
#include "embed_ruby.hpp"
|
2
3
|
#include "rice/Hash.hpp"
|
3
4
|
#include "rice/global_function.hpp"
|
4
5
|
#include <vector>
|
@@ -11,7 +12,7 @@ TESTSUITE(Hash);
|
|
11
12
|
|
12
13
|
SETUP(Hash)
|
13
14
|
{
|
14
|
-
|
15
|
+
embed_ruby();
|
15
16
|
}
|
16
17
|
|
17
18
|
TESTCASE(default_construct)
|
data/test/test_Identifier.cpp
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "unittest.hpp"
|
2
|
+
#include "embed_ruby.hpp"
|
2
3
|
#include "rice/Identifier.hpp"
|
3
4
|
#include "rice/Symbol.hpp"
|
4
5
|
|
@@ -8,7 +9,7 @@ TESTSUITE(Identifier);
|
|
8
9
|
|
9
10
|
SETUP(Identifier)
|
10
11
|
{
|
11
|
-
|
12
|
+
embed_ruby();
|
12
13
|
}
|
13
14
|
|
14
15
|
TESTCASE(construct_from_id)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "unittest.hpp"
|
2
|
+
#include "embed_ruby.hpp"
|
2
3
|
#include "rice/String.hpp"
|
3
4
|
#include "rice/Class.hpp"
|
4
5
|
#include "rice/global_function.hpp"
|
@@ -9,7 +10,7 @@ TESTSUITE(Memory_Management);
|
|
9
10
|
|
10
11
|
SETUP(Memory_Management)
|
11
12
|
{
|
12
|
-
|
13
|
+
embed_ruby();
|
13
14
|
}
|
14
15
|
|
15
16
|
namespace
|
data/test/test_Module.cpp
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "unittest.hpp"
|
2
|
+
#include "embed_ruby.hpp"
|
2
3
|
#include "rice/Module.hpp"
|
3
4
|
#include "rice/Exception.hpp"
|
4
5
|
#include "rice/Array.hpp"
|
@@ -12,7 +13,7 @@ TESTSUITE(Module);
|
|
12
13
|
|
13
14
|
SETUP(Object)
|
14
15
|
{
|
15
|
-
|
16
|
+
embed_ruby();
|
16
17
|
}
|
17
18
|
|
18
19
|
TESTCASE(construct_from_value)
|
data/test/test_Object.cpp
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "unittest.hpp"
|
2
|
+
#include "embed_ruby.hpp"
|
2
3
|
#include "rice/Object.hpp"
|
3
4
|
#include "rice/Class.hpp"
|
4
5
|
#include "rice/String.hpp"
|
@@ -10,7 +11,7 @@ TESTSUITE(Object);
|
|
10
11
|
|
11
12
|
SETUP(Object)
|
12
13
|
{
|
13
|
-
|
14
|
+
embed_ruby();
|
14
15
|
}
|
15
16
|
|
16
17
|
TESTCASE(default_construct)
|
@@ -146,3 +147,14 @@ TESTCASE(rb_type)
|
|
146
147
|
ASSERT_EQUAL(T_UNDEF, Object(Qundef).rb_type());
|
147
148
|
}
|
148
149
|
|
150
|
+
TESTCASE(call_no_arguments)
|
151
|
+
{
|
152
|
+
Object three = to_ruby(3).call("to_s");
|
153
|
+
ASSERT_EQUAL(String("3"), three);
|
154
|
+
}
|
155
|
+
|
156
|
+
TESTCASE(call_return_rice_object)
|
157
|
+
{
|
158
|
+
Object three = to_ruby(1).call("+", 2);
|
159
|
+
ASSERT_EQUAL(to_ruby(3), three);
|
160
|
+
}
|
data/test/test_String.cpp
CHANGED
data/test/test_Struct.cpp
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "unittest.hpp"
|
2
|
+
#include "embed_ruby.hpp"
|
2
3
|
#include "rice/Struct.hpp"
|
3
4
|
#include "rice/Symbol.hpp"
|
4
5
|
#include "rice/global_function.hpp"
|
@@ -22,7 +23,7 @@ namespace
|
|
22
23
|
|
23
24
|
SETUP(Struct)
|
24
25
|
{
|
25
|
-
|
26
|
+
embed_ruby();
|
26
27
|
}
|
27
28
|
|
28
29
|
TESTCASE(default_construct)
|
data/test/test_Symbol.cpp
CHANGED
data/test/test_To_From_Ruby.cpp
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "unittest.hpp"
|
2
|
+
#include "embed_ruby.hpp"
|
2
3
|
#include "rice/to_from_ruby.hpp"
|
3
4
|
#include "rice/String.hpp"
|
4
5
|
#include "rice/Array.hpp"
|
@@ -12,7 +13,7 @@ TESTSUITE(To_From_Ruby);
|
|
12
13
|
|
13
14
|
SETUP(To_From_Ruby)
|
14
15
|
{
|
15
|
-
|
16
|
+
embed_ruby();
|
16
17
|
}
|
17
18
|
|
18
19
|
TESTCASE(object_to_ruby)
|
data/test/test_rice.rb
CHANGED
@@ -26,6 +26,10 @@ class RiceTest < Minitest::Test
|
|
26
26
|
run_external_test("#{RUBY} test_multiple_extensions_same_class.rb")
|
27
27
|
end
|
28
28
|
|
29
|
+
def test_callbacks_sample
|
30
|
+
run_external_test("#{RUBY} test_callbacks_sample.rb")
|
31
|
+
end
|
32
|
+
|
29
33
|
def run_external_test(executable)
|
30
34
|
if VERBOSE then
|
31
35
|
system(executable)
|
data/test/unittest.cpp
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#include <algorithm>
|
1
2
|
#include <iostream>
|
2
3
|
#include <map>
|
3
4
|
#include "unittest.hpp"
|
@@ -85,18 +86,43 @@ run(Test_Result & result)
|
|
85
86
|
}
|
86
87
|
}
|
87
88
|
|
88
|
-
|
89
|
+
char* findOption(char** begin, char** end, const std::string& option)
|
89
90
|
{
|
91
|
+
char** itr = std::find(begin, end, option);
|
92
|
+
if (itr != end && ++itr != end)
|
93
|
+
{
|
94
|
+
return *itr;
|
95
|
+
}
|
96
|
+
return nullptr;
|
97
|
+
}
|
98
|
+
|
99
|
+
int main(int argc, char** argv)
|
100
|
+
{
|
101
|
+
std::vector<Test_Suite> suites;
|
102
|
+
|
103
|
+
char* moduleName = findOption(argv, argv + argc, "--suite");
|
104
|
+
if (moduleName)
|
105
|
+
{
|
106
|
+
Test_Suite suite = test_suites()[moduleName];
|
107
|
+
suites.push_back(suite);
|
108
|
+
}
|
109
|
+
else
|
110
|
+
{
|
111
|
+
std::transform(test_suites().begin(), test_suites().end(),
|
112
|
+
std::back_inserter(suites),
|
113
|
+
[](auto& pair)
|
114
|
+
{
|
115
|
+
return pair.second;
|
116
|
+
});
|
117
|
+
}
|
118
|
+
|
90
119
|
Test_Result result;
|
91
120
|
size_t num_tests = 0;
|
92
|
-
|
93
|
-
for(
|
94
|
-
end = test_suites().end();
|
95
|
-
it != end;
|
96
|
-
++it)
|
121
|
+
|
122
|
+
for (Test_Suite& suite : suites)
|
97
123
|
{
|
98
|
-
|
99
|
-
num_tests +=
|
124
|
+
suite.run(result);
|
125
|
+
num_tests += suite.size();
|
100
126
|
}
|
101
127
|
|
102
128
|
std::cout << std::endl;
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Brannan
|
8
8
|
- Jason Roelofs
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-01-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -53,6 +53,20 @@ dependencies:
|
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: mustache
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
56
70
|
description: |
|
57
71
|
Rice is a C++ interface to Ruby's C API. It provides a type-safe and
|
58
72
|
exception-safe interface in order to make embedding Ruby and writing
|
@@ -76,8 +90,8 @@ files:
|
|
76
90
|
- README.mingw
|
77
91
|
- Rakefile
|
78
92
|
- aclocal.m4
|
93
|
+
- ax_cxx_compile_stdcxx.m4
|
79
94
|
- bootstrap
|
80
|
-
- check_stdcxx_11.ac
|
81
95
|
- config.guess
|
82
96
|
- config.sub
|
83
97
|
- configure
|
@@ -185,8 +199,6 @@ files:
|
|
185
199
|
- rice/detail/method_data.cpp
|
186
200
|
- rice/detail/method_data.hpp
|
187
201
|
- rice/detail/node.hpp
|
188
|
-
- rice/detail/object_call.hpp
|
189
|
-
- rice/detail/object_call.ipp
|
190
202
|
- rice/detail/protect.cpp
|
191
203
|
- rice/detail/protect.hpp
|
192
204
|
- rice/detail/ruby.hpp
|
@@ -195,10 +207,8 @@ files:
|
|
195
207
|
- rice/detail/st.hpp
|
196
208
|
- rice/detail/to_ruby.hpp
|
197
209
|
- rice/detail/to_ruby.ipp
|
198
|
-
- rice/detail/traits.hpp
|
199
210
|
- rice/detail/win32.hpp
|
200
211
|
- rice/detail/wrap_function.hpp
|
201
|
-
- rice/detail/wrap_function.ipp
|
202
212
|
- rice/global_function.hpp
|
203
213
|
- rice/global_function.ipp
|
204
214
|
- rice/protect.hpp
|
@@ -218,6 +228,9 @@ files:
|
|
218
228
|
- ruby/lib/version.rb
|
219
229
|
- sample/Makefile.am
|
220
230
|
- sample/Makefile.in
|
231
|
+
- sample/callbacks/extconf.rb
|
232
|
+
- sample/callbacks/sample_callbacks.cpp
|
233
|
+
- sample/callbacks/test.rb
|
221
234
|
- sample/enum/extconf.rb
|
222
235
|
- sample/enum/sample_enum.cpp
|
223
236
|
- sample/enum/test.rb
|
@@ -229,6 +242,8 @@ files:
|
|
229
242
|
- sample/map/test.rb
|
230
243
|
- test/Makefile.am
|
231
244
|
- test/Makefile.in
|
245
|
+
- test/embed_ruby.cpp
|
246
|
+
- test/embed_ruby.hpp
|
232
247
|
- test/ext/Makefile.am
|
233
248
|
- test/ext/Makefile.in
|
234
249
|
- test/ext/t1/Foo.hpp
|
@@ -264,7 +279,7 @@ homepage: https://github.com/jasonroelofs/rice
|
|
264
279
|
licenses:
|
265
280
|
- MIT
|
266
281
|
metadata: {}
|
267
|
-
post_install_message:
|
282
|
+
post_install_message:
|
268
283
|
rdoc_options: []
|
269
284
|
require_paths:
|
270
285
|
- ruby/lib
|
@@ -279,8 +294,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
279
294
|
- !ruby/object:Gem::Version
|
280
295
|
version: '0'
|
281
296
|
requirements: []
|
282
|
-
rubygems_version: 3.
|
283
|
-
signing_key:
|
297
|
+
rubygems_version: 3.2.3
|
298
|
+
signing_key:
|
284
299
|
specification_version: 4
|
285
300
|
summary: Ruby Interface for C++ Extensions
|
286
301
|
test_files:
|