rice 1.6.3 → 1.7.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.
- checksums.yaml +4 -4
- data/Rakefile +2 -12
- data/rice/Array.hpp +1 -1
- data/rice/Array.ipp +5 -5
- data/rice/Builtin_Object.ipp +9 -9
- data/rice/Builtin_Object_defn.hpp +6 -6
- data/rice/Hash.hpp +1 -1
- data/rice/Hash.ipp +2 -2
- data/rice/String.cpp +6 -6
- data/rice/String.hpp +1 -1
- data/rice/Struct.cpp +3 -3
- data/rice/Struct.hpp +1 -1
- data/rice/detail/ruby_version_code.hpp +1 -1
- data/ruby/lib/version.rb +1 -1
- data/test/test_Builtin_Object.cpp +8 -8
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9e3777fb35b3ff2463c30d6ec4d799ca47dcc69
|
4
|
+
data.tar.gz: 477180b1c3be9f330c1cf9e8675e8d947d6ed549
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 784a3e9d47f1aba190d3e8aa8637d1e681a5344d43834168ad9bee4ee078080dbf6aaffd51eac88579e49bee880261253f19def28d3419056e0976fe3fa00ebf
|
7
|
+
data.tar.gz: 86b4ba50634d38e6ab8a0b18a9a9b0ec8bc0d52a0670785b2a9a9f663c7ebde2fe43c057fb6d1e648b880641bc0c1dbb5ef533f225e85182a1204813d2fd7f44
|
data/Rakefile
CHANGED
@@ -1,33 +1,23 @@
|
|
1
1
|
$: << File.expand_path(File.dirname(__FILE__))
|
2
2
|
require 'rubygems'
|
3
3
|
require 'rubygems/package_task'
|
4
|
-
require 'rake/contrib/sshpublisher'
|
5
4
|
require 'yaml'
|
6
5
|
require 'ruby/lib/version'
|
7
6
|
|
8
|
-
PROJECT_NAME = "rice"
|
9
|
-
PROJECT_WEB_PATH = "/var/www/gforge-projects/rice"
|
10
|
-
|
11
7
|
task :default => :test
|
12
8
|
|
13
|
-
desc "Run unit tests"
|
9
|
+
desc "Run unit tests"
|
14
10
|
task :test do
|
15
11
|
cd "test" do
|
16
12
|
ruby "test_rice.rb"
|
17
13
|
end
|
18
14
|
end
|
19
15
|
|
20
|
-
desc "Build the documentation"
|
16
|
+
desc "Build the documentation"
|
21
17
|
task :doc do
|
22
18
|
sh "make doc"
|
23
19
|
end
|
24
20
|
|
25
|
-
desc "Upload documentation to the website. Requires rubyforge gem"
|
26
|
-
task :upload_web => [:doc] do
|
27
|
-
host = "jameskilton@rubyforge.org"
|
28
|
-
Rake::SshDirPublisher.new(host, PROJECT_WEB_PATH, "doc/html").upload
|
29
|
-
end
|
30
|
-
|
31
21
|
# Gemspec kept externally
|
32
22
|
eval(File.read("rice.gemspec"))
|
33
23
|
Gem::PackageTask.new($spec) do |pkg|
|
data/rice/Array.hpp
CHANGED
data/rice/Array.ipp
CHANGED
@@ -5,26 +5,26 @@
|
|
5
5
|
|
6
6
|
inline Rice::Array::
|
7
7
|
Array()
|
8
|
-
: Builtin_Object<
|
8
|
+
: Builtin_Object<T_ARRAY>(protect(rb_ary_new))
|
9
9
|
{
|
10
10
|
}
|
11
11
|
|
12
12
|
inline Rice::Array::
|
13
13
|
Array(Object v)
|
14
|
-
: Builtin_Object<
|
14
|
+
: Builtin_Object<T_ARRAY>(v)
|
15
15
|
{
|
16
16
|
}
|
17
17
|
|
18
18
|
inline Rice::Array::
|
19
19
|
Array(VALUE v)
|
20
|
-
: Builtin_Object<
|
20
|
+
: Builtin_Object<T_ARRAY>(v)
|
21
21
|
{
|
22
22
|
}
|
23
23
|
|
24
24
|
template<typename Iter_T>
|
25
25
|
inline Rice::Array::
|
26
26
|
Array(Iter_T it, Iter_T end)
|
27
|
-
: Builtin_Object<
|
27
|
+
: Builtin_Object<T_ARRAY>(protect(rb_ary_new))
|
28
28
|
{
|
29
29
|
for(; it != end; ++it)
|
30
30
|
{
|
@@ -35,7 +35,7 @@ Array(Iter_T it, Iter_T end)
|
|
35
35
|
template<typename T, size_t n>
|
36
36
|
inline Rice::Array::
|
37
37
|
Array(T const (& a)[n])
|
38
|
-
: Builtin_Object<
|
38
|
+
: Builtin_Object<T_ARRAY>(protect(rb_ary_new))
|
39
39
|
{
|
40
40
|
for(size_t j = 0; j < n; ++j)
|
41
41
|
{
|
data/rice/Builtin_Object.ipp
CHANGED
@@ -19,26 +19,26 @@ namespace detail
|
|
19
19
|
}
|
20
20
|
}
|
21
21
|
|
22
|
-
template<
|
23
|
-
inline Builtin_Object<
|
22
|
+
template<int Builtin_Type>
|
23
|
+
inline Builtin_Object<Builtin_Type>::
|
24
24
|
Builtin_Object(Object value)
|
25
25
|
: Object(value)
|
26
|
-
, obj_((
|
26
|
+
, obj_((RObject*)(value.value()))
|
27
27
|
{
|
28
28
|
protect(detail::check_type, value, Builtin_Type);
|
29
29
|
}
|
30
30
|
|
31
|
-
template<
|
32
|
-
inline Builtin_Object<
|
33
|
-
Builtin_Object(Builtin_Object<
|
31
|
+
template<int Builtin_Type>
|
32
|
+
inline Builtin_Object<Builtin_Type>::
|
33
|
+
Builtin_Object(Builtin_Object<Builtin_Type> const & other)
|
34
34
|
: Object(other.value())
|
35
35
|
, obj_(other.obj_)
|
36
36
|
{
|
37
37
|
}
|
38
38
|
|
39
|
-
template<
|
40
|
-
inline void Builtin_Object<
|
41
|
-
swap(Builtin_Object<
|
39
|
+
template<int Builtin_Type>
|
40
|
+
inline void Builtin_Object<Builtin_Type>::
|
41
|
+
swap(Builtin_Object<Builtin_Type> & ref)
|
42
42
|
{
|
43
43
|
std::swap(obj_, ref.obj_);
|
44
44
|
Object::swap(ref);
|
@@ -14,7 +14,7 @@ namespace Rice
|
|
14
14
|
* class is a wrapper for those types of objects, primarily useful as a
|
15
15
|
* base class for other wrapper classes like Array and Hash.
|
16
16
|
*/
|
17
|
-
template<
|
17
|
+
template<int Builtin_Type>
|
18
18
|
class Builtin_Object
|
19
19
|
: public Object
|
20
20
|
{
|
@@ -31,17 +31,17 @@ public:
|
|
31
31
|
*/
|
32
32
|
Builtin_Object(Builtin_Object const & other);
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
RObject & operator*() const { return *obj_; } //!< Return a reference to obj_
|
35
|
+
RObject * operator->() const { return obj_; } //!< Return a pointer to obj_
|
36
|
+
RObject * get() const { return obj_; } //!< Return a pointer to obj_
|
37
37
|
|
38
38
|
//! Swap with another builtin object of the same type
|
39
39
|
/*! \param ref the object with which to swap.
|
40
40
|
*/
|
41
|
-
void swap(Builtin_Object<
|
41
|
+
void swap(Builtin_Object<Builtin_Type> & ref);
|
42
42
|
|
43
43
|
private:
|
44
|
-
|
44
|
+
RObject * obj_;
|
45
45
|
};
|
46
46
|
|
47
47
|
} // namespace Rice
|
data/rice/Hash.hpp
CHANGED
data/rice/Hash.ipp
CHANGED
@@ -10,13 +10,13 @@
|
|
10
10
|
|
11
11
|
inline Rice::Hash::
|
12
12
|
Hash()
|
13
|
-
: Builtin_Object<
|
13
|
+
: Builtin_Object<T_HASH>(protect(rb_hash_new))
|
14
14
|
{
|
15
15
|
}
|
16
16
|
|
17
17
|
inline Rice::Hash::
|
18
18
|
Hash(Object v)
|
19
|
-
: Builtin_Object<
|
19
|
+
: Builtin_Object<T_HASH>(v)
|
20
20
|
{
|
21
21
|
}
|
22
22
|
|
data/rice/String.cpp
CHANGED
@@ -13,37 +13,37 @@
|
|
13
13
|
|
14
14
|
Rice::String::
|
15
15
|
String()
|
16
|
-
: Builtin_Object<
|
16
|
+
: Builtin_Object<T_STRING>(protect(rb_str_new2, ""))
|
17
17
|
{
|
18
18
|
}
|
19
19
|
|
20
20
|
Rice::String::
|
21
21
|
String(VALUE v)
|
22
|
-
: Builtin_Object<
|
22
|
+
: Builtin_Object<T_STRING>(v)
|
23
23
|
{
|
24
24
|
}
|
25
25
|
|
26
26
|
Rice::String::
|
27
27
|
String(Object v)
|
28
|
-
: Builtin_Object<
|
28
|
+
: Builtin_Object<T_STRING>(v)
|
29
29
|
{
|
30
30
|
}
|
31
31
|
|
32
32
|
Rice::String::
|
33
33
|
String(char const * s)
|
34
|
-
: Builtin_Object<
|
34
|
+
: Builtin_Object<T_STRING>(protect(rb_str_new2, s))
|
35
35
|
{
|
36
36
|
}
|
37
37
|
|
38
38
|
Rice::String::
|
39
39
|
String(std::string const & s)
|
40
|
-
: Builtin_Object<
|
40
|
+
: Builtin_Object<T_STRING>(protect(rb_str_new, s.data(), s.length()))
|
41
41
|
{
|
42
42
|
}
|
43
43
|
|
44
44
|
Rice::String::
|
45
45
|
String(Identifier id)
|
46
|
-
: Builtin_Object<
|
46
|
+
: Builtin_Object<T_STRING>(protect(rb_str_new2, id.c_str()))
|
47
47
|
{
|
48
48
|
}
|
49
49
|
|
data/rice/String.hpp
CHANGED
data/rice/Struct.cpp
CHANGED
@@ -88,7 +88,7 @@ Rice::Struct::Instance::
|
|
88
88
|
Instance(
|
89
89
|
Struct const & type,
|
90
90
|
Array args)
|
91
|
-
: Builtin_Object<
|
91
|
+
: Builtin_Object<T_STRUCT>(type.new_instance(args))
|
92
92
|
, type_(type)
|
93
93
|
{
|
94
94
|
}
|
@@ -97,7 +97,7 @@ Rice::Struct::Instance::
|
|
97
97
|
Instance(
|
98
98
|
Struct const & type,
|
99
99
|
Object s)
|
100
|
-
: Builtin_Object<
|
100
|
+
: Builtin_Object<T_STRUCT>(s)
|
101
101
|
, type_(type)
|
102
102
|
{
|
103
103
|
}
|
@@ -106,7 +106,7 @@ void Rice::Struct::Instance::
|
|
106
106
|
swap(Instance & other)
|
107
107
|
{
|
108
108
|
type_.swap(other.type_);
|
109
|
-
Builtin_Object<
|
109
|
+
Builtin_Object<T_STRUCT>::swap(other);
|
110
110
|
}
|
111
111
|
|
112
112
|
Rice::Struct Rice::
|
data/rice/Struct.hpp
CHANGED
data/ruby/lib/version.rb
CHANGED
@@ -15,7 +15,7 @@ TESTCASE(construct_with_object)
|
|
15
15
|
{
|
16
16
|
Class c(rb_cObject);
|
17
17
|
Object o(c.call("new"));
|
18
|
-
Builtin_Object<
|
18
|
+
Builtin_Object<T_OBJECT> b(o);
|
19
19
|
ASSERT_EQUAL(o.value(), b.value());
|
20
20
|
ASSERT_EQUAL(T_OBJECT, rb_type(b.value()));
|
21
21
|
ASSERT_EQUAL(rb_cObject, b.class_of().value());
|
@@ -26,8 +26,8 @@ TESTCASE(copy_construct)
|
|
26
26
|
{
|
27
27
|
Class c(rb_cObject);
|
28
28
|
Object o(c.call("new"));
|
29
|
-
Builtin_Object<
|
30
|
-
Builtin_Object<
|
29
|
+
Builtin_Object<T_OBJECT> b(o);
|
30
|
+
Builtin_Object<T_OBJECT> b2(b);
|
31
31
|
ASSERT_EQUAL(o.value(), b2.value());
|
32
32
|
ASSERT_EQUAL(T_OBJECT, rb_type(b2.value()));
|
33
33
|
ASSERT_EQUAL(rb_cObject, b2.class_of().value());
|
@@ -38,7 +38,7 @@ TESTCASE(dereference)
|
|
38
38
|
{
|
39
39
|
Class c(rb_cObject);
|
40
40
|
Object o(c.call("new"));
|
41
|
-
Builtin_Object<
|
41
|
+
Builtin_Object<T_OBJECT> b(o);
|
42
42
|
ASSERT_EQUAL(ROBJECT(o.value()), &*b);
|
43
43
|
}
|
44
44
|
|
@@ -46,7 +46,7 @@ TESTCASE(arrow)
|
|
46
46
|
{
|
47
47
|
Class c(rb_cObject);
|
48
48
|
Object o(c.call("new"));
|
49
|
-
Builtin_Object<
|
49
|
+
Builtin_Object<T_OBJECT> b(o);
|
50
50
|
ASSERT_EQUAL(rb_cObject, b->basic.klass);
|
51
51
|
}
|
52
52
|
|
@@ -54,7 +54,7 @@ TESTCASE(get)
|
|
54
54
|
{
|
55
55
|
Class c(rb_cObject);
|
56
56
|
Object o(c.call("new"));
|
57
|
-
Builtin_Object<
|
57
|
+
Builtin_Object<T_OBJECT> b(o);
|
58
58
|
ASSERT_EQUAL(ROBJECT(o.value()), b.get());
|
59
59
|
}
|
60
60
|
|
@@ -62,9 +62,9 @@ TESTCASE(swap)
|
|
62
62
|
{
|
63
63
|
Class c(rb_cObject);
|
64
64
|
Object o1(c.call("new"));
|
65
|
-
Builtin_Object<
|
65
|
+
Builtin_Object<T_OBJECT> b1(o1);
|
66
66
|
Object o2(c.call("new"));
|
67
|
-
Builtin_Object<
|
67
|
+
Builtin_Object<T_OBJECT> b2(o2);
|
68
68
|
b1.swap(b2);
|
69
69
|
ASSERT_EQUAL(b1.value(), o2.value());
|
70
70
|
ASSERT_EQUAL(b2.value(), o1.value());
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Brannan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-01-06 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: |
|
15
15
|
Rice is a C++ interface to Ruby's C API. It provides a type-safe and
|
@@ -227,7 +227,7 @@ files:
|
|
227
227
|
- test/test_rice.rb
|
228
228
|
- test/unittest.cpp
|
229
229
|
- test/unittest.hpp
|
230
|
-
homepage:
|
230
|
+
homepage: https://github.com/jasonroelofs/rice
|
231
231
|
licenses:
|
232
232
|
- MIT
|
233
233
|
metadata: {}
|
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
246
246
|
- !ruby/object:Gem::Version
|
247
247
|
version: '0'
|
248
248
|
requirements: []
|
249
|
-
rubyforge_project:
|
249
|
+
rubyforge_project:
|
250
250
|
rubygems_version: 2.4.5
|
251
251
|
signing_key:
|
252
252
|
specification_version: 4
|