script_core 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +8 -6
- data/.ruby-version +1 -1
- data/Gemfile +2 -1
- data/bin/sandbox +1 -1
- data/ext/enterprise_script_service/Rakefile +1 -1
- data/ext/enterprise_script_service/flags.rb +5 -0
- data/ext/enterprise_script_service/libseccomp/CHANGELOG +15 -0
- data/ext/enterprise_script_service/libseccomp/CREDITS +3 -0
- data/ext/enterprise_script_service/libseccomp/Makefile.am +1 -1
- data/ext/enterprise_script_service/libseccomp/README.md +1 -1
- data/ext/enterprise_script_service/libseccomp/SECURITY.md +45 -0
- data/ext/enterprise_script_service/libseccomp/configure.ac +3 -3
- data/ext/enterprise_script_service/libseccomp/doc/admin/MAINTAINER_PROCESS.md +95 -0
- data/ext/enterprise_script_service/libseccomp/{RELEASE_PROCESS.md → doc/admin/RELEASE_PROCESS.md} +9 -1
- data/ext/enterprise_script_service/libseccomp/include/Makefile.am +1 -1
- data/ext/enterprise_script_service/libseccomp/include/seccomp-syscalls.h +2292 -0
- data/ext/enterprise_script_service/libseccomp/include/seccomp.h.in +3 -1065
- data/ext/enterprise_script_service/libseccomp/src/arch-aarch64-syscalls.c +35 -3
- data/ext/enterprise_script_service/libseccomp/src/arch-arm-syscalls.c +35 -3
- data/ext/enterprise_script_service/libseccomp/src/arch-mips-syscalls.c +43 -11
- data/ext/enterprise_script_service/libseccomp/src/arch-mips64-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/arch-mips64n32-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/arch-parisc-syscalls.c +34 -2
- data/ext/enterprise_script_service/libseccomp/src/arch-ppc-syscalls.c +43 -11
- data/ext/enterprise_script_service/libseccomp/src/arch-ppc64-syscalls.c +44 -12
- data/ext/enterprise_script_service/libseccomp/src/arch-s390-syscalls.c +46 -14
- data/ext/enterprise_script_service/libseccomp/src/arch-s390.c +142 -18
- data/ext/enterprise_script_service/libseccomp/src/arch-s390x-syscalls.c +47 -15
- data/ext/enterprise_script_service/libseccomp/src/arch-s390x.c +143 -17
- data/ext/enterprise_script_service/libseccomp/src/arch-x32-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/arch-x86-syscalls.c +94 -12
- data/ext/enterprise_script_service/libseccomp/src/arch-x86.c +142 -19
- data/ext/enterprise_script_service/libseccomp/src/arch-x86_64-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/db.c +1 -0
- data/ext/enterprise_script_service/libseccomp/src/gen_bpf.c +10 -3
- data/ext/enterprise_script_service/libseccomp/src/python/Makefile.am +4 -4
- data/ext/enterprise_script_service/libseccomp/src/python/seccomp.pyx +2 -0
- data/ext/enterprise_script_service/libseccomp/tests/.gitignore +1 -0
- data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.c +98 -0
- data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.py +61 -0
- data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.tests +18 -0
- data/ext/enterprise_script_service/libseccomp/tests/Makefile.am +6 -3
- data/ext/enterprise_script_service/libseccomp/tools/Makefile.am +0 -2
- data/ext/enterprise_script_service/libseccomp/tools/check-syntax +1 -0
- data/ext/enterprise_script_service/libseccomp/tools/scmp_bpf_sim.c +2 -0
- data/ext/enterprise_script_service/mruby-mpdecimal/src/ext.c +1 -1
- data/ext/enterprise_script_service/mruby/.gitignore +2 -2
- data/ext/enterprise_script_service/mruby/CONTRIBUTING.md +10 -3
- data/ext/enterprise_script_service/mruby/Doxyfile +2408 -0
- data/ext/enterprise_script_service/mruby/README.md +21 -8
- data/ext/enterprise_script_service/mruby/Rakefile +4 -13
- data/ext/enterprise_script_service/mruby/appveyor_config.rb +1 -1
- data/ext/enterprise_script_service/mruby/build_config.rb +3 -3
- data/ext/enterprise_script_service/mruby/doc/guides/compile.md +42 -42
- data/ext/enterprise_script_service/mruby/doc/guides/debugger.md +1 -1
- data/ext/enterprise_script_service/mruby/doc/guides/mrbconf.md +45 -6
- data/ext/enterprise_script_service/mruby/doc/guides/mrbgems.md +5 -0
- data/ext/enterprise_script_service/mruby/doc/limitations.md +88 -38
- data/ext/enterprise_script_service/mruby/doc/mruby_logo_red_icon.png +0 -0
- data/ext/enterprise_script_service/mruby/doc/opcode.md +94 -94
- data/ext/enterprise_script_service/mruby/include/mrbconf.h +74 -11
- data/ext/enterprise_script_service/mruby/include/mruby.h +242 -146
- data/ext/enterprise_script_service/mruby/include/mruby/array.h +7 -7
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_nan.h +2 -9
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_no.h +11 -10
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_word.h +104 -69
- data/ext/enterprise_script_service/mruby/include/mruby/class.h +7 -5
- data/ext/enterprise_script_service/mruby/include/mruby/common.h +9 -7
- data/ext/enterprise_script_service/mruby/include/mruby/compile.h +6 -6
- data/ext/enterprise_script_service/mruby/include/mruby/data.h +5 -5
- data/ext/enterprise_script_service/mruby/include/mruby/debug.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/dump.h +3 -7
- data/ext/enterprise_script_service/mruby/include/mruby/error.h +34 -6
- data/ext/enterprise_script_service/mruby/include/mruby/gc.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/hash.h +4 -11
- data/ext/enterprise_script_service/mruby/include/mruby/irep.h +16 -4
- data/ext/enterprise_script_service/mruby/include/mruby/istruct.h +4 -4
- data/ext/enterprise_script_service/mruby/include/mruby/khash.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/numeric.h +41 -7
- data/ext/enterprise_script_service/mruby/include/mruby/object.h +8 -9
- data/ext/enterprise_script_service/mruby/include/mruby/opcode.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/ops.h +6 -6
- data/ext/enterprise_script_service/mruby/include/mruby/proc.h +19 -13
- data/ext/enterprise_script_service/mruby/include/mruby/range.h +10 -4
- data/ext/enterprise_script_service/mruby/include/mruby/re.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/string.h +130 -107
- data/ext/enterprise_script_service/mruby/include/mruby/throw.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/value.h +137 -49
- data/ext/enterprise_script_service/mruby/include/mruby/variable.h +3 -5
- data/ext/enterprise_script_service/mruby/include/mruby/version.h +24 -10
- data/ext/enterprise_script_service/mruby/lib/mruby-core-ext.rb +2 -39
- data/ext/enterprise_script_service/mruby/lib/mruby/build.rb +32 -15
- data/ext/enterprise_script_service/mruby/lib/mruby/build/command.rb +63 -17
- data/ext/enterprise_script_service/mruby/lib/mruby/build/load_gems.rb +24 -10
- data/ext/enterprise_script_service/mruby/lib/mruby/gem.rb +11 -7
- data/ext/enterprise_script_service/mruby/lib/mruby/lockfile.rb +81 -0
- data/ext/enterprise_script_service/mruby/minirake +27 -11
- data/ext/enterprise_script_service/mruby/mrbgems/default.gembox +3 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrbgem.rake +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +47 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/src/array.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/test/array.rb +50 -29
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdprint.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.h +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +4 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +28 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +1 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/bintest/mruby.rb +75 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +134 -90
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-class-ext/src/class.c +7 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/codegen.c +69 -46
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/keywords +0 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/lex.def +51 -59
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/parse.y +430 -241
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrbgem.rake +10 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrblib/complex.rb +122 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/src/complex.c +249 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/test/complex.rb +153 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-chain/mrblib/chain.rb +19 -17
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-chain/test/enum_chain.rb +41 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +30 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-ext/test/enum.rb +8 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrbgem.rake +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrblib/enumerator.rb +46 -14
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/test/enumerator.rb +51 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-error/src/exception.c +10 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/src/eval.c +47 -44
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/test/eval.rb +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-exit/src/mruby-exit.c +9 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/src/fiber.c +16 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/test/fiber.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +0 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +3 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/test/hash.rb +3 -7
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/README.md +1 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrbgem.rake +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/file.rb +0 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/io.rb +24 -38
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/kernel.rb +16 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file.c +19 -18
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file_test.c +5 -16
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/io.c +54 -42
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file.rb +24 -20
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file_test.rb +4 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/io.rb +41 -35
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/mruby_io_test.c +9 -36
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/mrbgem.rake +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/src/kernel.c +9 -27
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/test/kernel.rb +2 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-math/src/math.c +5 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/src/metaprog.c +39 -24
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/test/metaprog.rb +48 -17
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/mrblib/method.rb +0 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/src/method.c +134 -101
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/test/method.rb +9 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb +1 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/src/numeric_ext.c +17 -37
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +0 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/mrbgem.rake +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/mrblib/object.rb +15 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/src/object.c +35 -6
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/test/nil.rb +4 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +1 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/src/pack.c +28 -23
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/test/pack.rb +43 -49
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-print/mrblib/print.rb +3 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/src/proc.c +6 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/test/proc.rb +21 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.c +157 -124
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/test/random.rb +72 -26
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/mrblib/range.rb +38 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/src/range.c +26 -11
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/test/range.rb +111 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrbgem.rake +5 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrblib/rational.rb +117 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/src/rational.c +209 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/test/rational.rb +308 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/README.md +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/src/socket.c +10 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/kernel.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/sprintf.c +22 -24
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrbgem.rake +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +8 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/src/string.c +116 -117
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/numeric.rb +29 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/range.rb +26 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/string.rb +32 -50
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/mrblib/struct.rb +5 -7
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/src/struct.c +43 -57
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/test/struct.rb +16 -11
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/driver.c +152 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/mrbgem.rake +4 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/vformat.c +200 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/include/mruby/time.h +2 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/src/time.c +199 -68
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/test/time.rb +81 -46
- data/ext/enterprise_script_service/mruby/mrblib/array.rb +14 -16
- data/ext/enterprise_script_service/mruby/mrblib/enum.rb +13 -9
- data/ext/enterprise_script_service/mruby/mrblib/hash.rb +5 -7
- data/ext/enterprise_script_service/mruby/mrblib/kernel.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrblib/numeric.rb +4 -4
- data/ext/enterprise_script_service/mruby/mrblib/range.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrblib/string.rb +55 -112
- data/ext/enterprise_script_service/mruby/mruby-source.gemspec +1 -1
- data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby.dict +105 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby_fuzzer.options +5 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby_proto_fuzzer.options +4 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_fuzzer.c +18 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_proto_fuzzer.cpp +44 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.cpp +455 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.h +55 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/ruby.proto +201 -0
- data/ext/enterprise_script_service/mruby/src/array.c +95 -46
- data/ext/enterprise_script_service/mruby/src/backtrace.c +6 -8
- data/ext/enterprise_script_service/mruby/src/class.c +370 -278
- data/ext/enterprise_script_service/mruby/src/codedump.c +34 -34
- data/ext/enterprise_script_service/mruby/src/debug.c +2 -2
- data/ext/enterprise_script_service/mruby/src/dump.c +8 -6
- data/ext/enterprise_script_service/mruby/src/enum.c +1 -1
- data/ext/enterprise_script_service/mruby/src/error.c +157 -55
- data/ext/enterprise_script_service/mruby/src/etc.c +13 -46
- data/ext/enterprise_script_service/mruby/src/fmt_fp.c +2 -2
- data/ext/enterprise_script_service/mruby/src/gc.c +30 -11
- data/ext/enterprise_script_service/mruby/src/hash.c +23 -14
- data/ext/enterprise_script_service/mruby/src/kernel.c +16 -54
- data/ext/enterprise_script_service/mruby/src/load.c +40 -76
- data/ext/enterprise_script_service/mruby/src/numeric.c +164 -94
- data/ext/enterprise_script_service/mruby/src/object.c +16 -39
- data/ext/enterprise_script_service/mruby/src/pool.c +0 -2
- data/ext/enterprise_script_service/mruby/src/proc.c +47 -48
- data/ext/enterprise_script_service/mruby/src/range.c +22 -35
- data/ext/enterprise_script_service/mruby/src/state.c +5 -94
- data/ext/enterprise_script_service/mruby/src/string.c +874 -710
- data/ext/enterprise_script_service/mruby/src/symbol.c +73 -48
- data/ext/enterprise_script_service/mruby/src/variable.c +58 -38
- data/ext/enterprise_script_service/mruby/src/vm.c +133 -304
- data/ext/enterprise_script_service/mruby/tasks/doc.rake +48 -0
- data/ext/enterprise_script_service/mruby/tasks/toolchains/clang.rake +3 -4
- data/ext/enterprise_script_service/mruby/tasks/toolchains/gcc.rake +20 -19
- data/ext/enterprise_script_service/mruby/tasks/toolchains/visualcpp.rake +0 -12
- data/ext/enterprise_script_service/mruby/test/assert.rb +186 -25
- data/ext/enterprise_script_service/mruby/test/t/array.rb +34 -6
- data/ext/enterprise_script_service/mruby/test/t/class.rb +26 -0
- data/ext/enterprise_script_service/mruby/test/t/enumerable.rb +2 -2
- data/ext/enterprise_script_service/mruby/test/t/float.rb +17 -17
- data/ext/enterprise_script_service/mruby/test/t/hash.rb +2 -0
- data/ext/enterprise_script_service/mruby/test/t/integer.rb +14 -6
- data/ext/enterprise_script_service/mruby/test/t/kernel.rb +38 -19
- data/ext/enterprise_script_service/mruby/test/t/module.rb +87 -14
- data/ext/enterprise_script_service/mruby/test/t/numeric.rb +65 -23
- data/ext/enterprise_script_service/mruby/test/t/range.rb +4 -4
- data/ext/enterprise_script_service/mruby/test/t/string.rb +211 -49
- data/ext/enterprise_script_service/mruby/test/t/syntax.rb +19 -2
- data/ext/enterprise_script_service/mruby/test/t/vformat.rb +92 -0
- data/ext/enterprise_script_service/mruby/travis_config.rb +2 -2
- data/ext/enterprise_script_service/mruby_config.rb +10 -0
- data/ext/enterprise_script_service/mruby_engine.cpp +2 -2
- data/ext/enterprise_script_service/mruby_engine.gembox +1 -0
- data/ext/enterprise_script_service/msgpack/CHANGELOG.md +14 -0
- data/ext/enterprise_script_service/msgpack/Files.cmake +4 -0
- data/ext/enterprise_script_service/msgpack/README.md +1 -1
- data/ext/enterprise_script_service/msgpack/appveyor.yml +1 -1
- data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_msgpack_tuple.hpp.erb +1 -1
- data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_msgpack_tuple_decl.hpp.erb +1 -1
- data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_zone.hpp.erb +3 -3
- data/ext/enterprise_script_service/msgpack/example/boost/asio_send_recv.cpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/adaptor/cpp11/timespec.hpp +16 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/adaptor/wstring.hpp +15 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/object.h +2 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/pack_template.h +17 -9
- data/ext/enterprise_script_service/msgpack/include/msgpack/sysdep.h +27 -16
- data/ext/enterprise_script_service/msgpack/include/msgpack/type.hpp +2 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/unpack_template.h +5 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/array_ref.hpp +0 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/check_container_size.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp11/chrono.hpp +5 -5
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp11/timespec.hpp +140 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple.hpp +32 -32
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple_decl.hpp +32 -32
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple.hpp +6 -6
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple_decl.hpp +10 -10
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/ext.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/fixint.hpp +5 -4
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/int.hpp +40 -13
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/int_decl.hpp +3 -2
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/wstring.hpp +121 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/detail/cpp03_zone.hpp +3 -3
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/detail/cpp11_zone.hpp +3 -3
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/object.hpp +6 -6
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/object_fwd.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/pack.hpp +40 -5
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/unpack.hpp +11 -11
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/vrefbuffer.hpp +7 -7
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/zbuffer.hpp +5 -5
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/adaptor/int_decl.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/create_object_visitor.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/parse.hpp +13 -13
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/x3_parse.hpp +28 -26
- data/ext/enterprise_script_service/msgpack/include/msgpack/v3/adaptor/int_decl.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v3/parse.hpp +13 -13
- data/ext/enterprise_script_service/msgpack/include/msgpack/version_master.h +2 -2
- data/ext/enterprise_script_service/msgpack/include/msgpack/zbuffer.h +6 -6
- data/ext/enterprise_script_service/msgpack/include/msgpack/zone.h +1 -1
- data/ext/enterprise_script_service/msgpack/src/objectc.c +83 -148
- data/ext/enterprise_script_service/msgpack/src/unpack.c +73 -47
- data/ext/enterprise_script_service/msgpack/test/CMakeLists.txt +1 -1
- data/ext/enterprise_script_service/msgpack/test/array_ref.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/boost_fusion.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/boost_optional.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/boost_string_ref.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/boost_string_view.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/boost_variant.cpp +15 -9
- data/ext/enterprise_script_service/msgpack/test/buffer.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/carray.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/cases.cpp +7 -1
- data/ext/enterprise_script_service/msgpack/test/convert.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/fixint.cpp +7 -1
- data/ext/enterprise_script_service/msgpack/test/fixint_c.cpp +6 -1
- data/ext/enterprise_script_service/msgpack/test/fuzz_unpack_pack_fuzzer_cpp11.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/iterator_cpp11.cpp +8 -2
- data/ext/enterprise_script_service/msgpack/test/json.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/limit.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_basic.cpp +128 -6
- data/ext/enterprise_script_service/msgpack/test/msgpack_c.cpp +7 -2
- data/ext/enterprise_script_service/msgpack/test/msgpack_container.cpp +20 -3
- data/ext/enterprise_script_service/msgpack/test/msgpack_cpp11.cpp +159 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_cpp17.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_stream.cpp +8 -3
- data/ext/enterprise_script_service/msgpack/test/msgpack_tuple.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_vref.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_x3_parse.cpp +23 -18
- data/ext/enterprise_script_service/msgpack/test/object.cpp +77 -45
- data/ext/enterprise_script_service/msgpack/test/object_with_zone.cpp +28 -10
- data/ext/enterprise_script_service/msgpack/test/pack_unpack.cpp +25 -18
- data/ext/enterprise_script_service/msgpack/test/pack_unpack_c.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/raw.cpp +17 -12
- data/ext/enterprise_script_service/msgpack/test/reference.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/reference_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/reference_wrapper_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/shared_ptr_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/size_equal_only.cpp +6 -2
- data/ext/enterprise_script_service/msgpack/test/streaming.cpp +10 -3
- data/ext/enterprise_script_service/msgpack/test/streaming_c.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/unique_ptr_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/user_class.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/version.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/visitor.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/zone.cpp +6 -0
- data/lib/script_core/version.rb +1 -1
- data/lib/tasks/mruby/engine.gembox.example +1 -0
- data/lib/tasks/script_core.rake +21 -3
- data/spec/dummy/app/helpers/fields_helper.rb +2 -2
- data/spec/dummy/mruby/engine.gembox +1 -0
- data/spec/script_core_spec.rb +1 -1
- metadata +38 -22
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/.gitignore +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/.travis.yml +0 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/run_test.rb +0 -26
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/mrblib/kernel.rb +0 -15
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/mrblib/unbound_method.rb +0 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/.gitignore +0 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/.travis.yml +0 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/packtest.rb +0 -157
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/run_test.rb +0 -26
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/mt19937ar.c +0 -224
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/mt19937ar.h +0 -80
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.h +0 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.gitignore +0 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.travis.yml +0 -29
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.travis_build_config.rb +0 -6
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/Rakefile +0 -29
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/.travis.yml +0 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/run_test.rb +0 -28
@@ -1,9 +1,7 @@
|
|
1
1
|
##
|
2
2
|
# FileTest
|
3
3
|
|
4
|
-
|
5
|
-
MRubyIOTestUtil.io_test_setup
|
6
|
-
end
|
4
|
+
MRubyIOTestUtil.io_test_setup
|
7
5
|
|
8
6
|
assert("FileTest.directory?") do
|
9
7
|
dir = MRubyIOTestUtil.mkdtemp("mruby-io-test.XXXXXX")
|
@@ -22,9 +20,8 @@
|
|
22
20
|
assert_equal true, FileTest.exist?(io), "io obj - exist"
|
23
21
|
io.close
|
24
22
|
assert_equal true, io.closed?
|
25
|
-
assert_raise
|
26
|
-
|
27
|
-
end
|
23
|
+
assert_raise(IOError) { FileTest.exist?(io) }
|
24
|
+
assert_raise(TypeError) { File.exist?($mrbtest_io_rfname.to_sym) }
|
28
25
|
end
|
29
26
|
|
30
27
|
assert("FileTest.file?") do
|
@@ -112,6 +109,4 @@
|
|
112
109
|
assert_true fp2.closed?
|
113
110
|
end
|
114
111
|
|
115
|
-
|
116
|
-
assert_nil MRubyIOTestUtil.io_test_cleanup
|
117
|
-
end
|
112
|
+
MRubyIOTestUtil.io_test_cleanup
|
@@ -1,35 +1,46 @@
|
|
1
1
|
##
|
2
2
|
# IO Test
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
MRubyIOTestUtil.io_test_setup
|
5
|
+
$cr, $crlf, $cmd = MRubyIOTestUtil.win? ? [1, "\r\n", "cmd /c "] : [0, "\n", ""]
|
6
|
+
|
7
|
+
def assert_io_open(meth)
|
8
|
+
assert "assert_io_open" do
|
9
|
+
fd = IO.sysopen($mrbtest_io_rfname)
|
10
|
+
assert_equal Fixnum, fd.class
|
11
|
+
io1 = IO.__send__(meth, fd)
|
12
|
+
begin
|
13
|
+
assert_equal IO, io1.class
|
14
|
+
assert_equal $mrbtest_io_msg, io1.read
|
15
|
+
ensure
|
16
|
+
io1.close
|
17
|
+
end
|
18
|
+
|
19
|
+
io2 = IO.__send__(meth, IO.sysopen($mrbtest_io_rfname))do |io|
|
20
|
+
if meth == :open
|
21
|
+
assert_equal $mrbtest_io_msg, io.read
|
22
|
+
else
|
23
|
+
flunk "IO.#{meth} does not take block"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
io2.close unless meth == :open
|
27
|
+
end
|
7
28
|
end
|
8
29
|
|
9
|
-
assert('IO', '15.2.20') do
|
30
|
+
assert('IO.class', '15.2.20') do
|
10
31
|
assert_equal(Class, IO.class)
|
11
32
|
end
|
12
33
|
|
13
|
-
assert('IO', '15.2.20.2') do
|
34
|
+
assert('IO.superclass', '15.2.20.2') do
|
14
35
|
assert_equal(Object, IO.superclass)
|
15
36
|
end
|
16
37
|
|
17
|
-
assert('IO', '15.2.20.3') do
|
38
|
+
assert('IO.ancestors', '15.2.20.3') do
|
18
39
|
assert_include(IO.ancestors, Enumerable)
|
19
40
|
end
|
20
41
|
|
21
42
|
assert('IO.open', '15.2.20.4.1') do
|
22
|
-
|
23
|
-
assert_equal Fixnum, fd.class
|
24
|
-
io = IO.open fd
|
25
|
-
assert_equal IO, io.class
|
26
|
-
assert_equal $mrbtest_io_msg, io.read
|
27
|
-
io.close
|
28
|
-
|
29
|
-
fd = IO.sysopen $mrbtest_io_rfname
|
30
|
-
IO.open(fd) do |io|
|
31
|
-
assert_equal $mrbtest_io_msg, io.read
|
32
|
-
end
|
43
|
+
assert_io_open(:open)
|
33
44
|
end
|
34
45
|
|
35
46
|
assert('IO#close', '15.2.20.5.1') do
|
@@ -84,7 +95,7 @@
|
|
84
95
|
|
85
96
|
assert('IO#getc', '15.2.20.5.8') do
|
86
97
|
io = IO.new(IO.sysopen($mrbtest_io_rfname))
|
87
|
-
$mrbtest_io_msg.
|
98
|
+
$mrbtest_io_msg.split("").each { |ch|
|
88
99
|
assert_equal ch, io.getc
|
89
100
|
}
|
90
101
|
assert_equal nil, io.getc
|
@@ -118,16 +129,17 @@
|
|
118
129
|
|
119
130
|
assert "IO#read(n) with n > IO::BUF_SIZE" do
|
120
131
|
skip "pipe is not supported on this platform" if MRubyIOTestUtil.win?
|
121
|
-
r,w
|
122
|
-
|
123
|
-
|
124
|
-
|
132
|
+
IO.pipe do |r,w|
|
133
|
+
n = IO::BUF_SIZE+1
|
134
|
+
w.write 'a'*n
|
135
|
+
assert_equal 'a'*n, r.read(n)
|
136
|
+
end
|
125
137
|
end
|
126
138
|
|
127
139
|
assert('IO#readchar', '15.2.20.5.15') do
|
128
140
|
# almost same as IO#getc
|
129
141
|
IO.open(IO.sysopen($mrbtest_io_rfname)) do |io|
|
130
|
-
$mrbtest_io_msg.
|
142
|
+
$mrbtest_io_msg.split("").each { |ch|
|
131
143
|
assert_equal ch, io.readchar
|
132
144
|
}
|
133
145
|
assert_raise(EOFError) do
|
@@ -215,19 +227,15 @@
|
|
215
227
|
end
|
216
228
|
|
217
229
|
assert('IO.for_fd') do
|
218
|
-
|
219
|
-
io = IO.for_fd(fd)
|
220
|
-
assert_equal $mrbtest_io_msg, io.read
|
221
|
-
io.close
|
230
|
+
assert_io_open(:for_fd)
|
222
231
|
end
|
223
232
|
|
224
233
|
assert('IO.new') do
|
225
|
-
|
226
|
-
io.close
|
234
|
+
assert_io_open(:new)
|
227
235
|
end
|
228
236
|
|
229
237
|
assert('IO gc check') do
|
230
|
-
100.times { IO.new(0) }
|
238
|
+
assert_nothing_raised { 100.times { IO.new(0) } }
|
231
239
|
end
|
232
240
|
|
233
241
|
assert('IO.sysopen("./nonexistent")') do
|
@@ -419,7 +427,7 @@ def io._buf
|
|
419
427
|
assert('IO.popen') do
|
420
428
|
begin
|
421
429
|
$? = nil
|
422
|
-
io = IO.popen("echo mruby-io")
|
430
|
+
io = IO.popen("#{$cmd}echo mruby-io")
|
423
431
|
assert_true io.close_on_exec?
|
424
432
|
assert_equal Fixnum, io.pid.class
|
425
433
|
|
@@ -598,12 +606,10 @@ def io._buf
|
|
598
606
|
|
599
607
|
assert('`cmd`') do
|
600
608
|
begin
|
601
|
-
assert_equal
|
609
|
+
assert_equal `#{$cmd}echo foo`, "foo#{$crlf}"
|
602
610
|
rescue NotImplementedError => e
|
603
611
|
skip e.message
|
604
612
|
end
|
605
613
|
end
|
606
614
|
|
607
|
-
|
608
|
-
assert_nil MRubyIOTestUtil.io_test_cleanup
|
609
|
-
end
|
615
|
+
MRubyIOTestUtil.io_test_cleanup
|
@@ -136,9 +136,9 @@ mrb_io_test_io_setup(mrb_state *mrb, mrb_value self)
|
|
136
136
|
sun0.sun_family = AF_UNIX;
|
137
137
|
snprintf(sun0.sun_path, sizeof(sun0.sun_path), "%s", socketname);
|
138
138
|
if (bind(fd3, (struct sockaddr *)&sun0, sizeof(sun0)) == -1) {
|
139
|
-
mrb_raisef(mrb, E_RUNTIME_ERROR, "can't bind AF_UNIX socket to %
|
140
|
-
|
141
|
-
|
139
|
+
mrb_raisef(mrb, E_RUNTIME_ERROR, "can't bind AF_UNIX socket to %s: %d",
|
140
|
+
sun0.sun_path,
|
141
|
+
errno);
|
142
142
|
}
|
143
143
|
close(fd3);
|
144
144
|
#endif
|
@@ -154,16 +154,16 @@ mrb_io_test_io_cleanup(mrb_state *mrb, mrb_value self)
|
|
154
154
|
mrb_value symlinkname = mrb_gv_get(mrb, mrb_intern_cstr(mrb, "$mrbtest_io_symlinkname"));
|
155
155
|
mrb_value socketname = mrb_gv_get(mrb, mrb_intern_cstr(mrb, "$mrbtest_io_socketname"));
|
156
156
|
|
157
|
-
if (
|
157
|
+
if (mrb_string_p(rfname)) {
|
158
158
|
remove(RSTRING_PTR(rfname));
|
159
159
|
}
|
160
|
-
if (
|
160
|
+
if (mrb_string_p(wfname)) {
|
161
161
|
remove(RSTRING_PTR(wfname));
|
162
162
|
}
|
163
|
-
if (
|
163
|
+
if (mrb_string_p(symlinkname)) {
|
164
164
|
remove(RSTRING_PTR(symlinkname));
|
165
165
|
}
|
166
|
-
if (
|
166
|
+
if (mrb_string_p(socketname)) {
|
167
167
|
remove(RSTRING_PTR(socketname));
|
168
168
|
}
|
169
169
|
|
@@ -176,28 +176,6 @@ mrb_io_test_io_cleanup(mrb_state *mrb, mrb_value self)
|
|
176
176
|
return mrb_nil_value();
|
177
177
|
}
|
178
178
|
|
179
|
-
static mrb_value
|
180
|
-
mrb_io_test_file_setup(mrb_state *mrb, mrb_value self)
|
181
|
-
{
|
182
|
-
mrb_value ary = mrb_io_test_io_setup(mrb, self);
|
183
|
-
#if !defined(_WIN32) && !defined(_WIN64)
|
184
|
-
if (symlink("/usr/bin", "test-bin") == -1) {
|
185
|
-
mrb_raise(mrb, E_RUNTIME_ERROR, "can't make a symbolic link");
|
186
|
-
}
|
187
|
-
#endif
|
188
|
-
|
189
|
-
return ary;
|
190
|
-
}
|
191
|
-
|
192
|
-
static mrb_value
|
193
|
-
mrb_io_test_file_cleanup(mrb_state *mrb, mrb_value self)
|
194
|
-
{
|
195
|
-
mrb_io_test_io_cleanup(mrb, self);
|
196
|
-
remove("test-bin");
|
197
|
-
|
198
|
-
return mrb_nil_value();
|
199
|
-
}
|
200
|
-
|
201
179
|
static mrb_value
|
202
180
|
mrb_io_test_mkdtemp(mrb_state *mrb, mrb_value klass)
|
203
181
|
{
|
@@ -215,11 +193,9 @@ mrb_io_test_mkdtemp(mrb_state *mrb, mrb_value klass)
|
|
215
193
|
static mrb_value
|
216
194
|
mrb_io_test_rmdir(mrb_state *mrb, mrb_value klass)
|
217
195
|
{
|
218
|
-
|
219
|
-
char *cp;
|
196
|
+
const char *cp;
|
220
197
|
|
221
|
-
mrb_get_args(mrb, "
|
222
|
-
cp = mrb_str_to_cstr(mrb, str);
|
198
|
+
mrb_get_args(mrb, "z", &cp);
|
223
199
|
if (rmdir(cp) == -1) {
|
224
200
|
mrb_sys_fail(mrb, "rmdir");
|
225
201
|
}
|
@@ -247,9 +223,6 @@ mrb_mruby_io_gem_test(mrb_state* mrb)
|
|
247
223
|
mrb_define_class_method(mrb, io_test, "io_test_setup", mrb_io_test_io_setup, MRB_ARGS_NONE());
|
248
224
|
mrb_define_class_method(mrb, io_test, "io_test_cleanup", mrb_io_test_io_cleanup, MRB_ARGS_NONE());
|
249
225
|
|
250
|
-
mrb_define_class_method(mrb, io_test, "file_test_setup", mrb_io_test_file_setup, MRB_ARGS_NONE());
|
251
|
-
mrb_define_class_method(mrb, io_test, "file_test_cleanup", mrb_io_test_file_cleanup, MRB_ARGS_NONE());
|
252
|
-
|
253
226
|
mrb_define_class_method(mrb, io_test, "mkdtemp", mrb_io_test_mkdtemp, MRB_ARGS_REQ(1));
|
254
227
|
mrb_define_class_method(mrb, io_test, "rmdir", mrb_io_test_rmdir, MRB_ARGS_REQ(1));
|
255
228
|
mrb_define_class_method(mrb, io_test, "win?", mrb_io_win_p, MRB_ARGS_NONE());
|
@@ -20,9 +20,9 @@ mrb_f_caller(mrb_state *mrb, mrb_value self)
|
|
20
20
|
n = bt_len - lev;
|
21
21
|
break;
|
22
22
|
case 1:
|
23
|
-
if (
|
23
|
+
if (mrb_range_p(v)) {
|
24
24
|
mrb_int beg, len;
|
25
|
-
if (mrb_range_beg_len(mrb, v, &beg, &len, bt_len, TRUE) ==
|
25
|
+
if (mrb_range_beg_len(mrb, v, &beg, &len, bt_len, TRUE) == MRB_RANGE_OK) {
|
26
26
|
lev = beg;
|
27
27
|
n = len;
|
28
28
|
}
|
@@ -31,22 +31,21 @@ mrb_f_caller(mrb_state *mrb, mrb_value self)
|
|
31
31
|
}
|
32
32
|
}
|
33
33
|
else {
|
34
|
-
|
35
|
-
lev = mrb_fixnum(v);
|
34
|
+
lev = mrb_int(mrb, v);
|
36
35
|
if (lev < 0) {
|
37
|
-
mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative level (%
|
36
|
+
mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative level (%v)", v);
|
38
37
|
}
|
39
38
|
n = bt_len - lev;
|
40
39
|
}
|
41
40
|
break;
|
42
41
|
case 2:
|
43
|
-
lev =
|
44
|
-
n =
|
42
|
+
lev = mrb_int(mrb, v);
|
43
|
+
n = mrb_int(mrb, length);
|
45
44
|
if (lev < 0) {
|
46
|
-
mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative level (%
|
45
|
+
mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative level (%v)", v);
|
47
46
|
}
|
48
47
|
if (n < 0) {
|
49
|
-
mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative size (%
|
48
|
+
mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative size (%v)", length);
|
50
49
|
}
|
51
50
|
break;
|
52
51
|
default:
|
@@ -206,22 +205,6 @@ mrb_f_hash(mrb_state *mrb, mrb_value self)
|
|
206
205
|
return mrb_ensure_hash_type(mrb, arg);
|
207
206
|
}
|
208
207
|
|
209
|
-
/*
|
210
|
-
* call-seq:
|
211
|
-
* obj.itself -> an_object
|
212
|
-
*
|
213
|
-
* Returns <i>obj</i>.
|
214
|
-
*
|
215
|
-
* string = 'my string' #=> "my string"
|
216
|
-
* string.itself.object_id == string.object_id #=> true
|
217
|
-
*
|
218
|
-
*/
|
219
|
-
static mrb_value
|
220
|
-
mrb_f_itself(mrb_state *mrb, mrb_value self)
|
221
|
-
{
|
222
|
-
return self;
|
223
|
-
}
|
224
|
-
|
225
208
|
void
|
226
209
|
mrb_mruby_kernel_ext_gem_init(mrb_state *mrb)
|
227
210
|
{
|
@@ -230,14 +213,13 @@ mrb_mruby_kernel_ext_gem_init(mrb_state *mrb)
|
|
230
213
|
mrb_define_module_function(mrb, krn, "fail", mrb_f_raise, MRB_ARGS_OPT(2));
|
231
214
|
mrb_define_module_function(mrb, krn, "caller", mrb_f_caller, MRB_ARGS_OPT(2));
|
232
215
|
mrb_define_method(mrb, krn, "__method__", mrb_f_method, MRB_ARGS_NONE());
|
233
|
-
mrb_define_module_function(mrb, krn, "Integer", mrb_f_integer,
|
216
|
+
mrb_define_module_function(mrb, krn, "Integer", mrb_f_integer, MRB_ARGS_ARG(1,1));
|
234
217
|
#ifndef MRB_WITHOUT_FLOAT
|
235
218
|
mrb_define_module_function(mrb, krn, "Float", mrb_f_float, MRB_ARGS_REQ(1));
|
236
219
|
#endif
|
237
220
|
mrb_define_module_function(mrb, krn, "String", mrb_f_string, MRB_ARGS_REQ(1));
|
238
221
|
mrb_define_module_function(mrb, krn, "Array", mrb_f_array, MRB_ARGS_REQ(1));
|
239
222
|
mrb_define_module_function(mrb, krn, "Hash", mrb_f_hash, MRB_ARGS_REQ(1));
|
240
|
-
mrb_define_module_function(mrb, krn, "itself", mrb_f_itself, MRB_ARGS_NONE());
|
241
223
|
}
|
242
224
|
|
243
225
|
void
|
@@ -65,6 +65,8 @@ def baz(*args)
|
|
65
65
|
assert_equal(123.456, Float(123.456))
|
66
66
|
assert_equal(123.456, Float("123.456"))
|
67
67
|
assert_raise(TypeError) { Float(nil) }
|
68
|
+
assert_raise(ArgumentError) { Float("1.5a") }
|
69
|
+
assert_raise(ArgumentError) { Float("1.5\0") }
|
68
70
|
end
|
69
71
|
|
70
72
|
assert('Kernel#String') do
|
@@ -4,6 +4,10 @@
|
|
4
4
|
** See Copyright Notice in mruby.h
|
5
5
|
*/
|
6
6
|
|
7
|
+
#ifdef MRB_WITHOUT_FLOAT
|
8
|
+
# error Math conflicts 'MRB_WITHOUT_FLOAT' configuration in your 'build_config.rb'
|
9
|
+
#endif
|
10
|
+
|
7
11
|
#include <mruby.h>
|
8
12
|
#include <mruby/array.h>
|
9
13
|
|
@@ -14,8 +18,7 @@ domain_error(mrb_state *mrb, const char *func)
|
|
14
18
|
{
|
15
19
|
struct RClass *math = mrb_module_get(mrb, "Math");
|
16
20
|
struct RClass *domainerror = mrb_class_get_under(mrb, math, "DomainError");
|
17
|
-
|
18
|
-
mrb_raisef(mrb, domainerror, "Numerical argument is out of domain - %S", str);
|
21
|
+
mrb_raisef(mrb, domainerror, "Numerical argument is out of domain - %s", func);
|
19
22
|
}
|
20
23
|
|
21
24
|
/* math functions not provided by Microsoft Visual C++ 2012 or older */
|
@@ -117,6 +117,7 @@ mrb_obj_ivar_set(mrb_state *mrb, mrb_value self)
|
|
117
117
|
}
|
118
118
|
|
119
119
|
/* 15.3.1.2.7 */
|
120
|
+
/* 15.3.1.3.28 */
|
120
121
|
/*
|
121
122
|
* call-seq:
|
122
123
|
* local_variables -> array
|
@@ -149,7 +150,7 @@ mrb_local_variables(mrb_state *mrb, mrb_value self)
|
|
149
150
|
for (i = 0; i + 1 < irep->nlocals; ++i) {
|
150
151
|
if (irep->lv[i].name) {
|
151
152
|
mrb_sym sym = irep->lv[i].name;
|
152
|
-
const char *name =
|
153
|
+
const char *name = mrb_sym_name(mrb, sym);
|
153
154
|
switch (name[0]) {
|
154
155
|
case '*': case '&':
|
155
156
|
break;
|
@@ -186,7 +187,7 @@ method_entry_loop(mrb_state *mrb, struct RClass* klass, khash_t(st)* set)
|
|
186
187
|
}
|
187
188
|
}
|
188
189
|
|
189
|
-
mrb_value
|
190
|
+
static mrb_value
|
190
191
|
mrb_class_instance_method_list(mrb_state *mrb, mrb_bool recur, struct RClass* klass, int obj)
|
191
192
|
{
|
192
193
|
khint_t i;
|
@@ -388,10 +389,7 @@ mod_define_singleton_method(mrb_state *mrb, mrb_value self)
|
|
388
389
|
mrb_sym mid;
|
389
390
|
mrb_value blk = mrb_nil_value();
|
390
391
|
|
391
|
-
mrb_get_args(mrb, "n
|
392
|
-
if (mrb_nil_p(blk)) {
|
393
|
-
mrb_raise(mrb, E_ARGUMENT_ERROR, "no block given");
|
394
|
-
}
|
392
|
+
mrb_get_args(mrb, "n&!", &mid, &blk);
|
395
393
|
p = (struct RProc*)mrb_obj_alloc(mrb, MRB_TT_PROC, mrb->proc_class);
|
396
394
|
mrb_proc_copy(p, mrb_proc_ptr(blk));
|
397
395
|
p->flags |= MRB_PROC_STRICT;
|
@@ -411,9 +409,9 @@ static void
|
|
411
409
|
check_cv_name_sym(mrb_state *mrb, mrb_sym id)
|
412
410
|
{
|
413
411
|
mrb_int len;
|
414
|
-
const char *name =
|
412
|
+
const char *name = mrb_sym_name_len(mrb, id, &len);
|
415
413
|
if (!cv_name_p(mrb, name, len)) {
|
416
|
-
mrb_name_error(mrb, id, "'%
|
414
|
+
mrb_name_error(mrb, id, "'%n' is not allowed as a class variable name", id);
|
417
415
|
}
|
418
416
|
}
|
419
417
|
|
@@ -453,12 +451,10 @@ mrb_mod_remove_cvar(mrb_state *mrb, mrb_value mod)
|
|
453
451
|
if (!mrb_undef_p(val)) return val;
|
454
452
|
|
455
453
|
if (mrb_cv_defined(mrb, mod, id)) {
|
456
|
-
mrb_name_error(mrb, id, "cannot remove %
|
457
|
-
mrb_sym2str(mrb, id), mod);
|
454
|
+
mrb_name_error(mrb, id, "cannot remove %n for %v", id, mod);
|
458
455
|
}
|
459
456
|
|
460
|
-
mrb_name_error(mrb, id, "class variable %
|
461
|
-
mrb_sym2str(mrb, id), mod);
|
457
|
+
mrb_name_error(mrb, id, "class variable %n not defined for %v", id, mod);
|
462
458
|
|
463
459
|
/* not reached */
|
464
460
|
return mrb_nil_value();
|
@@ -565,8 +561,6 @@ mrb_mod_included_modules(mrb_state *mrb, mrb_value self)
|
|
565
561
|
return result;
|
566
562
|
}
|
567
563
|
|
568
|
-
mrb_value mrb_class_instance_method_list(mrb_state*, mrb_bool, struct RClass*, int);
|
569
|
-
|
570
564
|
/* 15.2.2.4.33 */
|
571
565
|
/*
|
572
566
|
* call-seq:
|
@@ -623,8 +617,7 @@ remove_method(mrb_state *mrb, mrb_value mod, mrb_sym mid)
|
|
623
617
|
}
|
624
618
|
}
|
625
619
|
|
626
|
-
mrb_name_error(mrb, mid, "method '%
|
627
|
-
mrb_sym2str(mrb, mid), mod);
|
620
|
+
mrb_name_error(mrb, mid, "method '%n' not defined in %v", mid, mod);
|
628
621
|
}
|
629
622
|
|
630
623
|
/* 15.2.2.4.41 */
|
@@ -643,6 +636,7 @@ mrb_mod_remove_method(mrb_state *mrb, mrb_value mod)
|
|
643
636
|
mrb_value *argv;
|
644
637
|
|
645
638
|
mrb_get_args(mrb, "*", &argv, &argc);
|
639
|
+
mrb_check_frozen(mrb, mrb_obj_ptr(mod));
|
646
640
|
while (argc--) {
|
647
641
|
remove_method(mrb, mod, mrb_obj_to_sym(mrb, *argv));
|
648
642
|
argv++;
|
@@ -657,8 +651,29 @@ mrb_mod_s_constants(mrb_state *mrb, mrb_value mod)
|
|
657
651
|
return mrb_nil_value(); /* not reached */
|
658
652
|
}
|
659
653
|
|
660
|
-
|
661
|
-
|
654
|
+
static mrb_value
|
655
|
+
mrb_mod_s_nesting(mrb_state *mrb, mrb_value mod)
|
656
|
+
{
|
657
|
+
struct RProc *proc;
|
658
|
+
mrb_value ary;
|
659
|
+
struct RClass *c = NULL;
|
660
|
+
|
661
|
+
ary = mrb_ary_new(mrb);
|
662
|
+
proc = mrb->c->ci[-1].proc; /* callee proc */
|
663
|
+
mrb_assert(!MRB_PROC_CFUNC_P(proc));
|
664
|
+
while (proc) {
|
665
|
+
if (MRB_PROC_SCOPE_P(proc)) {
|
666
|
+
struct RClass *c2 = MRB_PROC_TARGET_CLASS(proc);
|
667
|
+
|
668
|
+
if (c2 != c) {
|
669
|
+
c = c2;
|
670
|
+
mrb_ary_push(mrb, ary, mrb_obj_value(c));
|
671
|
+
}
|
672
|
+
}
|
673
|
+
proc = proc->upper;
|
674
|
+
}
|
675
|
+
return ary;
|
676
|
+
}
|
662
677
|
|
663
678
|
void
|
664
679
|
mrb_mruby_metaprog_gem_init(mrb_state* mrb)
|
@@ -666,8 +681,8 @@ mrb_mruby_metaprog_gem_init(mrb_state* mrb)
|
|
666
681
|
struct RClass *krn = mrb->kernel_module;
|
667
682
|
struct RClass *mod = mrb->module_class;
|
668
683
|
|
669
|
-
mrb_define_method(mrb, krn, "global_variables", mrb_f_global_variables, MRB_ARGS_NONE()); /* 15.3.1.2.4 */
|
670
|
-
mrb_define_method(mrb, krn, "local_variables", mrb_local_variables, MRB_ARGS_NONE()); /* 15.3.1.3.28 */
|
684
|
+
mrb_define_method(mrb, krn, "global_variables", mrb_f_global_variables, MRB_ARGS_NONE()); /* 15.3.1.3.14 (15.3.1.2.4) */
|
685
|
+
mrb_define_method(mrb, krn, "local_variables", mrb_local_variables, MRB_ARGS_NONE()); /* 15.3.1.3.28 (15.3.1.2.7) */
|
671
686
|
|
672
687
|
mrb_define_method(mrb, krn, "singleton_class", mrb_singleton_class, MRB_ARGS_NONE());
|
673
688
|
mrb_define_method(mrb, krn, "instance_variable_defined?", mrb_obj_ivar_defined, MRB_ARGS_REQ(1)); /* 15.3.1.3.20 */
|
@@ -679,10 +694,10 @@ mrb_mruby_metaprog_gem_init(mrb_state* mrb)
|
|
679
694
|
mrb_define_method(mrb, krn, "protected_methods", mrb_obj_protected_methods, MRB_ARGS_OPT(1)); /* 15.3.1.3.37 */
|
680
695
|
mrb_define_method(mrb, krn, "public_methods", mrb_obj_public_methods, MRB_ARGS_OPT(1)); /* 15.3.1.3.38 */
|
681
696
|
mrb_define_method(mrb, krn, "singleton_methods", mrb_obj_singleton_methods_m, MRB_ARGS_OPT(1)); /* 15.3.1.3.45 */
|
682
|
-
mrb_define_method(mrb, krn, "define_singleton_method", mod_define_singleton_method,
|
683
|
-
mrb_define_method(mrb, krn, "send", mrb_f_send,
|
697
|
+
mrb_define_method(mrb, krn, "define_singleton_method", mod_define_singleton_method, MRB_ARGS_REQ(1)|MRB_ARGS_BLOCK());
|
698
|
+
mrb_define_method(mrb, krn, "send", mrb_f_send, MRB_ARGS_REQ(1)|MRB_ARGS_REST()|MRB_ARGS_BLOCK()); /* 15.3.1.3.44 */
|
684
699
|
|
685
|
-
mrb_define_method(mrb, mod, "class_variables", mrb_mod_class_variables,
|
700
|
+
mrb_define_method(mrb, mod, "class_variables", mrb_mod_class_variables, MRB_ARGS_OPT(1)); /* 15.2.2.4.19 */
|
686
701
|
mrb_define_method(mrb, mod, "remove_class_variable", mrb_mod_remove_cvar, MRB_ARGS_REQ(1)); /* 15.2.2.4.39 */
|
687
702
|
mrb_define_method(mrb, mod, "class_variable_defined?", mrb_mod_cvar_defined, MRB_ARGS_REQ(1)); /* 15.2.2.4.16 */
|
688
703
|
mrb_define_method(mrb, mod, "class_variable_get", mrb_mod_cvar_get, MRB_ARGS_REQ(1)); /* 15.2.2.4.17 */
|
@@ -693,7 +708,7 @@ mrb_mruby_metaprog_gem_init(mrb_state* mrb)
|
|
693
708
|
mrb_define_method(mrb, mod, "method_removed", mrb_f_nil, MRB_ARGS_REQ(1));
|
694
709
|
mrb_define_method(mrb, mod, "constants", mrb_mod_constants, MRB_ARGS_OPT(1)); /* 15.2.2.4.24 */
|
695
710
|
mrb_define_class_method(mrb, mod, "constants", mrb_mod_s_constants, MRB_ARGS_ANY()); /* 15.2.2.3.1 */
|
696
|
-
mrb_define_class_method(mrb, mod, "nesting", mrb_mod_s_nesting,
|
711
|
+
mrb_define_class_method(mrb, mod, "nesting", mrb_mod_s_nesting, MRB_ARGS_NONE()); /* 15.2.2.3.2 */
|
697
712
|
}
|
698
713
|
|
699
714
|
void
|