rucy 0.1.28 → 0.1.29

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c514e93fc7c59839c7d71ef05950c5f84f9cba2359e743b22c5c4be839dea424
4
- data.tar.gz: 5d071c8787e4e5174f8c468bd3a59954c9d19f04cdc979bfcd4222645e1d49a5
3
+ metadata.gz: 24def7804f8e0e7610b1720165ad571a713c436c0726aededae1b01021e70530
4
+ data.tar.gz: 798b35c1b70a07e1d3c7043600a87fe99f5ccfb73c267f6a936408db6f098d70
5
5
  SHA512:
6
- metadata.gz: b5b22222f32fc6a9ea8deefa61fed21dbbd5f38ccf43d78127cc3da491fe1b0d3317685837483ae091d0520a77054a700aca430c751768736894e1d04d7bc1db
7
- data.tar.gz: 73612915aa371b4107e7acb55c40eff25062c233229faf7f7f9f97f7f39b722e87146c4ce3dda6870aec36d95c3ccc415376690db0f4213a355d936f31828d5a
6
+ metadata.gz: e287b36d19e74811b01f25baf4d31571abe9b616650319ea58a55ac1a9ebe9d98ec99a89e27d24112d2ced807b676078310af88590f7e2be47191be2c31f7217
7
+ data.tar.gz: 5320e909cbce0943fc564ee1ddda091d07376a1d301b4c79fafece40e5cb41dc9adc0553e0a17bad492018951e71f2401669d5e0a7173a633929c35659f5f905
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  #include <vector>
5
- #include "rucy.h"
5
+ #include "defs.h"
6
6
 
7
7
 
8
8
  using namespace Rucy;
@@ -1,4 +1,4 @@
1
- #include "rucy.h"
1
+ #include "defs.h"
2
2
 
3
3
 
4
4
  using namespace Rucy;
@@ -1,4 +1,4 @@
1
- #include "rucy.h"
1
+ #include "defs.h"
2
2
 
3
3
 
4
4
  using namespace Rucy;
@@ -1,4 +1,4 @@
1
- #include "rucy.h"
1
+ #include "defs.h"
2
2
 
3
3
 
4
4
  using namespace Rucy;
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  #include <vector>
5
- #include "rucy.h"
5
+ #include "defs.h"
6
6
 
7
7
 
8
8
  using namespace Rucy;
@@ -1,4 +1,4 @@
1
- #include "rucy.h"
1
+ #include "defs.h"
2
2
 
3
3
 
4
4
  using namespace Rucy;
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.28
1
+ 0.1.29
data/ext/rucy/class.cpp CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  #include <vector>
5
- #include "rucy.h"
5
+ #include "defs.h"
6
6
 
7
7
 
8
8
  using namespace Rucy;
data/ext/rucy/defs.h ADDED
@@ -0,0 +1,13 @@
1
+ // -*- c++ -*-
2
+ #pragma once
3
+ #ifndef __RUCY_EXT_DEFS_H__
4
+ #define __RUCY_EXT_DEFS_H__
5
+
6
+
7
+ #include <rucy.h>
8
+
9
+
10
+ #define RUCY_END RUCY_DEF_END
11
+
12
+
13
+ #endif//EOH
@@ -1,4 +1,4 @@
1
- #include "rucy.h"
1
+ #include "defs.h"
2
2
 
3
3
 
4
4
  using namespace Rucy;
@@ -1,4 +1,4 @@
1
- #include "rucy.h"
1
+ #include "defs.h"
2
2
 
3
3
 
4
4
  using namespace Rucy;
data/ext/rucy/struct.cpp CHANGED
@@ -1,4 +1,4 @@
1
- #include "rucy.h"
1
+ #include "defs.h"
2
2
 
3
3
 
4
4
  using namespace Rucy;
data/ext/rucy/tester.cpp CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  #include <vector>
5
- #include "rucy.h"
5
+ #include "defs.h"
6
6
 
7
7
 
8
8
  using namespace Rucy;
data/ext/rucy/value.cpp CHANGED
@@ -1,4 +1,4 @@
1
- #include "rucy.h"
1
+ #include "defs.h"
2
2
 
3
3
 
4
4
  using namespace Rucy;
@@ -197,7 +197,7 @@
197
197
  \
198
198
  RUCY__ruby_jump_tag__: \
199
199
  if (RUCY__rubyjumptag__) rb_jump_tag(RUCY__rubyjumptag__); \
200
- RUCY_THROW(rb_exc_new2(Rucy::native_error_class(), "Bad jump tag.")); \
200
+ RUCY_GOTO_RAISE(rb_exc_new2(Rucy::native_error_class(), "Bad jump tag.")); \
201
201
  \
202
202
  RUCY__ruby_raise_exception__: \
203
203
  rb_exc_raise(RUCY__rubyexception__); \
@@ -215,11 +215,11 @@
215
215
  } \
216
216
  catch (const Rucy::RubyException& e) \
217
217
  { \
218
- RUCY_THROW(e.value()); \
218
+ RUCY_GOTO_RAISE(e.value()); \
219
219
  } \
220
220
  catch (const std::invalid_argument& e) \
221
221
  { \
222
- RUCY_THROW(rb_exc_new2(rb_eArgError, e.what())); \
222
+ RUCY_GOTO_RAISE(rb_exc_new2(rb_eArgError, e.what())); \
223
223
  } \
224
224
  catch (const std::exception& e) \
225
225
  { \
@@ -229,26 +229,29 @@
229
229
  if (!text.empty()) text += " "; \
230
230
  text += "[" + type + "]"; \
231
231
  } \
232
- RUCY_THROW(rb_exc_new2(Rucy::native_error_class(), text.c_str())); \
232
+ RUCY_GOTO_RAISE(rb_exc_new2(Rucy::native_error_class(), text.c_str())); \
233
233
  } \
234
234
  catch (const std::string& s) \
235
235
  { \
236
- RUCY_THROW(rb_exc_new2(Rucy::native_error_class(), s.c_str())); \
236
+ RUCY_GOTO_RAISE(rb_exc_new2(Rucy::native_error_class(), s.c_str())); \
237
237
  } \
238
238
  catch (const char* s) \
239
239
  { \
240
- RUCY_THROW(rb_exc_new2(Rucy::native_error_class(), s)); \
240
+ RUCY_GOTO_RAISE(rb_exc_new2(Rucy::native_error_class(), s)); \
241
241
  } \
242
242
  catch (...) \
243
243
  { \
244
- RUCY_THROW(rb_exc_new2( \
244
+ RUCY_GOTO_RAISE(rb_exc_new2( \
245
245
  Rucy::native_error_class(), "Unknown C++ exception was thrown.")); \
246
246
  }
247
247
 
248
- #define RUCY_THROW(exception) \
248
+ #define RUCY_GOTO_RAISE(exception) \
249
249
  RUCY__rubyexception__ = (exception); \
250
250
  goto RUCY__ruby_raise_exception__
251
251
 
252
+ #define RUCY_RAISE(ruby_error_class, message) \
253
+ rb_exc_raise(rb_exc_new2(ruby_error_class, message))
254
+
252
255
 
253
256
  #define RUCY_DEF_ALLOC(name, klass) \
254
257
  Rucy::RubyValue name (Rucy::Value klass) \
@@ -267,7 +270,7 @@
267
270
  RUCY_TRY
268
271
  % end
269
272
 
270
- #define RUCY_END \
273
+ #define RUCY_DEF_END \
271
274
  RUCY_CATCH \
272
275
  return Rucy::nil(); \
273
276
  }
data/rucy.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  s.platform = Gem::Platform::RUBY
29
29
  s.required_ruby_version = '>= 2.6.0'
30
30
 
31
- s.add_runtime_dependency 'xot', '~> 0.1.28'
31
+ s.add_runtime_dependency 'xot', '~> 0.1.29'
32
32
 
33
33
  s.files = `git ls-files`.split $/
34
34
  s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
data/src/class.cpp CHANGED
@@ -7,6 +7,9 @@
7
7
  #include "rucy/extension.h"
8
8
 
9
9
 
10
+ #define RUCY_END RUCY_DEF_END
11
+
12
+
10
13
  namespace Rucy
11
14
  {
12
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rucy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.28
4
+ version: 0.1.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-04 00:00:00.000000000 Z
11
+ date: 2022-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.28
19
+ version: 0.1.29
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.28
26
+ version: 0.1.29
27
27
  description: This library helps you to develop Ruby Extension by C++.
28
28
  email: xordog@gmail.com
29
29
  executables:
@@ -51,6 +51,7 @@ files:
51
51
  - bin/rucy2rdoc
52
52
  - ext/rucy/class.cpp
53
53
  - ext/rucy/class.h
54
+ - ext/rucy/defs.h
54
55
  - ext/rucy/exception.cpp
55
56
  - ext/rucy/extconf.rb
56
57
  - ext/rucy/function.cpp