rice 2.1.0 → 2.1.1

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: d302eb67c62576943948c960ff3fbd08b58488cd
4
- data.tar.gz: 890eec0ab8be02d12ee4780d284c92c9c3f03a66
3
+ metadata.gz: bd0d5de4b2af1de7c8f7e812f7e3266b83a18054
4
+ data.tar.gz: 2a719d9807aac1bfe4207d39312adc9447aa1f8a
5
5
  SHA512:
6
- metadata.gz: 365b2406ce20a999ebc98baa9d1da1847e278928ed498212b9f290e6a400e218b4dbd2f7c0be1da02fb68649e73a3a79d2da8914a39e9e9a5b9bb00b5c6f37ae
7
- data.tar.gz: 5de69a6bf6ff0b4771f28c94fd399a141bddbd1a1b253ebede89468d4eb802708379c8c7ab85531d4842cff8c155dfc22856611b7e06c8e59d863bb64c338a47
6
+ metadata.gz: bca41abf092893dabf1ba768515e9287da6e1d3b617bbc866a9f8ace30ac509229cf5f033c183985db7821779e688dd7854b80a2c27fcd85d7877a9ca0c32c21
7
+ data.tar.gz: 7d47b281817209c3838a1c55b7be6c2984e851cf605ba91626fb73e84053e05b9c056c1fd714f28e66c12d69c962d2ac8c82acbfc7bf3707c2efb9bfc6f4ce59
data/COPYING CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2014 Paul Brannan <pbrannan@atdesk.com>,
1
+ Copyright (C) 2017 Paul Brannan <pbrannan@atdesk.com>,
2
2
  Jason Roelofs <jasongroelofs@gmail.com>
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
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.1.0
41
+ PROJECT_NUMBER = 2.1.1
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
@@ -75,7 +75,7 @@ initialize(
75
75
  .define_method("to_i", to_i)
76
76
  .define_method("inspect", inspect)
77
77
  .define_method("<=>", compare)
78
- //.define_method("hash", hash)
78
+ .define_method("hash", hash)
79
79
  .define_method("eql?", eql)
80
80
  .define_method("==", eql)
81
81
  .define_method("===", eql)
@@ -292,13 +292,13 @@ begin() const
292
292
  inline Rice::Hash::iterator Rice::Hash::
293
293
  end()
294
294
  {
295
- return iterator(*this, size());
295
+ return iterator(*this, (int)size());
296
296
  }
297
297
 
298
298
  inline Rice::Hash::const_iterator Rice::Hash::
299
299
  end() const
300
300
  {
301
- return const_iterator(*this, size());
301
+ return const_iterator(*this, (int)size());
302
302
  }
303
303
 
304
304
  inline bool Rice::
@@ -285,7 +285,7 @@ bool
285
285
  Rice::Module_impl<Base_T, Derived_T>::
286
286
  const_defined(Identifier name) const
287
287
  {
288
- int result = protect(rb_const_defined, *this, name);
288
+ size_t result = protect(rb_const_defined, *this, name);
289
289
  return bool(result);
290
290
  }
291
291
 
@@ -117,7 +117,7 @@ vcall(
117
117
  a[i] = it->value();
118
118
  }
119
119
 
120
- return protect(rb_funcall3, *this, id, args.size(), &a[0]);
120
+ return protect(rb_funcall3, *this, id, (int)args.size(), &a[0]);
121
121
  }
122
122
 
123
123
  void Rice::Object::
@@ -1,6 +1,6 @@
1
1
  #ifndef Rice__detail__ruby_version_code__hpp
2
2
  #define Rice__detail__ruby_version_code__hpp
3
3
 
4
- #define RICE__RUBY_VERSION_CODE 223
4
+ #define RICE__RUBY_VERSION_CODE 231
5
5
 
6
6
  #endif // Rice__detail__ruby_version_code__hpp
@@ -1,3 +1,3 @@
1
1
  module Rice
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
@@ -3,6 +3,7 @@
3
3
  #include "rice/Array.hpp"
4
4
  #include "rice/String.hpp"
5
5
  #include "rice/Constructor.hpp"
6
+ #include "rice/global_function.hpp"
6
7
  #include <iostream>
7
8
 
8
9
  using namespace Rice;
@@ -147,14 +148,12 @@ TESTCASE(different_objects_eql)
147
148
  ASSERT_EQUAL(true, red1 == red2);
148
149
  }
149
150
 
150
- /*
151
151
  TESTCASE(hash)
152
152
  {
153
153
  Enum<Color> rb_cColor = define_color_enum();
154
154
  Data_Object<Color> red(new Color(RED));
155
155
  ASSERT_EQUAL(to_ruby(int(RED)), red.call("hash"));
156
156
  }
157
- */
158
157
 
159
158
  TESTCASE(from_int)
160
159
  {
@@ -193,3 +192,24 @@ TESTCASE(nested_enums)
193
192
  ASSERT_EQUAL(to_ruby(int(2)), Object(protect(rb_eval_string, "Inner::Props::VALUE3.to_i")));
194
193
  }
195
194
 
195
+ namespace
196
+ {
197
+ Color getEnum()
198
+ {
199
+ return GREEN;
200
+ }
201
+ }
202
+
203
+ TESTCASE(return_enum_value_to_ruby)
204
+ {
205
+ Enum<Color> rb_cColor = define_color_enum();
206
+ define_global_function("get_enum", &getEnum);
207
+
208
+ ASSERT_EQUAL(
209
+ Data_Object<Color>(protect(rb_eval_string, "Color::GREEN")),
210
+ Data_Object<Color>(protect(rb_eval_string, "get_enum"))
211
+ );
212
+
213
+ ASSERT_EQUAL(String("GREEN"), String(protect(rb_eval_string, "get_enum.to_s")));
214
+ ASSERT_EQUAL(String("#<Color::GREEN>"), String(protect(rb_eval_string, "get_enum.inspect")));
215
+ }
@@ -131,6 +131,6 @@ int main()
131
131
  }
132
132
  }
133
133
 
134
- return result.errors().size() + result.failures().size();
134
+ return (int)result.errors().size() + (int)result.failures().size();
135
135
  }
136
136
 
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.1.0
4
+ version: 2.1.1
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: 2016-01-12 00:00:00.000000000 Z
12
+ date: 2017-01-07 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
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  requirements: []
240
240
  rubyforge_project:
241
- rubygems_version: 2.4.8
241
+ rubygems_version: 2.6.7
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: Ruby Interface for C++ Extensions