script_core 0.2.7 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (283) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/Gemfile +2 -2
  4. data/ext/enterprise_script_service/Rakefile +1 -1
  5. data/ext/enterprise_script_service/mruby/.github/workflows/build.yml +117 -74
  6. data/ext/enterprise_script_service/mruby/.github/workflows/codeql-analysis.yml +41 -37
  7. data/ext/enterprise_script_service/mruby/.github/workflows/lint.yml +23 -0
  8. data/ext/enterprise_script_service/mruby/.github/workflows/oss-fuzz.yml +27 -0
  9. data/ext/enterprise_script_service/mruby/.github/workflows/spell-checker.yml +17 -0
  10. data/ext/enterprise_script_service/mruby/.gitlab-ci.yml +3 -3
  11. data/ext/enterprise_script_service/mruby/.markdownlint.yml +16 -0
  12. data/ext/enterprise_script_service/mruby/.travis.yml +2 -2
  13. data/ext/enterprise_script_service/mruby/.yamllint +8 -0
  14. data/ext/enterprise_script_service/mruby/AUTHORS +3 -0
  15. data/ext/enterprise_script_service/mruby/CODEOWNERS +1 -0
  16. data/ext/enterprise_script_service/mruby/CONTRIBUTING.md +6 -13
  17. data/ext/enterprise_script_service/mruby/Doxyfile +4 -4
  18. data/ext/enterprise_script_service/mruby/LICENSE +1 -1
  19. data/ext/enterprise_script_service/mruby/Makefile +1 -1
  20. data/ext/enterprise_script_service/mruby/README.md +4 -14
  21. data/ext/enterprise_script_service/mruby/Rakefile +18 -108
  22. data/ext/enterprise_script_service/mruby/TODO.md +17 -0
  23. data/ext/enterprise_script_service/mruby/appveyor.yml +31 -25
  24. data/ext/enterprise_script_service/mruby/benchmark/bm_ao_render.rb +1 -1
  25. data/ext/enterprise_script_service/mruby/build_config.rb +9 -152
  26. data/ext/enterprise_script_service/mruby/{examples/targets/build_config_ArduinoDue.rb → build_config/ArduinoDue.rb} +2 -19
  27. data/ext/enterprise_script_service/mruby/{examples/targets/build_config_IntelEdison.rb → build_config/IntelEdison.rb} +2 -2
  28. data/ext/enterprise_script_service/mruby/{examples/targets/build_config_IntelGalileo.rb → build_config/IntelGalileo.rb} +1 -18
  29. data/ext/enterprise_script_service/mruby/{examples/targets/build_config_RX630.rb → build_config/RX630.rb} +2 -19
  30. data/ext/enterprise_script_service/mruby/build_config/android_arm64-v8a.rb +11 -0
  31. data/ext/enterprise_script_service/mruby/build_config/android_armeabi.rb +11 -0
  32. data/ext/enterprise_script_service/mruby/{examples/targets/build_config_android_armeabi_v7a_neon_hard.rb → build_config/android_armeabi_v7a_neon_hard.rb} +0 -15
  33. data/ext/enterprise_script_service/mruby/build_config/bench.rb +11 -0
  34. data/ext/enterprise_script_service/mruby/build_config/boxing.rb +21 -0
  35. data/ext/enterprise_script_service/mruby/{examples/targets/build_config_chipKITMax32.rb → build_config/chipKITMax32.rb} +2 -19
  36. data/ext/enterprise_script_service/mruby/{travis_config.rb → build_config/ci/gcc-clang.rb} +10 -10
  37. data/ext/enterprise_script_service/mruby/build_config/ci/msvc.rb +20 -0
  38. data/ext/enterprise_script_service/mruby/build_config/clang-asan.rb +11 -0
  39. data/ext/enterprise_script_service/mruby/build_config/cross-32bit.rb +14 -0
  40. data/ext/enterprise_script_service/mruby/build_config/default.rb +80 -0
  41. data/ext/enterprise_script_service/mruby/{examples/targets/build_config_dreamcast_shelf.rb → build_config/dreamcast_shelf.rb} +5 -19
  42. data/ext/enterprise_script_service/mruby/build_config/gameboyadvance.rb +73 -0
  43. data/ext/enterprise_script_service/mruby/build_config/host-cxx.rb +12 -0
  44. data/ext/enterprise_script_service/mruby/build_config/host-debug.rb +20 -0
  45. data/ext/enterprise_script_service/mruby/build_config/host-gprof.rb +14 -0
  46. data/ext/enterprise_script_service/mruby/build_config/host-m32.rb +15 -0
  47. data/ext/enterprise_script_service/mruby/build_config/host-shared.rb +36 -0
  48. data/ext/enterprise_script_service/mruby/build_config/mrbc.rb +11 -0
  49. data/ext/enterprise_script_service/mruby/build_config/no-float.rb +17 -0
  50. data/ext/enterprise_script_service/mruby/doc/guides/compile.md +138 -49
  51. data/ext/enterprise_script_service/mruby/doc/guides/debugger.md +5 -4
  52. data/ext/enterprise_script_service/mruby/doc/guides/gc-arena-howto.md +1 -1
  53. data/ext/enterprise_script_service/mruby/doc/guides/mrbconf.md +49 -22
  54. data/ext/enterprise_script_service/mruby/doc/guides/mrbgems.md +31 -14
  55. data/ext/enterprise_script_service/mruby/doc/guides/symbol.md +83 -0
  56. data/ext/enterprise_script_service/mruby/doc/limitations.md +35 -36
  57. data/ext/enterprise_script_service/mruby/doc/mruby3.md +163 -0
  58. data/ext/enterprise_script_service/mruby/doc/opcode.md +93 -107
  59. data/ext/enterprise_script_service/mruby/examples/mrbgems/c_and_ruby_extension_example/mrblib/example.rb +1 -1
  60. data/ext/enterprise_script_service/mruby/examples/mrbgems/c_and_ruby_extension_example/src/example.c +5 -1
  61. data/ext/enterprise_script_service/mruby/examples/mrbgems/c_extension_example/src/example.c +5 -1
  62. data/ext/enterprise_script_service/mruby/examples/mrbgems/ruby_extension_example/mrblib/example.rb +1 -1
  63. data/ext/enterprise_script_service/mruby/include/mrbconf.h +81 -62
  64. data/ext/enterprise_script_service/mruby/include/mruby.h +137 -96
  65. data/ext/enterprise_script_service/mruby/include/mruby/array.h +23 -6
  66. data/ext/enterprise_script_service/mruby/include/mruby/boxing_nan.h +73 -48
  67. data/ext/enterprise_script_service/mruby/include/mruby/boxing_no.h +8 -8
  68. data/ext/enterprise_script_service/mruby/include/mruby/boxing_word.h +79 -48
  69. data/ext/enterprise_script_service/mruby/include/mruby/class.h +10 -8
  70. data/ext/enterprise_script_service/mruby/include/mruby/common.h +4 -1
  71. data/ext/enterprise_script_service/mruby/include/mruby/compile.h +13 -7
  72. data/ext/enterprise_script_service/mruby/include/mruby/debug.h +2 -2
  73. data/ext/enterprise_script_service/mruby/include/mruby/dump.h +17 -35
  74. data/ext/enterprise_script_service/mruby/include/mruby/endian.h +44 -0
  75. data/ext/enterprise_script_service/mruby/include/mruby/error.h +39 -5
  76. data/ext/enterprise_script_service/mruby/include/mruby/gc.h +1 -0
  77. data/ext/enterprise_script_service/mruby/include/mruby/hash.h +33 -13
  78. data/ext/enterprise_script_service/mruby/include/mruby/irep.h +64 -14
  79. data/ext/enterprise_script_service/mruby/include/mruby/khash.h +6 -14
  80. data/ext/enterprise_script_service/mruby/include/mruby/numeric.h +36 -63
  81. data/ext/enterprise_script_service/mruby/include/mruby/opcode.h +1 -27
  82. data/ext/enterprise_script_service/mruby/include/mruby/ops.h +27 -23
  83. data/ext/enterprise_script_service/mruby/include/mruby/presym.h +40 -0
  84. data/ext/enterprise_script_service/mruby/include/mruby/presym/disable.h +70 -0
  85. data/ext/enterprise_script_service/mruby/include/mruby/presym/enable.h +37 -0
  86. data/ext/enterprise_script_service/mruby/include/mruby/presym/scanning.h +73 -0
  87. data/ext/enterprise_script_service/mruby/include/mruby/proc.h +80 -13
  88. data/ext/enterprise_script_service/mruby/include/mruby/string.h +10 -15
  89. data/ext/enterprise_script_service/mruby/include/mruby/throw.h +14 -3
  90. data/ext/enterprise_script_service/mruby/include/mruby/value.h +29 -19
  91. data/ext/enterprise_script_service/mruby/include/mruby/variable.h +1 -0
  92. data/ext/enterprise_script_service/mruby/include/mruby/version.h +26 -7
  93. data/ext/enterprise_script_service/mruby/lib/mruby/build.rb +198 -44
  94. data/ext/enterprise_script_service/mruby/lib/mruby/build/command.rb +55 -37
  95. data/ext/enterprise_script_service/mruby/lib/mruby/build/load_gems.rb +12 -10
  96. data/ext/enterprise_script_service/mruby/lib/{mruby-core-ext.rb → mruby/core_ext.rb} +10 -3
  97. data/ext/enterprise_script_service/mruby/lib/mruby/gem.rb +75 -32
  98. data/ext/enterprise_script_service/mruby/lib/mruby/lockfile.rb +1 -1
  99. data/ext/enterprise_script_service/mruby/lib/mruby/presym.rb +132 -0
  100. data/ext/enterprise_script_service/mruby/mrbgems/default-no-fpu.gembox +3 -0
  101. data/ext/enterprise_script_service/mruby/mrbgems/default-no-stdio.gembox +4 -0
  102. data/ext/enterprise_script_service/mruby/mrbgems/default.gembox +9 -88
  103. data/ext/enterprise_script_service/mruby/mrbgems/full-core.gembox +1 -4
  104. data/ext/enterprise_script_service/mruby/mrbgems/math.gembox +10 -0
  105. data/ext/enterprise_script_service/mruby/mrbgems/metaprog.gembox +15 -0
  106. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +1 -1
  107. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/src/array.c +5 -4
  108. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-config/mrbgem.rake +28 -19
  109. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-config/mruby-config +18 -8
  110. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/bintest/mrdb.rb +3 -6
  111. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/bintest/print.rb +10 -10
  112. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c +14 -9
  113. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.c +3 -2
  114. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +4 -3
  115. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.h +2 -6
  116. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +4 -4
  117. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/bintest/mirb.rb +23 -5
  118. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/mrbgem.rake +11 -2
  119. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +41 -34
  120. data/ext/enterprise_script_service/mruby/mrbgems/{mruby-compiler → mruby-bin-mrbc}/bintest/mrbc.rb +0 -0
  121. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mrbc/mrbgem.rake +3 -4
  122. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +19 -9
  123. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/bintest/mruby.rb +25 -4
  124. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/mrbgem.rake +1 -1
  125. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +22 -6
  126. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-strip/bintest/mruby-strip.rb +1 -1
  127. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c +2 -2
  128. data/ext/enterprise_script_service/mruby/mrbgems/mruby-catch/mrbgem.rake +5 -0
  129. data/ext/enterprise_script_service/mruby/mrbgems/mruby-catch/mrblib/catch.rb +27 -0
  130. data/ext/enterprise_script_service/mruby/mrbgems/mruby-class-ext/src/class.c +2 -1
  131. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/codegen.c +430 -399
  132. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/keywords +5 -0
  133. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/lex.def +49 -44
  134. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/parse.y +559 -217
  135. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/y.tab.c +4774 -4193
  136. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/mrbgem.rake +18 -19
  137. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrblib/complex.rb +1 -1
  138. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/src/complex.c +8 -7
  139. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/test/complex.rb +4 -4
  140. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrblib/enumerator.rb +1 -0
  141. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/test/enumerator.rb +2 -2
  142. data/ext/enterprise_script_service/mruby/mrbgems/mruby-error/mrbgem.rake +2 -2
  143. data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/src/eval.c +17 -25
  144. data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/src/fiber.c +18 -13
  145. data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/src/hash-ext.c +30 -2
  146. data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/test/hash.rb +7 -0
  147. data/ext/enterprise_script_service/mruby/mrbgems/mruby-inline-struct/test/inline.c +2 -2
  148. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/README.md +18 -16
  149. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/include/mruby/ext/io.h +2 -2
  150. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/file.rb +9 -4
  151. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/io.rb +2 -2
  152. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file.c +55 -52
  153. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file_test.c +4 -2
  154. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/io.c +99 -87
  155. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file.rb +2 -0
  156. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/io.rb +2 -3
  157. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/mruby_io_test.c +1 -1
  158. data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/src/kernel.c +7 -6
  159. data/ext/enterprise_script_service/mruby/mrbgems/mruby-math/src/math.c +13 -12
  160. data/ext/enterprise_script_service/mruby/mrbgems/mruby-math/test/math.rb +5 -4
  161. data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/src/metaprog.c +43 -58
  162. data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/test/metaprog.rb +4 -4
  163. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/README.md +4 -3
  164. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/src/method.c +77 -74
  165. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/test/method.rb +4 -4
  166. data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/src/numeric_ext.c +14 -13
  167. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/src/object.c +5 -4
  168. data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +18 -12
  169. data/ext/enterprise_script_service/mruby/mrbgems/mruby-os-memsize/mrbgem.rake +10 -0
  170. data/ext/enterprise_script_service/mruby/mrbgems/mruby-os-memsize/src/memsize.c +231 -0
  171. data/ext/enterprise_script_service/mruby/mrbgems/mruby-os-memsize/test/memsize.rb +63 -0
  172. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/README.md +15 -18
  173. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/src/pack.c +38 -88
  174. data/ext/enterprise_script_service/mruby/mrbgems/mruby-print/mrblib/print.rb +1 -30
  175. data/ext/enterprise_script_service/mruby/mrbgems/mruby-print/src/print.c +62 -26
  176. data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/src/proc.c +32 -19
  177. data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/test/proc.c +1 -1
  178. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.c +98 -43
  179. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/test/random.rb +2 -2
  180. data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/mrblib/range.rb +39 -6
  181. data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/src/range.c +20 -40
  182. data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/test/range.rb +27 -3
  183. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrblib/rational.rb +11 -17
  184. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/src/rational.c +216 -38
  185. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/test/rational.rb +6 -6
  186. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/README.md +6 -4
  187. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/src/mrb_sleep.c +4 -4
  188. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/README.md +3 -2
  189. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/src/socket.c +47 -45
  190. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/sprintf.c +102 -71
  191. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/test/sprintf.rb +4 -2
  192. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +23 -1
  193. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/src/string.c +13 -9
  194. data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/mrblib/struct.rb +1 -1
  195. data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/src/struct.c +18 -25
  196. data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +6 -5
  197. data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +1 -1
  198. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/README.md +0 -1
  199. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/driver.c +5 -5
  200. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/mrbgem.rake +16 -44
  201. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/vformat.c +4 -4
  202. data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/src/time.c +27 -27
  203. data/ext/enterprise_script_service/mruby/mrbgems/stdlib-ext.gembox +18 -0
  204. data/ext/enterprise_script_service/mruby/mrbgems/stdlib-io.gembox +12 -0
  205. data/ext/enterprise_script_service/mruby/mrbgems/stdlib.gembox +54 -0
  206. data/ext/enterprise_script_service/mruby/mrblib/10error.rb +4 -0
  207. data/ext/enterprise_script_service/mruby/mrblib/array.rb +17 -9
  208. data/ext/enterprise_script_service/mruby/mrblib/enum.rb +1 -1
  209. data/ext/enterprise_script_service/mruby/mrblib/hash.rb +0 -20
  210. data/ext/enterprise_script_service/mruby/mrblib/init_mrblib.c +0 -11
  211. data/ext/enterprise_script_service/mruby/mrblib/numeric.rb +36 -11
  212. data/ext/enterprise_script_service/mruby/mrblib/range.rb +25 -3
  213. data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_proto_fuzzer.cpp +2 -2
  214. data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.h +1 -1
  215. data/ext/enterprise_script_service/mruby/src/array.c +43 -80
  216. data/ext/enterprise_script_service/mruby/src/backtrace.c +16 -17
  217. data/ext/enterprise_script_service/mruby/src/class.c +774 -182
  218. data/ext/enterprise_script_service/mruby/src/codedump.c +223 -198
  219. data/ext/enterprise_script_service/mruby/src/debug.c +6 -6
  220. data/ext/enterprise_script_service/mruby/src/dump.c +466 -141
  221. data/ext/enterprise_script_service/mruby/src/enum.c +1 -1
  222. data/ext/enterprise_script_service/mruby/src/error.c +36 -13
  223. data/ext/enterprise_script_service/mruby/src/etc.c +43 -34
  224. data/ext/enterprise_script_service/mruby/src/fmt_fp.c +5 -6
  225. data/ext/enterprise_script_service/mruby/src/gc.c +73 -71
  226. data/ext/enterprise_script_service/mruby/src/hash.c +1050 -707
  227. data/ext/enterprise_script_service/mruby/src/kernel.c +75 -220
  228. data/ext/enterprise_script_service/mruby/src/load.c +196 -166
  229. data/ext/enterprise_script_service/mruby/src/numeric.c +352 -314
  230. data/ext/enterprise_script_service/mruby/src/object.c +97 -90
  231. data/ext/enterprise_script_service/mruby/src/print.c +4 -3
  232. data/ext/enterprise_script_service/mruby/src/proc.c +48 -56
  233. data/ext/enterprise_script_service/mruby/src/range.c +45 -21
  234. data/ext/enterprise_script_service/mruby/src/state.c +25 -32
  235. data/ext/enterprise_script_service/mruby/src/string.c +59 -101
  236. data/ext/enterprise_script_service/mruby/src/symbol.c +121 -56
  237. data/ext/enterprise_script_service/mruby/src/value_array.h +1 -0
  238. data/ext/enterprise_script_service/mruby/src/variable.c +158 -158
  239. data/ext/enterprise_script_service/mruby/src/vm.c +617 -602
  240. data/ext/enterprise_script_service/mruby/tasks/benchmark.rake +6 -6
  241. data/ext/enterprise_script_service/mruby/tasks/bin.rake +23 -0
  242. data/ext/enterprise_script_service/mruby/tasks/core.rake +12 -0
  243. data/ext/enterprise_script_service/mruby/tasks/doc.rake +50 -38
  244. data/ext/enterprise_script_service/mruby/tasks/gitlab.rake +83 -77
  245. data/ext/enterprise_script_service/mruby/tasks/libmruby.rake +10 -1
  246. data/ext/enterprise_script_service/mruby/tasks/mrbgems.rake +13 -1
  247. data/ext/enterprise_script_service/mruby/tasks/mrblib.rake +40 -0
  248. data/ext/enterprise_script_service/mruby/tasks/presym.rake +44 -0
  249. data/ext/enterprise_script_service/mruby/tasks/test.rake +68 -0
  250. data/ext/enterprise_script_service/mruby/tasks/toolchains/gcc.rake +6 -5
  251. data/ext/enterprise_script_service/mruby/tasks/toolchains/openwrt.rake +10 -14
  252. data/ext/enterprise_script_service/mruby/tasks/toolchains/visualcpp.rake +17 -21
  253. data/ext/enterprise_script_service/mruby/test/bintest.rb +5 -5
  254. data/ext/enterprise_script_service/mruby/test/t/argumenterror.rb +16 -0
  255. data/ext/enterprise_script_service/mruby/test/t/array.rb +7 -3
  256. data/ext/enterprise_script_service/mruby/test/t/bs_literal.rb +1 -1
  257. data/ext/enterprise_script_service/mruby/test/t/float.rb +18 -8
  258. data/ext/enterprise_script_service/mruby/test/t/hash.rb +903 -281
  259. data/ext/enterprise_script_service/mruby/test/t/integer.rb +10 -38
  260. data/ext/enterprise_script_service/mruby/test/t/kernel.rb +1 -1
  261. data/ext/enterprise_script_service/mruby/test/t/literals.rb +50 -0
  262. data/ext/enterprise_script_service/mruby/test/t/module.rb +2 -2
  263. data/ext/enterprise_script_service/mruby/test/t/numeric.rb +1 -1
  264. data/ext/enterprise_script_service/mruby/test/t/range.rb +83 -1
  265. data/ext/enterprise_script_service/mruby/test/t/string.rb +4 -0
  266. data/ext/enterprise_script_service/mruby/test/t/superclass.rb +10 -10
  267. data/ext/enterprise_script_service/mruby/test/t/syntax.rb +24 -0
  268. data/ext/enterprise_script_service/mruby/test/t/vformat.rb +3 -3
  269. data/ext/enterprise_script_service/mruby_config.rb +2 -5
  270. data/ext/enterprise_script_service/mruby_engine.cpp +1 -1
  271. data/lib/script_core/version.rb +1 -1
  272. data/spec/script_core_spec.rb +13 -0
  273. metadata +61 -23
  274. data/ext/enterprise_script_service/mruby/.github/workflows/main.yml +0 -24
  275. data/ext/enterprise_script_service/mruby/TODO +0 -8
  276. data/ext/enterprise_script_service/mruby/appveyor_config.rb +0 -46
  277. data/ext/enterprise_script_service/mruby/benchmark/build_config_boxing.rb +0 -28
  278. data/ext/enterprise_script_service/mruby/examples/targets/build_config_android_arm64-v8a.rb +0 -26
  279. data/ext/enterprise_script_service/mruby/examples/targets/build_config_android_armeabi.rb +0 -26
  280. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/kernel.c +0 -30
  281. data/ext/enterprise_script_service/mruby/mrblib/mrblib.rake +0 -18
  282. data/ext/enterprise_script_service/mruby/src/crc.c +0 -39
  283. data/ext/enterprise_script_service/mruby/src/mruby_core.rake +0 -19
@@ -32,28 +32,22 @@ def shellquote(s)
32
32
  end
33
33
  end
34
34
 
35
- NotFoundCommands = {}
36
-
37
35
  private
38
36
  def _run(options, params={})
39
- return sh command + ' ' + ( options % params ) if NotFoundCommands.key? @command
40
- begin
41
- sh build.filename(command) + ' ' + ( options % params )
42
- rescue RuntimeError
43
- NotFoundCommands[@command] = true
44
- _run options, params
45
- end
37
+ sh "#{build.filename(command)} #{options % params}"
46
38
  end
47
39
  end
48
40
 
49
41
  class Command::Compiler < Command
50
- attr_accessor :flags, :include_paths, :defines, :source_exts
42
+ attr_accessor :label, :flags, :include_paths, :defines, :source_exts
51
43
  attr_accessor :compile_options, :option_define, :option_include_path, :out_ext
52
44
  attr_accessor :cxx_compile_flag, :cxx_exception_flag, :cxx_invalid_flags
45
+ attr_writer :preprocess_options
53
46
 
54
- def initialize(build, source_exts=[])
47
+ def initialize(build, source_exts=[], label: "CC")
55
48
  super(build)
56
49
  @command = ENV['CC'] || 'cc'
50
+ @label = label
57
51
  @flags = [ENV['CFLAGS'] || []]
58
52
  @source_exts = source_exts
59
53
  @include_paths = ["#{MRUBY_ROOT}/include"]
@@ -62,9 +56,15 @@ def initialize(build, source_exts=[])
62
56
  @option_define = %q[-D"%s"]
63
57
  @compile_options = %q[%{flags} -o "%{outfile}" -c "%{infile}"]
64
58
  @cxx_invalid_flags = []
59
+ @out_ext = build.exts.object
65
60
  end
66
61
 
67
62
  alias header_search_paths include_paths
63
+
64
+ def preprocess_options
65
+ @preprocess_options ||= @compile_options.sub(/(?:\A|\s)\K-c(?=\s)/, "-E -P")
66
+ end
67
+
68
68
  def search_header_path(name)
69
69
  header_search_paths.find do |v|
70
70
  File.exist? build.filename("#{v}/#{name}").sub(/^"(.*)"$/, '\1')
@@ -86,13 +86,20 @@ def all_flags(_defines=[], _include_paths=[], _flags=[])
86
86
 
87
87
  def run(outfile, infile, _defines=[], _include_paths=[], _flags=[])
88
88
  mkdir_p File.dirname(outfile)
89
- _pp "CC", infile.relative_path, outfile.relative_path
90
- _run compile_options, { :flags => all_flags(_defines, _include_paths, _flags),
91
- :infile => filename(infile), :outfile => filename(outfile) }
89
+ flags = all_flags(_defines, _include_paths, _flags)
90
+ if object_ext?(outfile)
91
+ label = @label
92
+ opts = compile_options
93
+ else
94
+ label = "CPP"
95
+ opts = preprocess_options
96
+ flags << " -DMRB_PRESYM_SCANNING"
97
+ end
98
+ _pp label, infile.relative_path, outfile.relative_path
99
+ _run opts, flags: flags, infile: filename(infile), outfile: filename(outfile)
92
100
  end
93
101
 
94
- def define_rules(build_dir, source_dir='')
95
- @out_ext = build.exts.object
102
+ def define_rules(build_dir, source_dir='', out_ext=build.exts.object)
96
103
  gemrake = File.join(source_dir, "mrbgem.rake")
97
104
  rakedep = File.exist?(gemrake) ? [ gemrake ] : []
98
105
 
@@ -133,18 +140,14 @@ def define_rules(build_dir, source_dir='')
133
140
  #
134
141
  # ==== Without <tt>-MP</tt> compiler flag
135
142
  #
136
- # /build/host/src/array.o: \
137
- # /src/array.c \
138
- # /include/mruby/common.h \
139
- # /include/mruby/value.h \
143
+ # /build/host/src/array.o: /src/array.c \
144
+ # /include/mruby/common.h /include/mruby/value.h \
140
145
  # /src/value_array.h
141
146
  #
142
147
  # ==== With <tt>-MP</tt> compiler flag
143
148
  #
144
- # /build/host/src/array.o: \
145
- # /src/array.c \
146
- # /include/mruby/common.h \
147
- # /include/mruby/value.h \
149
+ # /build/host/src/array.o: /src/array.c \
150
+ # /include/mruby/common.h /include/mruby/value.h \
148
151
  # /src/value_array.h
149
152
  #
150
153
  # /include/mruby/common.h:
@@ -154,14 +157,25 @@ def define_rules(build_dir, source_dir='')
154
157
  # /src/value_array.h:
155
158
  #
156
159
  def get_dependencies(file)
157
- file = file.ext('d') unless File.extname(file) == '.d'
158
- deps = []
159
- if File.exist?(file)
160
- File.foreach(file){|line| deps << $1 if /^ +(.*?)(?: *\\)?$/ =~ line}
161
- deps.uniq!
162
- end
160
+ dep_file = file.ext(".d")
161
+ return [MRUBY_CONFIG] unless object_ext?(file) && File.exist?(dep_file)
162
+
163
+ deps = File.read(dep_file).gsub("\\\n ", "").split("\n").map do |dep_line|
164
+ # dep_line:
165
+ # - "/build/host/src/array.o: /src/array.c /include/mruby/common.h ..."
166
+ # - ""
167
+ # - "/include/mruby/common.h:"
168
+ dep_line.scan(/^\S+:\s+(.+)$/).flatten.map { |s| s.split(' ') }.flatten
169
+ # => ["/src/array.c", "/include/mruby/common.h" , ...]
170
+ # []
171
+ # []
172
+ end.flatten.uniq
163
173
  deps << MRUBY_CONFIG
164
174
  end
175
+
176
+ def object_ext?(path)
177
+ File.extname(path) == build.exts.object
178
+ end
165
179
  end
166
180
 
167
181
  class Command::Linker < Command
@@ -191,6 +205,10 @@ def library_flags(_libraries)
191
205
  [libraries, _libraries].flatten.map{ |d| option_library % d }.join(' ')
192
206
  end
193
207
 
208
+ def run_attrs
209
+ [@libraries, @library_paths, @flags, @flags_before_libraries, @flags_after_libraries]
210
+ end
211
+
194
212
  def run(outfile, objfiles, _libraries=[], _library_paths=[], _flags=[], _flags_before_libraries=[], _flags_after_libraries=[])
195
213
  mkdir_p File.dirname(outfile)
196
214
  library_flags = [libraries, _libraries].flatten.map { |d| option_library % d }
@@ -310,21 +328,21 @@ def initialize(build)
310
328
  @compile_options = "-B%{funcname} -o-"
311
329
  end
312
330
 
313
- def run(out, infiles, funcname)
331
+ def run(out, infiles, funcname, cdump = true)
314
332
  @command ||= @build.mrbcfile
315
333
  infiles = [infiles].flatten
316
- infiles.each do |f|
317
- _pp "MRBC", f.relative_path, nil, :indent => 2
334
+ infiles.each_with_index do |f, i|
335
+ _pp i == 0 ? "MRBC" : "", f.relative_path, indent: 2
318
336
  end
319
- cmd = %Q["#{filename @command}" #{@compile_options % {:funcname => funcname}} #{filename(infiles).map{|f| %Q["#{f}"]}.join(' ')}]
337
+ cmd = %Q["#{filename @command}" #{cdump ? "-S" : ""} #{@compile_options % {:funcname => funcname}} #{filename(infiles).map{|f| %Q["#{f}"]}.join(' ')}]
320
338
  puts cmd if Rake.verbose
321
339
  IO.popen(cmd, 'r+') do |io|
322
340
  out.puts io.read
323
341
  end
324
342
  # if mrbc execution fail, drop the file
325
- if $?.exitstatus != 0
326
- File.delete(out.path)
327
- exit(-1)
343
+ unless $?.success?
344
+ rm_f out.path
345
+ fail "Command failed with status (#{$?.exitstatus}): [#{cmd[0,42]}...]"
328
346
  end
329
347
  end
330
348
  end
@@ -15,10 +15,13 @@ def gembox(gemboxfile)
15
15
  def gem(gemdir, &block)
16
16
  if gemdir.is_a?(Hash)
17
17
  gemdir = load_special_path_gem(gemdir)
18
- elsif GemBox.path && gemdir.is_a?(String)
18
+ elsif GemBox.path
19
19
  gemdir = File.expand_path(gemdir, File.dirname(GemBox.path))
20
20
  else
21
21
  caller_dir = File.expand_path(File.dirname(caller(1,1)[0][/^(.*?):\d/,1]))
22
+ if caller_dir == "#{MRUBY_ROOT}/build_config"
23
+ caller_dir = MRUBY_ROOT
24
+ end
22
25
  gemdir = File.expand_path(gemdir, caller_dir)
23
26
  end
24
27
 
@@ -28,18 +31,17 @@ def gem(gemdir, &block)
28
31
  Gem.current = nil
29
32
  load gemrake
30
33
  return nil unless Gem.current
34
+ current = Gem.current
31
35
 
32
- Gem.current.dir = gemdir
33
- Gem.current.build = self.is_a?(MRuby::Build) ? self : MRuby::Build.current
34
- Gem.current.build_config_initializer = block
35
- gems << Gem.current
36
+ current.dir = gemdir
37
+ current.build = self.is_a?(MRuby::Build) ? self : MRuby::Build.current
38
+ current.build_config_initializer = block
39
+ gems << current
36
40
 
37
- cxx_srcs = ['src', 'test', 'tools'].map do |subdir|
38
- Dir.glob("#{Gem.current.dir}/#{subdir}/*.{cpp,cxx,cc}")
39
- end.flatten
41
+ cxx_srcs = Dir.glob("#{current.dir}/{src,test,tools}/*.{cpp,cxx,cc}")
40
42
  enable_cxx_exception unless cxx_srcs.empty?
41
43
 
42
- Gem.current
44
+ current
43
45
  end
44
46
 
45
47
  def load_special_path_gem(params)
@@ -98,7 +100,7 @@ def load_special_path_gem(params)
98
100
  options = [params[:options]] || []
99
101
  options << "--recursive"
100
102
  options << "--branch \"#{branch}\""
101
- options << "--depth 1" unless params[:checksum_hash]
103
+ options << "--depth 1" unless params[:checksum_hash] || lock
102
104
  mkdir_p "#{gem_clone_dir}"
103
105
  git.run_clone gemdir, url, options
104
106
 
@@ -20,10 +20,17 @@ def relative_path
20
20
  end
21
21
  end
22
22
 
23
- def _pp(cmd, src, tgt=nil, options={})
24
- return if Rake.verbose
23
+ def install_D(src, dst)
24
+ _pp "INSTALL", src.relative_path, dst.relative_path
25
+ rm_f dst
26
+ mkdir_p File.dirname(dst)
27
+ cp src, dst
28
+ end
29
+
30
+ def _pp(cmd, src, tgt=nil, indent: nil)
31
+ return if Rake.application.options.silent
25
32
 
26
33
  width = 5
27
- template = options[:indent] ? "%#{width*options[:indent]}s %s %s" : "%-#{width}s %s %s"
34
+ template = indent ? "%#{width * indent}s %s %s" : "%-#{width}s %s %s"
28
35
  puts template % [cmd, src, tgt ? "-> #{tgt}" : nil]
29
36
  end
@@ -7,7 +7,6 @@ module Gem
7
7
  class << self
8
8
  attr_accessor :current
9
9
  end
10
- LinkerConfig = Struct.new(:libraries, :library_paths, :flags, :flags_before_libraries, :flags_after_libraries)
11
10
 
12
11
  class Specification
13
12
  include Rake::DSL
@@ -17,7 +16,6 @@ class Specification
17
16
  attr_accessor :name, :dir, :build
18
17
  alias mruby build
19
18
  attr_accessor :build_config_initializer
20
- attr_accessor :mrblib_dir, :objs_dir
21
19
 
22
20
  attr_accessor :version
23
21
  attr_accessor :description, :summary
@@ -27,8 +25,8 @@ class Specification
27
25
  alias :author= :authors=
28
26
 
29
27
  attr_accessor :rbfiles, :objs
30
- attr_accessor :test_objs, :test_rbfiles, :test_args
31
- attr_accessor :test_preload
28
+ attr_writer :test_objs, :test_rbfiles
29
+ attr_accessor :test_args, :test_preload
32
30
 
33
31
  attr_accessor :bins
34
32
 
@@ -45,37 +43,30 @@ def initialize(name, &block)
45
43
  @name = name
46
44
  @initializer = block
47
45
  @version = "0.0.0"
48
- @mrblib_dir = "mrblib"
49
- @objs_dir = "src"
46
+ @dependencies = []
47
+ @conflicts = []
50
48
  MRuby::Gem.current = self
51
49
  end
52
50
 
53
51
  def setup
54
- return if defined?(@linker) # return if already set up
52
+ return if defined?(@bins) # return if already set up
55
53
 
56
54
  MRuby::Gem.current = self
57
55
  MRuby::Build::COMMANDS.each do |command|
58
56
  instance_variable_set("@#{command}", @build.send(command).clone)
59
57
  end
60
- @linker = LinkerConfig.new([], [], [], [], [])
58
+ @linker.run_attrs.each(&:clear)
61
59
 
62
- @rbfiles = Dir.glob("#{@dir}/#{@mrblib_dir}/**/*.rb").sort
63
- @objs = Dir.glob("#{@dir}/#{@objs_dir}/*.{c,cpp,cxx,cc,m,asm,s,S}").map do |f|
64
- objfile(f.relative_path_from(@dir).to_s.pathmap("#{build_dir}/%X"))
65
- end
60
+ @rbfiles = Dir.glob("#{@dir}/mrblib/**/*.rb").sort
61
+ @objs = srcs_to_objs("src")
66
62
 
67
- @test_rbfiles = Dir.glob("#{dir}/test/**/*.rb").sort
68
- @test_objs = Dir.glob("#{dir}/test/*.{c,cpp,cxx,cc,m,asm,s,S}").map do |f|
69
- objfile(f.relative_path_from(dir).to_s.pathmap("#{build_dir}/%X"))
70
- end
71
- @custom_test_init = !@test_objs.empty?
72
63
  @test_preload = nil # 'test/assert.rb'
73
64
  @test_args = {}
74
65
 
75
66
  @bins = []
67
+ @cdump = true
76
68
 
77
69
  @requirements = []
78
- @dependencies, @conflicts = [], []
79
70
  @export_include_paths = []
80
71
  @export_include_paths << "#{dir}/include" if File.directory? "#{dir}/include"
81
72
 
@@ -97,10 +88,11 @@ def setup
97
88
  end
98
89
 
99
90
  def setup_compilers
100
- compilers.each do |compiler|
101
- compiler.define_rules build_dir, "#{dir}"
91
+ (core? ? [@cc, *(@cxx if build.cxx_exception_enabled?)] : compilers).each do |compiler|
92
+ compiler.define_rules build_dir, @dir, @build.exts.presym_preprocessed if build.presym_enabled?
93
+ compiler.define_rules build_dir, @dir, @build.exts.object
102
94
  compiler.defines << %Q[MRBGEM_#{funcname.upcase}_VERSION=#{version}]
103
- compiler.include_paths << "#{dir}/include" if File.directory? "#{dir}/include"
95
+ compiler.include_paths << "#{@dir}/include" if File.directory? "#{@dir}/include"
104
96
  end
105
97
 
106
98
  define_gem_init_builder if @generate_functions
@@ -115,6 +107,18 @@ def for_windows?
115
107
  return false
116
108
  end
117
109
 
110
+ def disable_cdump
111
+ @cdump = false
112
+ end
113
+
114
+ def cdump?
115
+ build.presym_enabled? && @cdump
116
+ end
117
+
118
+ def core?
119
+ @dir.start_with?("#{MRUBY_ROOT}/mrbgems/")
120
+ end
121
+
118
122
  def add_dependency(name, *requirements)
119
123
  default_gem = requirements.last.kind_of?(Hash) ? requirements.pop : nil
120
124
  requirements = ['>= 0.0.0'] if requirements.empty?
@@ -138,6 +142,14 @@ def test_rbireps
138
142
  "#{build_dir}/gem_test.c"
139
143
  end
140
144
 
145
+ def test_objs
146
+ @test_objs ||= srcs_to_objs("test")
147
+ end
148
+
149
+ def test_rbfiles
150
+ @test_rbfiles ||= Dir["#{@dir}/test/**/*.rb"].sort!
151
+ end
152
+
141
153
  def search_package(name, version_query=nil)
142
154
  package_query = name
143
155
  package_query += " #{version_query}" if version_query
@@ -163,8 +175,14 @@ def compilers
163
175
  end
164
176
  end
165
177
 
178
+ def srcs_to_objs(src_dir_from_gem_dir)
179
+ exts = compilers.flat_map{|c| c.source_exts} * ","
180
+ Dir["#{@dir}/#{src_dir_from_gem_dir}/*{#{exts}}"].map do |f|
181
+ objfile(f.relative_path_from(@dir).to_s.pathmap("#{build_dir}/%X"))
182
+ end
183
+ end
184
+
166
185
  def define_gem_init_builder
167
- file objfile("#{build_dir}/gem_init") => [ "#{build_dir}/gem_init.c", File.join(dir, "mrbgem.rake") ]
168
186
  file "#{build_dir}/gem_init.c" => [build.mrbcfile, __FILE__] + [rbfiles].flatten do |t|
169
187
  mkdir_p build_dir
170
188
  generate_gem_init("#{build_dir}/gem_init.c")
@@ -172,22 +190,37 @@ def define_gem_init_builder
172
190
  end
173
191
 
174
192
  def generate_gem_init(fname)
193
+ _pp "GEN", fname.relative_path
175
194
  open(fname, 'w') do |f|
176
195
  print_gem_init_header f
177
- build.mrbc.run f, rbfiles, "gem_mrblib_irep_#{funcname}" unless rbfiles.empty?
196
+ unless rbfiles.empty?
197
+ if cdump?
198
+ build.mrbc.run f, rbfiles, "gem_mrblib_#{funcname}_proc"
199
+ else
200
+ build.mrbc.run f, rbfiles, "gem_mrblib_irep_#{funcname}", false
201
+ end
202
+ end
178
203
  f.puts %Q[void mrb_#{funcname}_gem_init(mrb_state *mrb);]
179
204
  f.puts %Q[void mrb_#{funcname}_gem_final(mrb_state *mrb);]
180
205
  f.puts %Q[]
181
206
  f.puts %Q[void GENERATED_TMP_mrb_#{funcname}_gem_init(mrb_state *mrb) {]
182
207
  f.puts %Q[ int ai = mrb_gc_arena_save(mrb);]
208
+ f.puts %Q[ gem_mrblib_#{funcname}_proc_init_syms(mrb);] if !rbfiles.empty? && cdump?
183
209
  f.puts %Q[ mrb_#{funcname}_gem_init(mrb);] if objs != [objfile("#{build_dir}/gem_init")]
184
210
  unless rbfiles.empty?
185
- f.puts %Q[ mrb_load_irep(mrb, gem_mrblib_irep_#{funcname});]
211
+ if cdump?
212
+ f.puts %Q[ mrb_load_proc(mrb, gem_mrblib_#{funcname}_proc);]
213
+ else
214
+ f.puts %Q[ mrb_load_irep(mrb, gem_mrblib_irep_#{funcname});]
215
+ end
186
216
  f.puts %Q[ if (mrb->exc) {]
187
217
  f.puts %Q[ mrb_print_error(mrb);]
188
218
  f.puts %Q[ mrb_close(mrb);]
189
219
  f.puts %Q[ exit(EXIT_FAILURE);]
190
220
  f.puts %Q[ }]
221
+ f.puts %Q[ struct REnv *e = mrb_vm_ci_env(mrb->c->cibase);]
222
+ f.puts %Q[ mrb_vm_ci_env_set(mrb->c->cibase, NULL);]
223
+ f.puts %Q[ mrb_env_unshare(mrb, e);]
191
224
  end
192
225
  f.puts %Q[ mrb_gc_arena_restore(mrb, ai);]
193
226
  f.puts %Q[}]
@@ -211,9 +244,15 @@ def print_gem_comment(f)
211
244
 
212
245
  def print_gem_init_header(f)
213
246
  print_gem_comment(f)
214
- f.puts %Q[#include <stdlib.h>] unless rbfiles.empty?
215
- f.puts %Q[#include <mruby.h>]
216
- f.puts %Q[#include <mruby/irep.h>] unless rbfiles.empty?
247
+ if rbfiles.empty?
248
+ f.puts %Q[#include <mruby.h>]
249
+ else
250
+ f.puts %Q[#include <stdlib.h>]
251
+ unless build.presym_enabled?
252
+ f.puts %Q[#include <mruby.h>]
253
+ f.puts %Q[#include <mruby/proc.h>]
254
+ end
255
+ end
217
256
  end
218
257
 
219
258
  def print_gem_test_header(f)
@@ -226,12 +265,8 @@ def print_gem_test_header(f)
226
265
  f.puts %Q[#include <mruby/hash.h>] unless test_args.empty?
227
266
  end
228
267
 
229
- def test_dependencies
230
- [@name]
231
- end
232
-
233
268
  def custom_test_init?
234
- @custom_test_init
269
+ !test_objs.empty?
235
270
  end
236
271
 
237
272
  def version_ok?(req_versions)
@@ -323,6 +358,10 @@ def each(&b)
323
358
  @ary.each(&b)
324
359
  end
325
360
 
361
+ def [](name)
362
+ @ary.detect {|g| g.name == name}
363
+ end
364
+
326
365
  def <<(gem)
327
366
  unless @ary.detect {|g| g.dir == gem.dir }
328
367
  @ary << gem
@@ -456,6 +495,10 @@ def import_include_paths(g)
456
495
  end
457
496
  end
458
497
  end
498
+
499
+ def linker_attrs
500
+ map{|g| g.linker.run_attrs}.transpose
501
+ end
459
502
  end # List
460
503
  end # Gem
461
504