rice 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b48f6fad0387e0af0b875368cf76cc7fefd0fb9
4
- data.tar.gz: 23bc4f4e7bd5c9cba4e261259c15bd932d979abc
3
+ metadata.gz: d302eb67c62576943948c960ff3fbd08b58488cd
4
+ data.tar.gz: 890eec0ab8be02d12ee4780d284c92c9c3f03a66
5
5
  SHA512:
6
- metadata.gz: 05f85e6ae14093a830d4aea7aa509b8c6dce523ac0297b1036a930e9319f5ce5dfd817fa40a1046231a4728ca02dc25c73d26675d4ff7d001b51567914ebad8c
7
- data.tar.gz: a8462693ca9aa5e01645fa0177574902c834f4b23253d5a1ba8d50a471367cc7b22e998c3fa568537090c598cfc60d0a6f09e9ec69dd24d88b36a11552751cfd
6
+ metadata.gz: 365b2406ce20a999ebc98baa9d1da1847e278928ed498212b9f290e6a400e218b4dbd2f7c0be1da02fb68649e73a3a79d2da8914a39e9e9a5b9bb00b5c6f37ae
7
+ data.tar.gz: 5de69a6bf6ff0b4771f28c94fd399a141bddbd1a1b253ebede89468d4eb802708379c8c7ab85531d4842cff8c155dfc22856611b7e06c8e59d863bb64c338a47
data/Doxyfile CHANGED
@@ -38,7 +38,7 @@ PROJECT_NAME = "Rice"
38
38
  # could be handy for archiving the generated documentation or if some version
39
39
  # control system is used.
40
40
 
41
- PROJECT_NUMBER = 2.0.0
41
+ PROJECT_NUMBER = 2.1.0
42
42
 
43
43
  # Using the PROJECT_BRIEF tag one can provide an optional one line description
44
44
  # for a project that appears at the top of each page and should give viewer a
@@ -99,12 +99,6 @@ public:
99
99
  */
100
100
  Object shift();
101
101
 
102
- //! Return a pointer to the beginning of the underlying C array.
103
- //! Use with caution!
104
- /*! \return a pointer to the beginning of the array.
105
- */
106
- VALUE * to_c_array();
107
-
108
102
  private:
109
103
  template<typename Array_Ref_T, typename Value_T>
110
104
  class Iterator;
@@ -52,8 +52,7 @@ size() const
52
52
  inline Rice::Object Rice::Array::
53
53
  operator[](ptrdiff_t index) const
54
54
  {
55
- VALUE * ptr = RARRAY_PTR(this->value());
56
- return ptr[position_of(index)];
55
+ return protect(rb_ary_entry, value(), position_of(index));
57
56
  }
58
57
 
59
58
  inline Rice::Array::Proxy Rice::Array::
@@ -88,12 +87,6 @@ shift()
88
87
  return protect(rb_ary_shift, value());
89
88
  }
90
89
 
91
- inline VALUE * Rice::Array::
92
- to_c_array()
93
- {
94
- return RARRAY_PTR(this->value());
95
- }
96
-
97
90
  inline size_t Rice::Array::
98
91
  position_of(ptrdiff_t index) const
99
92
  {
@@ -117,13 +110,13 @@ Proxy(Array array, size_t index)
117
110
  inline Rice::Array::Proxy::
118
111
  operator Rice::Object() const
119
112
  {
120
- return RARRAY_PTR(array_.value())[index_];
113
+ return protect(rb_ary_entry, array_.value(), index_);
121
114
  }
122
115
 
123
116
  inline VALUE Rice::Array::Proxy::
124
117
  value() const
125
118
  {
126
- return RARRAY_PTR(array_.value())[index_];
119
+ return protect(rb_ary_entry, array_.value(), index_);
127
120
  }
128
121
 
129
122
  template<typename T>
@@ -131,7 +124,7 @@ Rice::Object Rice::Array::Proxy::
131
124
  operator=(T const & value)
132
125
  {
133
126
  Object o = to_ruby(value);
134
- RARRAY_PTR(array_.value())[index_] = o.value();
127
+ rb_ary_store(array_.value(), index_, o.value());
135
128
  return o;
136
129
  }
137
130
 
@@ -108,7 +108,16 @@ vcall(
108
108
  Identifier id,
109
109
  Array args)
110
110
  {
111
- return protect(rb_funcall3, *this, id, args.size(), args.to_c_array());
111
+ std::vector<VALUE> a(args.size());
112
+
113
+ Array::const_iterator it = args.begin();
114
+ Array::const_iterator end = args.end();
115
+
116
+ for(int i = 0 ;it != end; i++, ++it) {
117
+ a[i] = it->value();
118
+ }
119
+
120
+ return protect(rb_funcall3, *this, id, args.size(), &a[0]);
112
121
  }
113
122
 
114
123
  void Rice::Object::
@@ -1,3 +1,3 @@
1
1
  module Rice
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -156,12 +156,6 @@ TESTCASE(shift)
156
156
  ASSERT_EQUAL(44, from_ruby<int>(a[1]));
157
157
  }
158
158
 
159
- TESTCASE(to_c_array)
160
- {
161
- Array a;
162
- ASSERT_EQUAL(RARRAY_PTR(a.value()), a.to_c_array());
163
- }
164
-
165
159
  TESTCASE(iterate)
166
160
  {
167
161
  Array a;
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: 2.0.0
4
+ version: 2.1.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: 2015-11-27 00:00:00.000000000 Z
12
+ date: 2016-01-12 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