rice 4.0.4 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +37 -0
  3. data/CONTRIBUTORS.md +2 -0
  4. data/Rakefile +1 -1
  5. data/include/rice/rice.hpp +2851 -1955
  6. data/include/rice/stl.hpp +1654 -287
  7. data/lib/mkmf-rice.rb +5 -2
  8. data/lib/version.rb +1 -1
  9. data/rice/Arg.hpp +6 -6
  10. data/rice/Arg.ipp +8 -9
  11. data/rice/Constructor.hpp +2 -2
  12. data/rice/Data_Object.ipp +69 -15
  13. data/rice/Data_Object_defn.hpp +1 -15
  14. data/rice/Data_Type.ipp +56 -86
  15. data/rice/Data_Type_defn.hpp +14 -17
  16. data/rice/Director.hpp +0 -1
  17. data/rice/Enum.ipp +31 -22
  18. data/rice/Exception.ipp +2 -3
  19. data/rice/Exception_defn.hpp +5 -5
  20. data/rice/HandlerRegistration.hpp +15 -0
  21. data/rice/Return.hpp +5 -4
  22. data/rice/Return.ipp +8 -3
  23. data/rice/detail/ExceptionHandler.hpp +8 -0
  24. data/rice/detail/ExceptionHandler.ipp +28 -0
  25. data/rice/detail/{Exception_Handler_defn.hpp → ExceptionHandler_defn.hpp} +17 -21
  26. data/rice/detail/HandlerRegistry.hpp +51 -0
  27. data/rice/detail/HandlerRegistry.ipp +20 -0
  28. data/rice/detail/InstanceRegistry.hpp +34 -0
  29. data/rice/detail/InstanceRegistry.ipp +50 -0
  30. data/rice/detail/MethodInfo.ipp +1 -1
  31. data/rice/detail/NativeAttribute.hpp +26 -15
  32. data/rice/detail/NativeAttribute.ipp +76 -47
  33. data/rice/detail/NativeFunction.hpp +64 -14
  34. data/rice/detail/NativeFunction.ipp +138 -86
  35. data/rice/detail/NativeIterator.hpp +49 -0
  36. data/rice/detail/NativeIterator.ipp +102 -0
  37. data/rice/detail/NativeRegistry.hpp +31 -0
  38. data/rice/detail/{method_data.ipp → NativeRegistry.ipp} +20 -16
  39. data/rice/detail/Registries.hpp +26 -0
  40. data/rice/detail/Registries.ipp +23 -0
  41. data/rice/detail/RubyFunction.hpp +6 -11
  42. data/rice/detail/RubyFunction.ipp +10 -22
  43. data/rice/detail/Type.hpp +1 -1
  44. data/rice/detail/Type.ipp +2 -2
  45. data/rice/detail/TypeRegistry.hpp +8 -11
  46. data/rice/detail/TypeRegistry.ipp +3 -28
  47. data/rice/detail/Wrapper.hpp +0 -2
  48. data/rice/detail/Wrapper.ipp +74 -24
  49. data/rice/detail/cpp_protect.hpp +93 -0
  50. data/rice/detail/default_allocation_func.ipp +1 -1
  51. data/rice/detail/from_ruby.ipp +206 -2
  52. data/rice/detail/to_ruby.ipp +39 -5
  53. data/rice/detail/to_ruby_defn.hpp +1 -1
  54. data/rice/forward_declares.ipp +6 -0
  55. data/rice/global_function.hpp +0 -4
  56. data/rice/global_function.ipp +0 -6
  57. data/rice/rice.hpp +29 -24
  58. data/rice/stl.hpp +6 -1
  59. data/sample/callbacks/extconf.rb +0 -1
  60. data/sample/enum/extconf.rb +0 -1
  61. data/sample/inheritance/extconf.rb +0 -1
  62. data/sample/map/extconf.rb +0 -1
  63. data/test/embed_ruby.cpp +6 -15
  64. data/test/ext/t1/extconf.rb +0 -1
  65. data/test/ext/t2/extconf.rb +0 -1
  66. data/test/extconf.rb +0 -1
  67. data/test/test_Array.cpp +20 -24
  68. data/test/test_Attribute.cpp +6 -6
  69. data/test/test_Class.cpp +8 -47
  70. data/test/test_Constructor.cpp +0 -2
  71. data/test/test_Data_Object.cpp +25 -11
  72. data/test/test_Data_Type.cpp +124 -28
  73. data/test/test_Director.cpp +12 -13
  74. data/test/test_Enum.cpp +65 -26
  75. data/test/test_Inheritance.cpp +9 -9
  76. data/test/test_Iterator.cpp +134 -5
  77. data/test/test_Keep_Alive.cpp +7 -7
  78. data/test/test_Keep_Alive_No_Wrapper.cpp +80 -0
  79. data/test/test_Memory_Management.cpp +1 -1
  80. data/test/test_Module.cpp +25 -62
  81. data/test/test_Object.cpp +75 -3
  82. data/test/test_Ownership.cpp +12 -13
  83. data/test/test_Self.cpp +12 -13
  84. data/test/test_Stl_Map.cpp +696 -0
  85. data/test/test_Stl_Optional.cpp +3 -3
  86. data/test/test_Stl_Pair.cpp +38 -2
  87. data/test/test_Stl_Reference_Wrapper.cpp +102 -0
  88. data/test/test_Stl_SmartPointer.cpp +49 -9
  89. data/test/test_Stl_String.cpp +5 -2
  90. data/test/test_Stl_Unordered_Map.cpp +697 -0
  91. data/test/test_Stl_Variant.cpp +346 -0
  92. data/test/test_Stl_Vector.cpp +200 -41
  93. data/test/test_Struct.cpp +3 -3
  94. data/test/test_To_From_Ruby.cpp +8 -2
  95. data/test/test_Tracking.cpp +239 -0
  96. data/test/unittest.hpp +21 -4
  97. metadata +24 -13
  98. data/rice/detail/Exception_Handler.hpp +0 -8
  99. data/rice/detail/Exception_Handler.ipp +0 -28
  100. data/rice/detail/Iterator.hpp +0 -23
  101. data/rice/detail/Iterator.ipp +0 -47
  102. data/rice/detail/function_traits.hpp +0 -124
  103. data/rice/detail/method_data.hpp +0 -29
  104. data/rice/detail/rice_traits.hpp +0 -116
  105. data/rice/ruby_try_catch.hpp +0 -86
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5955c1123287e348999e519d10afaa7443caa42b16279f29e3037da3f3842576
4
- data.tar.gz: 975e3cfdb9969036fa9cf41a2d9a28a895a15c0029d2d7f92c99926137f44229
3
+ metadata.gz: 1971d90148d0c032df2e58c7e251b57c69ad2a4ddd76d6835048b266f243e966
4
+ data.tar.gz: '0933de85d9bb135813adb756ac365dfbb333bc4ddf4575614f2200af1a78c1f4'
5
5
  SHA512:
6
- metadata.gz: 63de4f41590f14fb6cd88f81c2f7ada803cade5be15e57b3971abed49f3cd61f1cfec9a41d731bdb8114ab3c2e2ac5bdc75dce3c04b854794030a991d21aacaa
7
- data.tar.gz: 135a8996387abfc992d7d1682235f1b7cd510dd2aed3301e19d89b980270ffff528f951327d2d6de85e14590a364c02278e2b1a5e65b2530c0cdffa3c34ac496
6
+ metadata.gz: 47bbbb4ddfacf6f67fc47fdf3b1bc81b2b5a1d8c889238ef1fba751b3866598a41e82609637c294609ceb0f7d3728bde3328cc3b4110af5f676b7b293fded1e9
7
+ data.tar.gz: 609458d567c204fa4156520523715e9415ac2e79bee6ddf266568408b1cb7203be68a3e216022c2dab0988d73a06c757ec63a8169d37eb0c14d80883785a708b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,40 @@
1
+ ## Unreleased (4.2)
2
+
3
+ * Support Ruby 3.3.0.
4
+ * Split Object.call to an explicit Object.call_kw for calling methods expecting keyword arguments.
5
+ * Previously, if a wrapper used `keepAlive` on an argument or return value that was itself a Rice type, calling said method would segfault. We've now added an explicit exception to be thrown in this case, prevending the segfault and providing guidance on what was wrong and how to fix it. See [#193](https://github.com/jasonroelofs/rice/pull/193) and [#194](https://github.com/jasonroelofs/rice/pull/194)
6
+ * Fix wrapping of std::shared_ptr to properly take default arguments into account.
7
+
8
+ ## 4.1
9
+
10
+ Rice 4.1 builds on the 4.0 release and has a number of improvements that both polish Rice and extend its functionality. However, there are three incompatibilities to know about:
11
+
12
+ * Exception handlers are now registered globally versus per module. This requires updating code that calls Class#add_handler to use register_handler instead.
13
+ * Rename Arg#isValue to Arg#setValue and then Arg#getIsValue to Arg#isValue
14
+ * Rename Return#isValue to Return#setValue and Return#getIsValue to Return#isValue
15
+
16
+ New or improved functionality includes:
17
+
18
+ * Add support for std::map, std::unordered_map, std::variant, std::monostate and std::reference_wrapper
19
+ * Enable calling of C++ member functions that are defined in ancestor classes
20
+ * Make it easy to wrap C++ iterators like std::vector begin and end
21
+ * Enable creating enumerators for C++ collections like std::vector and std::map
22
+ * Enable calling more Ruby API methods including those with a variable number of parameters such as rb_yield_values
23
+ * Add additional C++ to Ruby exception mappings (for example, std::system_error to SystemCallError)
24
+ * Updated documentation, including new pages for instance tracking, iterators, exceptions and newly supported STL classes
25
+ * Add support for calling Ruby methods with keywords from Rice::Object and its descendants
26
+ * Automatically translate C++ character arrays that start with colons to symbols (ie, ":mysymbol") when sending them to Ruby
27
+ * Add a constructor for Rice::Module that takes a name, to enable code like Module("Kernel")
28
+ * Fix comparison methods in Rice::Object, such as Object#is_equal, to return the correct result
29
+ * Fix various compiler warnings
30
+ * Remove deprecated APIs
31
+ * Remove support for Ruby 2.5 and 2.6 which are officially out of support
32
+ * Add support for building tests with CMake
33
+ * And lots of other fixes and code improvements
34
+
35
+ Rice also includes experimental support for instance tracking so that Rice maps the same C++ instance to the same Ruby instance each time it is passed to Ruby. See the documentation for more information.
36
+
37
+
1
38
  ## 4.0
2
39
 
3
40
  Rice 4.0 is a significant change from 3.0 and has multiple backwards-incompatible
data/CONTRIBUTORS.md CHANGED
@@ -17,3 +17,5 @@ I'd like to thank the following people for their help in making Rice what it is
17
17
  * [Charlie Savage (cfis)](https://github.com/cfis) for multiple improvements and modernizations: [#130](https://github.com/jasonroelofs/rice/pull/130), [#131](https://github.com/jasonroelofs/rice/pull/131), [#133](https://github.com/jasonroelofs/rice/pull/133), [#134](https://github.com/jasonroelofs/rice/pull/134), [#136](https://github.com/jasonroelofs/rice/pull/136), [#137](https://github.com/jasonroelofs/rice/pull/137), [#140](https://github.com/jasonroelofs/rice/pull/140), [#141](https://github.com/jasonroelofs/rice/pull/141) and many others, including the work to make Rice header-only.
18
18
  * [Atsushi Tatsuma (yoshoku)](https://github.com/yoshoku) for [#135](https://github.com/jasonroelofs/rice/pull/135)
19
19
  * [Andrew Kane (ankane)](https://github.com/ankane) for helping [test Rice 4](https://github.com/jasonroelofs/rice/issues/149).
20
+ * [Maxim Samsonov (maxirmx)](https://github.com/maxirmx) for [#193](https://github.com/jasonroelofs/rice/issues/193) and [#194](https://github.com/jasonroelofs/rice/pull/194)
21
+ * [kvtb](https://github.com/kvtb) for [#191](https://github.com/jasonroelofs/rice/issues/191)
data/Rakefile CHANGED
@@ -93,7 +93,7 @@ end
93
93
  desc "Build the documentation"
94
94
  task :doc do
95
95
  cd "doc" do
96
- sh "make html"
96
+ sh "make clean html"
97
97
  end
98
98
  end
99
99