code_ownership 2.1.0 → 2.1.1

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.
Files changed (227) hide show
  1. checksums.yaml +4 -4
  2. data/Cargo.lock +8 -14
  3. data/ext/cargo-vendor/magnus-0.8.2/.cargo-checksum.json +1 -0
  4. data/ext/cargo-vendor/magnus-0.8.2/.cargo_vcs_info.json +6 -0
  5. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/CHANGELOG.md +66 -1
  6. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/Cargo.lock +243 -9
  7. data/ext/cargo-vendor/magnus-0.8.2/Cargo.toml +277 -0
  8. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/Cargo.toml.orig +11 -6
  9. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/README.md +75 -23
  10. data/ext/cargo-vendor/magnus-0.8.2/build.rs +15 -0
  11. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/complete_object/test/temperature_test.rb +4 -4
  12. data/ext/cargo-vendor/magnus-0.8.2/examples/inheritance.rs +66 -0
  13. data/ext/cargo-vendor/magnus-0.8.2/examples/mut_point.rs +116 -0
  14. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/api.rs +4 -3
  15. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/class.rs +9 -7
  16. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/encoding.rs +5 -5
  17. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/error.rs +12 -3
  18. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/fiber.rs +5 -5
  19. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/gc.rs +3 -3
  20. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/integer.rs +134 -0
  21. data/ext/cargo-vendor/magnus-0.8.2/src/io.rs +230 -0
  22. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/lib.rs +53 -54
  23. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/macros.rs +2 -2
  24. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/method.rs +14 -100
  25. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/module.rs +1 -1
  26. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/mutex.rs +1 -1
  27. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_array.rs +2 -2
  28. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_bignum.rs +100 -3
  29. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_hash.rs +63 -1
  30. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_string.rs +31 -231
  31. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_typed_data.rs +6 -9
  32. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/rb_sys.rs +4 -4
  33. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/scan_args.rs +3 -3
  34. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/thread.rs +16 -10
  35. data/ext/cargo-vendor/magnus-0.8.2/src/time.rs +462 -0
  36. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/try_convert.rs +64 -2
  37. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/typed_data.rs +113 -11
  38. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/value/flonum.rs +1 -1
  39. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/value.rs +83 -6
  40. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/test +1 -1
  41. data/ext/cargo-vendor/magnus-0.8.2/tests/hash.rs +44 -0
  42. data/ext/cargo-vendor/magnus-0.8.2/tests/io.rs +62 -0
  43. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/return_iter.rs +1 -1
  44. data/ext/cargo-vendor/magnus-0.8.2/tests/string.rs +23 -0
  45. data/ext/cargo-vendor/magnus-0.8.2/tests/time.rs +71 -0
  46. data/ext/cargo-vendor/magnus-macros-0.8.0/.cargo-checksum.json +1 -0
  47. data/ext/cargo-vendor/magnus-macros-0.8.0/.cargo_vcs_info.json +6 -0
  48. data/ext/cargo-vendor/magnus-macros-0.8.0/Cargo.lock +47 -0
  49. data/ext/cargo-vendor/{magnus-macros-0.6.0 → magnus-macros-0.8.0}/Cargo.toml +10 -1
  50. data/ext/cargo-vendor/{magnus-macros-0.6.0 → magnus-macros-0.8.0}/Cargo.toml.orig +1 -1
  51. data/ext/cargo-vendor/magnus-macros-0.8.0/src/lib.rs +545 -0
  52. data/ext/cargo-vendor/{magnus-macros-0.6.0 → magnus-macros-0.8.0}/src/typed_data.rs +3 -3
  53. data/ext/cargo-vendor/{magnus-macros-0.6.0 → magnus-macros-0.8.0}/src/util.rs +1 -1
  54. data/ext/cargo-vendor/serde_magnus-0.10.0/.cargo-checksum.json +1 -0
  55. data/ext/cargo-vendor/serde_magnus-0.10.0/.cargo_vcs_info.json +6 -0
  56. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/Cargo.lock +77 -75
  57. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/Cargo.toml +3 -3
  58. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/Cargo.toml.orig +7 -4
  59. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/README.md +8 -5
  60. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/de/array_deserializer.rs +12 -8
  61. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/de/array_enumerator.rs +12 -7
  62. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/de/deserializer.rs +21 -18
  63. data/ext/cargo-vendor/serde_magnus-0.10.0/src/de/enum_deserializer.rs +35 -0
  64. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/de/hash_deserializer.rs +18 -11
  65. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/de/mod.rs +76 -76
  66. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/de/variant_deserializer.rs +10 -9
  67. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/error.rs +10 -4
  68. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/lib.rs +6 -5
  69. data/ext/cargo-vendor/serde_magnus-0.10.0/src/ser/enums.rs +11 -0
  70. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/ser/map_serializer.rs +11 -12
  71. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/ser/mod.rs +53 -50
  72. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/ser/seq_serializer.rs +11 -10
  73. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/ser/serializer.rs +50 -34
  74. data/ext/cargo-vendor/serde_magnus-0.10.0/src/ser/struct_serializer.rs +40 -0
  75. data/ext/cargo-vendor/serde_magnus-0.10.0/src/ser/struct_variant_serializer.rs +45 -0
  76. data/ext/cargo-vendor/serde_magnus-0.10.0/src/ser/tuple_variant_serializer.rs +38 -0
  77. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/deserializing_arrays.rs +3 -3
  78. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/deserializing_booleans.rs +15 -0
  79. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/deserializing_enums.rs +39 -0
  80. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/deserializing_floats.rs +12 -0
  81. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/deserializing_integers.rs +18 -0
  82. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/deserializing_maps.rs +3 -2
  83. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/deserializing_options.rs +15 -0
  84. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/deserializing_results.rs +17 -0
  85. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/deserializing_strings.rs +7 -7
  86. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/deserializing_structs.rs +9 -9
  87. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/deserializing_tuples.rs +27 -0
  88. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/deserializing_vecs.rs +3 -3
  89. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_arrays.rs +3 -3
  90. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/serializing_booleans.rs +15 -0
  91. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_enums.rs +9 -7
  92. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_floats.rs +2 -2
  93. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_integers.rs +4 -4
  94. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_maps.rs +3 -2
  95. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_options.rs +3 -3
  96. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_results.rs +5 -4
  97. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/serializing_strings.rs +30 -0
  98. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_structs.rs +15 -7
  99. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/serializing_tuples.rs +35 -0
  100. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_vecs.rs +3 -3
  101. data/ext/code_ownership/Cargo.toml +2 -2
  102. data/ext/code_ownership/extconf.rb +2 -1
  103. data/ext/code_ownership/src/lib.rs +16 -16
  104. data/lib/code_ownership/cli.rb +1 -0
  105. data/lib/code_ownership/private/file_path_finder.rb +3 -7
  106. data/lib/code_ownership/private/file_path_team_cache.rb +5 -9
  107. data/lib/code_ownership/private/for_file_output_builder.rb +0 -1
  108. data/lib/code_ownership/private/team_finder.rb +8 -14
  109. data/lib/code_ownership/version.rb +2 -2
  110. data/lib/code_ownership.rb +12 -17
  111. metadata +182 -186
  112. data/ext/cargo-vendor/magnus-0.7.1/.cargo-checksum.json +0 -1
  113. data/ext/cargo-vendor/magnus-0.7.1/.cargo_vcs_info.json +0 -6
  114. data/ext/cargo-vendor/magnus-0.7.1/Cargo.toml +0 -95
  115. data/ext/cargo-vendor/magnus-0.7.1/build.rs +0 -5
  116. data/ext/cargo-vendor/magnus-0.7.1/examples/mut_point.rs +0 -60
  117. data/ext/cargo-vendor/magnus-0.7.1/src/time.rs +0 -190
  118. data/ext/cargo-vendor/magnus-0.7.1/tests/hash.rs +0 -25
  119. data/ext/cargo-vendor/magnus-0.7.1/tests/string.rs +0 -13
  120. data/ext/cargo-vendor/magnus-macros-0.6.0/.cargo-checksum.json +0 -1
  121. data/ext/cargo-vendor/magnus-macros-0.6.0/.cargo_vcs_info.json +0 -6
  122. data/ext/cargo-vendor/magnus-macros-0.6.0/src/lib.rs +0 -401
  123. data/ext/cargo-vendor/rb-sys-env-0.1.2/.cargo-checksum.json +0 -1
  124. data/ext/cargo-vendor/rb-sys-env-0.1.2/.cargo_vcs_info.json +0 -6
  125. data/ext/cargo-vendor/rb-sys-env-0.1.2/Cargo.toml +0 -25
  126. data/ext/cargo-vendor/rb-sys-env-0.1.2/Cargo.toml.orig +0 -14
  127. data/ext/cargo-vendor/rb-sys-env-0.1.2/LICENSE-APACHE +0 -190
  128. data/ext/cargo-vendor/rb-sys-env-0.1.2/LICENSE-MIT +0 -21
  129. data/ext/cargo-vendor/rb-sys-env-0.1.2/readme.md +0 -119
  130. data/ext/cargo-vendor/rb-sys-env-0.1.2/src/defines.rs +0 -37
  131. data/ext/cargo-vendor/rb-sys-env-0.1.2/src/lib.rs +0 -180
  132. data/ext/cargo-vendor/rb-sys-env-0.1.2/src/rb_env.rs +0 -110
  133. data/ext/cargo-vendor/rb-sys-env-0.1.2/src/ruby_version.rs +0 -163
  134. data/ext/cargo-vendor/rb-sys-env-0.1.2/src/utils.rs +0 -6
  135. data/ext/cargo-vendor/serde_magnus-0.9.0/.cargo-checksum.json +0 -1
  136. data/ext/cargo-vendor/serde_magnus-0.9.0/.cargo_vcs_info.json +0 -6
  137. data/ext/cargo-vendor/serde_magnus-0.9.0/src/de/enum_deserializer.rs +0 -30
  138. data/ext/cargo-vendor/serde_magnus-0.9.0/src/ser/enums.rs +0 -11
  139. data/ext/cargo-vendor/serde_magnus-0.9.0/src/ser/struct_serializer.rs +0 -36
  140. data/ext/cargo-vendor/serde_magnus-0.9.0/src/ser/struct_variant_serializer.rs +0 -37
  141. data/ext/cargo-vendor/serde_magnus-0.9.0/src/ser/tuple_variant_serializer.rs +0 -33
  142. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/deserializing_booleans.rs +0 -18
  143. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/deserializing_enums.rs +0 -39
  144. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/deserializing_floats.rs +0 -12
  145. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/deserializing_integers.rs +0 -18
  146. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/deserializing_options.rs +0 -15
  147. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/deserializing_results.rs +0 -17
  148. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/deserializing_tuples.rs +0 -31
  149. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/serializing_booleans.rs +0 -15
  150. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/serializing_strings.rs +0 -30
  151. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/serializing_tuples.rs +0 -27
  152. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/.cargo/config.toml +0 -0
  153. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/Gemfile +0 -0
  154. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/LICENSE +0 -0
  155. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/complete_object/Rakefile +0 -0
  156. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/complete_object/lib/temperature.rb +0 -0
  157. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/custom_exception_ruby/Rakefile +0 -0
  158. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/custom_exception_ruby/lib/ahriman/error.rb +0 -0
  159. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/custom_exception_ruby/lib/ahriman.rb +0 -0
  160. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/custom_exception_ruby/test/error_test.rb +0 -0
  161. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/custom_exception_rust/Rakefile +0 -0
  162. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/custom_exception_rust/lib/ahriman.rb +0 -0
  163. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/custom_exception_rust/test/error_test.rb +0 -0
  164. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/fibonacci.rs +0 -0
  165. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/hello_world.rs +0 -0
  166. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/point.rs +0 -0
  167. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/rust_blank/Rakefile +0 -0
  168. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/rust_blank/lib/rust_blank.rb +0 -0
  169. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/rust_blank/test/bench.rb +0 -0
  170. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/rust_blank/test/blank_test.rb +0 -0
  171. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/block.rs +0 -0
  172. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/embed.rs +0 -0
  173. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/enumerator.rs +0 -0
  174. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/exception.rs +0 -0
  175. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/float.rs +0 -0
  176. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/into_value.rs +0 -0
  177. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/numeric.rs +0 -0
  178. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/object.rs +0 -0
  179. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/process.rs +0 -0
  180. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_complex.rs +0 -0
  181. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_file.rs +0 -0
  182. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_float.rs +0 -0
  183. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_match.rs +0 -0
  184. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_object.rs +0 -0
  185. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_rational.rs +0 -0
  186. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_regexp.rs +0 -0
  187. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_struct.rs +0 -0
  188. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/range.rs +0 -0
  189. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/symbol.rs +0 -0
  190. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/allocate_before_init.rs +0 -0
  191. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/array_slice.rs +0 -0
  192. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/block_call.rs +0 -0
  193. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/bytes.rs +0 -0
  194. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/call_proc.rs +0 -0
  195. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/classname.rs +0 -0
  196. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/clone.rs +0 -0
  197. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/codepoints.rs +0 -0
  198. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/debug_exception.rs +0 -0
  199. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/encoding_capable.rs +0 -0
  200. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/enumerator.rs +0 -0
  201. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/enumeratorize.rs +0 -0
  202. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/float_convert_from_value.rs +0 -0
  203. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/float_convert_to_value.rs +0 -0
  204. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/fmt.rs +0 -0
  205. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/freeze.rs +0 -0
  206. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/integer_convert_to_value.rs +0 -0
  207. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/integer_traits.rs +0 -0
  208. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/ivar.rs +0 -0
  209. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/lazy_id.rs +0 -0
  210. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/make_proc.rs +0 -0
  211. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/proc_new.rs +0 -0
  212. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/range.rs +0 -0
  213. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/return_custom_error.rs +0 -0
  214. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/scan_args.rs +0 -0
  215. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/str.rs +0 -0
  216. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/struct.rs +0 -0
  217. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/symbol.rs +0 -0
  218. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/try_convert_array.rs +0 -0
  219. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/tuple_to_array.rs +0 -0
  220. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/typed_data.rs +0 -0
  221. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/typed_data_obj.rs +0 -0
  222. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/typed_data_subclass.rs +0 -0
  223. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/typed_data_subclass_from_ruby.rs +0 -0
  224. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/yield.rs +0 -0
  225. /data/ext/cargo-vendor/{magnus-macros-0.6.0 → magnus-macros-0.8.0}/LICENSE +0 -0
  226. /data/ext/cargo-vendor/{magnus-macros-0.6.0 → magnus-macros-0.8.0}/src/init.rs +0 -0
  227. /data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/LICENSE +0 -0
@@ -0,0 +1,116 @@
1
+ use std::cell::RefCell;
2
+
3
+ use magnus::{function, method, prelude::*, wrap, Error, Ruby};
4
+
5
+ struct Point {
6
+ x: isize,
7
+ y: isize,
8
+ }
9
+
10
+ // The `wrap` macro wraps a Rust type in a Ruby object, enabling seamless
11
+ // integration.
12
+ //
13
+ // Magnus uses two Ruby API functions to manage the struct:
14
+ // * `rb_data_typed_object_wrap`
15
+ // * `rb_check_typeddata`
16
+ //
17
+ // # Mutability
18
+ //
19
+ // Ruby's garbage collector (GC) manages memory for wrapped objects. This
20
+ // prevents using `&mut` references because Rust requires them to be unique,
21
+ // while Ruby GC may move objects unpredictably. To address this, you can use
22
+ // [`RefCell`](https://doc.rust-lang.org/std/cell/struct.RefCell.html) to
23
+ // enable interior mutability.
24
+ //
25
+ // # Error Handling
26
+ //
27
+ // Use [`magnus::Error`](https://docs.rs/magnus/latest/magnus/struct.Error.html)
28
+ // to propagate errors to Ruby.
29
+ // For example, you can raise a Ruby exception from Rust using Ruby's
30
+ // predefined exception classes.
31
+ //
32
+ // The syntax for methods like `add_x` differs slightly from typical Rust
33
+ // struct methods because it uses the
34
+ // [`method!` macro](https://docs.rs/magnus/latest/magnus/macro.method.html):
35
+ // * The first parameter, `ruby`, gives access to Ruby's runtime.
36
+ // * The second parameter, `rb_self`, is the Ruby object being called.
37
+ //
38
+ // See [`DataTypeFunctions`](https://docs.rs/magnus/latest/magnus/derive.DataTypeFunctions.html)
39
+ // and [`TypedData`](https://docs.rs/magnus/latest/magnus/derive.TypedData.html)
40
+ #[wrap(class = "Point")]
41
+ struct MutPoint(RefCell<Point>);
42
+
43
+ impl MutPoint {
44
+ fn new(x: isize, y: isize) -> Self {
45
+ Self(RefCell::new(Point { x, y }))
46
+ }
47
+
48
+ fn x(&self) -> isize {
49
+ self.0.borrow().x
50
+ }
51
+
52
+ fn set_x(&self, val: isize) {
53
+ self.0.borrow_mut().x = val;
54
+ }
55
+
56
+ fn add_x(ruby: &Ruby, rb_self: &Self, val: isize) -> Result<isize, Error> {
57
+ if let Some(sum) = rb_self.0.borrow().x.checked_add(val) {
58
+ rb_self.0.borrow_mut().x = sum;
59
+ Ok(sum)
60
+ } else {
61
+ Err(Error::new(
62
+ ruby.exception_range_error(),
63
+ "result out of range",
64
+ ))
65
+ }
66
+ }
67
+
68
+ fn y(&self) -> isize {
69
+ self.0.borrow().y
70
+ }
71
+
72
+ fn set_y(&self, val: isize) {
73
+ self.0.borrow_mut().y = val;
74
+ }
75
+
76
+ fn add_y(ruby: &Ruby, rb_self: &Self, val: isize) -> Result<isize, Error> {
77
+ if let Some(sum) = rb_self.0.borrow().y.checked_add(val) {
78
+ rb_self.0.borrow_mut().y = sum;
79
+ Ok(sum)
80
+ } else {
81
+ Err(Error::new(
82
+ ruby.exception_range_error(),
83
+ "result out of range",
84
+ ))
85
+ }
86
+ }
87
+
88
+ fn distance(&self, other: &MutPoint) -> f64 {
89
+ (((other.x() - self.x()).pow(2) + (other.y() - self.y()).pow(2)) as f64).sqrt()
90
+ }
91
+ }
92
+
93
+ fn main() -> Result<(), String> {
94
+ magnus::Ruby::init(|ruby| {
95
+ let class = ruby.define_class("Point", ruby.class_object())?;
96
+ class.define_singleton_method("new", function!(MutPoint::new, 2))?;
97
+ class.define_method("x", method!(MutPoint::x, 0))?;
98
+ class.define_method("x=", method!(MutPoint::set_x, 1))?;
99
+ class.define_method("add_x", method!(MutPoint::add_x, 1))?;
100
+ class.define_method("y", method!(MutPoint::y, 0))?;
101
+ class.define_method("y=", method!(MutPoint::set_y, 1))?;
102
+ class.define_method("add_y", method!(MutPoint::add_y, 1))?;
103
+ class.define_method("distance", method!(MutPoint::distance, 1))?;
104
+
105
+ let d: f64 = ruby.eval(
106
+ "a = Point.new(0, 0)
107
+ b = Point.new(0, 0)
108
+ b.x = 5
109
+ b.y = 10
110
+ a.distance(b)",
111
+ )?;
112
+
113
+ println!("{}", d);
114
+ Ok(())
115
+ })
116
+ }
@@ -23,7 +23,7 @@ enum RubyGvlState {
23
23
  }
24
24
 
25
25
  thread_local! {
26
- static RUBY_GVL_STATE: RefCell<Option<RubyGvlState>> = RefCell::new(None);
26
+ static RUBY_GVL_STATE: RefCell<Option<RubyGvlState>> = const { RefCell::new(None) };
27
27
  }
28
28
 
29
29
  impl RubyGvlState {
@@ -68,11 +68,11 @@ impl RubyGvlState {
68
68
 
69
69
  /// A handle to access Ruby's API.
70
70
  ///
71
- /// Using Ruby's API requires the Ruby VM to be initalised and all access to be
71
+ /// Using Ruby's API requires the Ruby VM to be initialised and all access to be
72
72
  /// from a Ruby-created thread.
73
73
  ///
74
74
  /// This structure allows safe access to Ruby's API as it should only be
75
- /// possible to aquire an instance in situations where Ruby's API is known to
75
+ /// possible to acquire an instance in situations where Ruby's API is known to
76
76
  /// be available.
77
77
  ///
78
78
  /// Many functions that take Ruby values as arguments are available directly
@@ -107,6 +107,7 @@ impl RubyGvlState {
107
107
  /// * [Globals](#globals) - global variables, etc, plus current VM state such
108
108
  /// as calling the current `super` method.
109
109
  /// * [`Id`](#id) - low-level Symbol representation
110
+ /// * [`Io`](#io-helper-functions) - IO helper functions
110
111
  /// * [`Integer`](#integer)
111
112
  /// * [`Mutex`](#mutex)
112
113
  /// * [`nil`](#nil)
@@ -36,7 +36,7 @@ use crate::{
36
36
  /// See the [`Class`] trait for methods available on classes.
37
37
  /// See the [`Module`] trait for defining instance methods and nested
38
38
  /// classes/modules.
39
- /// See the [`Object`] trait for defining singlton methods (aka class methods).
39
+ /// See the [`Object`] trait for defining singleton methods (aka class methods).
40
40
  ///
41
41
  /// See the [`ReprValue`] trait for additional methods available on this type.
42
42
  #[derive(Clone, Copy)]
@@ -315,7 +315,7 @@ pub trait Class: Module {
315
315
  ///
316
316
  /// fn example(ruby: &Ruby) -> Result<(), Error> {
317
317
  /// let value = ruby.class_hash();
318
- /// // safe as we neve give Ruby a chance to free the string.
318
+ /// // safe as we never give Ruby a chance to free the string.
319
319
  /// let s = unsafe { value.name() }.into_owned();
320
320
  /// assert_eq!(s, "Hash");
321
321
  ///
@@ -329,7 +329,7 @@ pub trait Class: Module {
329
329
  ///
330
330
  /// fn example(ruby: &Ruby) -> Result<(), Error> {
331
331
  /// let value = ruby.exception_standard_error();
332
- /// // safe as we neve give Ruby a chance to free the string.
332
+ /// // safe as we never give Ruby a chance to free the string.
333
333
  /// let s = unsafe { value.name() }.into_owned();
334
334
  /// assert_eq!(s, "StandardError");
335
335
  ///
@@ -337,7 +337,7 @@ pub trait Class: Module {
337
337
  /// }
338
338
  /// # Ruby::init(example).unwrap()
339
339
  /// ```
340
- unsafe fn name(&self) -> Cow<str> {
340
+ unsafe fn name(&self) -> Cow<'_, str> {
341
341
  let ptr = rb_class2name(self.as_rb_value());
342
342
  let cstr = CStr::from_ptr(ptr);
343
343
  cstr.to_string_lossy()
@@ -504,10 +504,12 @@ pub trait Class: Module {
504
504
  });
505
505
  RB_CLASS_ALLOCATE_INSTANCE
506
506
  };
507
-
508
507
  unsafe {
509
- if rb_get_alloc_func(self.as_rb_value()) == rb_class_allocate_instance {
510
- rb_undef_alloc_func(self.as_rb_value())
508
+ let current_alloc = rb_get_alloc_func(self.as_rb_value());
509
+ if let (Some(actual), Some(default)) = (current_alloc, rb_class_allocate_instance) {
510
+ if std::ptr::eq(actual as *const (), default as *const ()) {
511
+ rb_undef_alloc_func(self.as_rb_value());
512
+ }
511
513
  }
512
514
  }
513
515
  }
@@ -6,10 +6,10 @@
6
6
  //! Encoding <-> RbEncoding <-> Index
7
7
  //! |______________________^
8
8
  //! ```
9
- //! Many functions that require an encoding take thier arguments as
9
+ //! Many functions that require an encoding take their arguments as
10
10
  //! `Into<RbEncoding>` or `Into<Index>` to ease working with the different
11
11
  //! types. The type specified for the `Into` conversion hints at the type the
12
- //! function nativly works with, and thus will avoid any conversion cost.
12
+ //! function natively works with, and thus will avoid any conversion cost.
13
13
  //!
14
14
  //! [`Encoding`] and [`RbEncoding`] both implement [`TryConvert`] and
15
15
  //! [`IntoValue`] so can be used as parameters and return values in functions
@@ -314,7 +314,7 @@ impl Ruby {
314
314
  pub struct RbEncoding(NonNull<rb_encoding>);
315
315
 
316
316
  impl RbEncoding {
317
- fn new(inner: *mut rb_encoding) -> Option<Self> {
317
+ pub(crate) fn new(inner: *mut rb_encoding) -> Option<Self> {
318
318
  NonNull::new(inner).map(Self)
319
319
  }
320
320
 
@@ -586,7 +586,7 @@ impl RbEncoding {
586
586
  /// Returns the number of bytes of the first character in `slice`.
587
587
  ///
588
588
  /// If the first byte of `slice` is mid way through a character this will
589
- /// return the number of bytes until the next character boundry.
589
+ /// return the number of bytes until the next character boundary.
590
590
  ///
591
591
  /// If the slice ends before the last byte of the character this will
592
592
  /// return the theoretical number of bytes until the end of the character,
@@ -739,7 +739,7 @@ impl RbEncoding {
739
739
  if len == 0 {
740
740
  panic!("{:?}", slice);
741
741
  }
742
- (c > -1).then(|| (c as u8, len as usize))
742
+ (c > -1).then_some((c as u8, len as usize))
743
743
  }
744
744
 
745
745
  /// Returns the codepoint and length in bytes of the first character in
@@ -5,8 +5,8 @@
5
5
  use std::{any::Any, borrow::Cow, ffi::CString, fmt, mem::transmute, os::raw::c_int};
6
6
 
7
7
  use rb_sys::{
8
- rb_bug, rb_ensure, rb_errinfo, rb_exc_raise, rb_iter_break_value, rb_jump_tag, rb_protect,
9
- rb_set_errinfo, rb_warning, ruby_special_consts, VALUE,
8
+ rb_bug, rb_ensure, rb_errinfo, rb_exc_fatal, rb_exc_raise, rb_iter_break_value, rb_jump_tag,
9
+ rb_protect, rb_set_errinfo, rb_warning, ruby_special_consts, VALUE,
10
10
  };
11
11
 
12
12
  use crate::{
@@ -19,7 +19,7 @@ use crate::{
19
19
  };
20
20
 
21
21
  /// An error returned to indicate an attempt to interact with the Ruby API from
22
- /// a non-Ruby thread or without aquiring the GVL.
22
+ /// a non-Ruby thread or without acquiring the GVL.
23
23
  #[derive(Debug)]
24
24
  pub enum RubyUnavailableError {
25
25
  /// GVL is not locked.
@@ -539,6 +539,15 @@ where
539
539
  pub(crate) fn raise(e: Error) -> ! {
540
540
  match e.0 {
541
541
  ErrorType::Jump(tag) => tag.resume(),
542
+ ErrorType::Error(class, _)
543
+ if class.as_rb_value()
544
+ == unsafe { Ruby::get_unchecked().exception_fatal().as_rb_value() } =>
545
+ {
546
+ unsafe { rb_exc_fatal(e.exception().as_rb_value()) }
547
+ // friendly reminder: we really never get here, and as such won't
548
+ // drop any values still in scope, make sure everything has been
549
+ // consumed/dropped
550
+ }
542
551
  _ => {
543
552
  unsafe { rb_exc_raise(e.exception().as_rb_value()) }
544
553
  // friendly reminder: we really never get here, and as such won't
@@ -463,11 +463,11 @@ impl Fiber {
463
463
  {
464
464
  unsafe {
465
465
  protect(|| {
466
- Value::new(rb_fiber_raise(
467
- self.as_rb_value(),
468
- 1,
469
- &e.as_rb_value() as *const VALUE,
470
- ))
466
+ #[cfg(ruby_lte_3_4)]
467
+ let e = &e.as_rb_value() as *const VALUE;
468
+ #[cfg(ruby_gt_3_4)]
469
+ let e = &mut e.as_rb_value() as *mut VALUE;
470
+ Value::new(rb_fiber_raise(self.as_rb_value(), 1, e))
471
471
  })
472
472
  .and_then(TryConvert::try_convert)
473
473
  }
@@ -212,7 +212,7 @@ where
212
212
  ///
213
213
  /// Prevents Ruby moving or collecting `valref`. This should be used on
214
214
  /// `static` items to prevent them being collected instead of relying on Ruby
215
- /// constants/globals to allways refrence the value.
215
+ /// constants/globals to always reference the value.
216
216
  ///
217
217
  /// See also [`BoxValue`](crate::value::BoxValue).
218
218
  ///
@@ -347,7 +347,7 @@ impl Ruby {
347
347
  /// Trigger a "full" GC run.
348
348
  ///
349
349
  /// This will perform a full mark phase and a complete sweep phase, but may
350
- /// not run every single proceess associated with garbage collection.
350
+ /// not run every single process associated with garbage collection.
351
351
  ///
352
352
  /// Finalisers will be deferred to run later.
353
353
  ///
@@ -552,7 +552,7 @@ pub fn enable() -> bool {
552
552
  /// Trigger a "full" GC run.
553
553
  ///
554
554
  /// This will perform a full mark phase and a complete sweep phase, but may not
555
- /// run every single proceess associated with garbage collection.
555
+ /// run every single process associated with garbage collection.
556
556
  ///
557
557
  /// Finalisers will be deferred to run later.
558
558
  ///
@@ -97,6 +97,70 @@ impl Ruby {
97
97
  )
98
98
  }
99
99
  }
100
+
101
+ /// Create a new `Integer` from an `i128.`
102
+ ///
103
+ /// # Examples
104
+ ///
105
+ /// ```
106
+ /// use magnus::{rb_assert, Error, Ruby};
107
+ ///
108
+ /// fn example(ruby: &Ruby) -> Result<(), Error> {
109
+ /// rb_assert!(ruby, "i == 0", i = ruby.integer_from_i128(0));
110
+ /// rb_assert!(
111
+ /// ruby,
112
+ /// "i == 170141183460469231731687303715884105727",
113
+ /// i = ruby.integer_from_i128(170141183460469231731687303715884105727),
114
+ /// );
115
+ /// rb_assert!(
116
+ /// ruby,
117
+ /// "i == -170141183460469231731687303715884105728",
118
+ /// i = ruby.integer_from_i128(-170141183460469231731687303715884105728),
119
+ /// );
120
+ ///
121
+ /// Ok(())
122
+ /// }
123
+ /// # Ruby::init(example).unwrap()
124
+ /// ```
125
+ #[inline]
126
+ pub fn integer_from_i128(&self, n: i128) -> Integer {
127
+ if n >= i64::MIN as i128 && n <= i64::MAX as i128 {
128
+ self.integer_from_i64(n as i64)
129
+ } else {
130
+ self.module_kernel()
131
+ .funcall("Integer", (n.to_string(),))
132
+ .unwrap()
133
+ }
134
+ }
135
+
136
+ /// Create a new `Integer` from a `u128.`
137
+ ///
138
+ /// # Examples
139
+ ///
140
+ /// ```
141
+ /// use magnus::{rb_assert, Error, Ruby};
142
+ ///
143
+ /// fn example(ruby: &Ruby) -> Result<(), Error> {
144
+ /// rb_assert!("i == 0", i = ruby.integer_from_u128(0));
145
+ /// rb_assert!(
146
+ /// "i == 340282366920938463463374607431768211455",
147
+ /// i = ruby.integer_from_u128(340282366920938463463374607431768211455),
148
+ /// );
149
+ ///
150
+ /// Ok(())
151
+ /// }
152
+ /// # Ruby::init(example).unwrap()
153
+ /// ```
154
+ #[inline]
155
+ pub fn integer_from_u128(&self, n: u128) -> Integer {
156
+ if n <= u64::MAX as u128 {
157
+ self.integer_from_u64(n as u64)
158
+ } else {
159
+ self.module_kernel()
160
+ .funcall("Integer", (n.to_string(),))
161
+ .unwrap()
162
+ }
163
+ }
100
164
  }
101
165
 
102
166
  /// A type wrapping either a [`Fixnum`] or a [`RBignum`].
@@ -330,6 +394,46 @@ impl Integer {
330
394
  }
331
395
  }
332
396
 
397
+ /// Convert `self` to an `i128`. Returns `Err` if `self` is out of range for
398
+ /// `i128`.
399
+ ///
400
+ /// # Examples
401
+ ///
402
+ /// ```
403
+ /// use magnus::{eval, Integer};
404
+ /// # let _cleanup = unsafe { magnus::embed::init() };
405
+ ///
406
+ /// assert_eq!(
407
+ /// eval::<Integer>("170141183460469231731687303715884105727")
408
+ /// .unwrap()
409
+ /// .to_i128()
410
+ /// .unwrap(),
411
+ /// 170141183460469231731687303715884105727
412
+ /// );
413
+ /// assert_eq!(
414
+ /// eval::<Integer>("-170141183460469231731687303715884105728")
415
+ /// .unwrap()
416
+ /// .to_i128()
417
+ /// .unwrap(),
418
+ /// -170141183460469231731687303715884105728
419
+ /// );
420
+ /// assert!(eval::<Integer>("170141183460469231731687303715884105728")
421
+ /// .unwrap()
422
+ /// .to_i128()
423
+ /// .is_err());
424
+ /// assert!(eval::<Integer>("-170141183460469231731687303715884105729")
425
+ /// .unwrap()
426
+ /// .to_i128()
427
+ /// .is_err());
428
+ /// ```
429
+ #[inline]
430
+ pub fn to_i128(self) -> Result<i128, Error> {
431
+ match self.integer_type() {
432
+ IntegerType::Fixnum(fix) => Ok(fix.to_i128()),
433
+ IntegerType::Bignum(big) => big.to_i128(),
434
+ }
435
+ }
436
+
333
437
  /// Convert `self` to an `isize`. Returns `Err` if `self` is out of range
334
438
  /// for `isize`.
335
439
  ///
@@ -464,6 +568,36 @@ impl Integer {
464
568
  }
465
569
  }
466
570
 
571
+ /// Convert `self` to a `u128`. Returns `Err` if `self` is negative or out of
572
+ /// range for `u128`.
573
+ ///
574
+ /// # Examples
575
+ ///
576
+ /// ```
577
+ /// use magnus::{eval, Integer};
578
+ /// # let _cleanup = unsafe { magnus::embed::init() };
579
+ ///
580
+ /// assert_eq!(
581
+ /// eval::<Integer>("340282366920938463463374607431768211455")
582
+ /// .unwrap()
583
+ /// .to_u128()
584
+ /// .unwrap(),
585
+ /// 340282366920938463463374607431768211455
586
+ /// );
587
+ /// assert!(eval::<Integer>("-1").unwrap().to_u128().is_err());
588
+ /// assert!(eval::<Integer>("340282366920938463463374607431768211456")
589
+ /// .unwrap()
590
+ /// .to_u128()
591
+ /// .is_err());
592
+ /// ```
593
+ #[inline]
594
+ pub fn to_u128(self) -> Result<u128, Error> {
595
+ match self.integer_type() {
596
+ IntegerType::Fixnum(fix) => fix.to_u128(),
597
+ IntegerType::Bignum(big) => big.to_u128(),
598
+ }
599
+ }
600
+
467
601
  /// Convert `self` to a `usize`. Returns `Err` if `self` is negative or out
468
602
  /// of range for `usize`.
469
603
  ///