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
@@ -2,11 +2,11 @@
|
|
2
2
|
# Time ISO Test
|
3
3
|
|
4
4
|
assert('Time.new', '15.2.3.3.3') do
|
5
|
-
Time.new.class
|
5
|
+
assert_equal(Time, Time.new.class)
|
6
6
|
end
|
7
7
|
|
8
8
|
assert('Time', '15.2.19') do
|
9
|
-
Time.class
|
9
|
+
assert_equal(Class, Time.class)
|
10
10
|
end
|
11
11
|
|
12
12
|
assert('Time.at', '15.2.19.6.1') do
|
@@ -21,30 +21,58 @@
|
|
21
21
|
end
|
22
22
|
|
23
23
|
assert('Time.gm', '15.2.19.6.2') do
|
24
|
-
Time.gm(2012,
|
24
|
+
t = Time.gm(2012, 9, 23)
|
25
|
+
assert_operator(2012, :eql?, t.year)
|
26
|
+
assert_operator( 9, :eql?, t.month)
|
27
|
+
assert_operator( 23, :eql?, t.day)
|
28
|
+
assert_operator( 0, :eql?, t.hour)
|
29
|
+
assert_operator( 0, :eql?, t.min)
|
30
|
+
assert_operator( 0, :eql?, t.sec)
|
31
|
+
assert_operator( 0, :eql?, t.usec)
|
25
32
|
end
|
26
33
|
|
27
34
|
assert('Time.local', '15.2.19.6.3') do
|
28
|
-
Time.local(
|
35
|
+
t = Time.local(2014, 12, 27, 18)
|
36
|
+
assert_operator(2014, :eql?, t.year)
|
37
|
+
assert_operator( 12, :eql?, t.month)
|
38
|
+
assert_operator( 27, :eql?, t.day)
|
39
|
+
assert_operator( 18, :eql?, t.hour)
|
40
|
+
assert_operator( 0, :eql?, t.min)
|
41
|
+
assert_operator( 0, :eql?, t.sec)
|
42
|
+
assert_operator( 0, :eql?, t.usec)
|
29
43
|
end
|
30
44
|
|
31
45
|
assert('Time.mktime', '15.2.19.6.4') do
|
32
|
-
Time.mktime(
|
46
|
+
t = Time.mktime(2013, 10, 4, 6, 15, 58, 3485)
|
47
|
+
assert_operator(2013, :eql?, t.year)
|
48
|
+
assert_operator( 10, :eql?, t.month)
|
49
|
+
assert_operator( 4, :eql?, t.day)
|
50
|
+
assert_operator( 6, :eql?, t.hour)
|
51
|
+
assert_operator( 15, :eql?, t.min)
|
52
|
+
assert_operator( 58, :eql?, t.sec)
|
53
|
+
assert_operator(3485, :eql?, t.usec)
|
33
54
|
end
|
34
55
|
|
35
56
|
assert('Time.now', '15.2.19.6.5') do
|
36
|
-
Time.now.class
|
57
|
+
assert_equal(Time, Time.now.class)
|
37
58
|
end
|
38
59
|
|
39
60
|
assert('Time.utc', '15.2.19.6.6') do
|
40
|
-
Time.utc(
|
61
|
+
t = Time.utc(2034)
|
62
|
+
assert_operator(2034, :eql?, t.year)
|
63
|
+
assert_operator( 1, :eql?, t.month)
|
64
|
+
assert_operator( 1, :eql?, t.day)
|
65
|
+
assert_operator( 0, :eql?, t.hour)
|
66
|
+
assert_operator( 0, :eql?, t.min)
|
67
|
+
assert_operator( 0, :eql?, t.sec)
|
68
|
+
assert_operator( 0, :eql?, t.usec)
|
41
69
|
end
|
42
70
|
|
43
71
|
assert('Time#+', '15.2.19.7.1') do
|
44
72
|
t1 = Time.at(1300000000.0)
|
45
73
|
t2 = t1.+(60)
|
46
74
|
|
47
|
-
assert_equal(
|
75
|
+
assert_equal("Sun Mar 13 07:07:40 2011", t2.utc.asctime)
|
48
76
|
|
49
77
|
assert_raise(FloatDomainError) { Time.at(0) + Float::NAN }
|
50
78
|
assert_raise(FloatDomainError) { Time.at(0) + Float::INFINITY }
|
@@ -55,7 +83,7 @@
|
|
55
83
|
t1 = Time.at(1300000000.0)
|
56
84
|
t2 = t1.-(60)
|
57
85
|
|
58
|
-
assert_equal(
|
86
|
+
assert_equal("Sun Mar 13 07:05:40 2011", t2.utc.asctime)
|
59
87
|
|
60
88
|
assert_raise(FloatDomainError) { Time.at(0) - Float::NAN }
|
61
89
|
assert_raise(FloatDomainError) { Time.at(0) - Float::INFINITY }
|
@@ -67,30 +95,30 @@
|
|
67
95
|
t2 = Time.at(1400000000.0)
|
68
96
|
t3 = Time.at(1500000000.0)
|
69
97
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
98
|
+
assert_equal(1, t2 <=> t1)
|
99
|
+
assert_equal(0, t2 <=> t2)
|
100
|
+
assert_equal(-1, t2 <=> t3)
|
101
|
+
assert_nil(t2 <=> nil)
|
74
102
|
end
|
75
103
|
|
76
104
|
assert('Time#asctime', '15.2.19.7.4') do
|
77
|
-
|
105
|
+
assert_equal("Thu Mar 4 05:06:07 1982", Time.gm(1982,3,4,5,6,7).asctime)
|
78
106
|
end
|
79
107
|
|
80
108
|
assert('Time#ctime', '15.2.19.7.5') do
|
81
|
-
|
109
|
+
assert_equal("Thu Oct 24 15:26:47 2013", Time.gm(2013,10,24,15,26,47).ctime)
|
82
110
|
end
|
83
111
|
|
84
112
|
assert('Time#day', '15.2.19.7.6') do
|
85
|
-
Time.gm(2012, 12, 23).day
|
113
|
+
assert_equal(23, Time.gm(2012, 12, 23).day)
|
86
114
|
end
|
87
115
|
|
88
116
|
assert('Time#dst?', '15.2.19.7.7') do
|
89
|
-
|
117
|
+
assert_not_predicate(Time.gm(2012, 12, 23).utc, :dst?)
|
90
118
|
end
|
91
119
|
|
92
120
|
assert('Time#getgm', '15.2.19.7.8') do
|
93
|
-
|
121
|
+
assert_equal("Sun Mar 13 07:06:40 2011", Time.at(1300000000.0).getgm.asctime)
|
94
122
|
end
|
95
123
|
|
96
124
|
assert('Time#getlocal', '15.2.19.7.9') do
|
@@ -98,114 +126,121 @@
|
|
98
126
|
t2 = Time.at(1300000000.0)
|
99
127
|
t3 = t1.getlocal
|
100
128
|
|
101
|
-
t1
|
129
|
+
assert_equal(t1, t3)
|
130
|
+
assert_equal(t3, t2.getlocal)
|
102
131
|
end
|
103
132
|
|
104
133
|
assert('Time#getutc', '15.2.19.7.10') do
|
105
|
-
|
134
|
+
assert_equal("Sun Mar 13 07:06:40 2011", Time.at(1300000000.0).getutc.asctime)
|
106
135
|
end
|
107
136
|
|
108
137
|
assert('Time#gmt?', '15.2.19.7.11') do
|
109
|
-
Time.at(1300000000.0).utc
|
138
|
+
assert_predicate(Time.at(1300000000.0).utc, :gmt?)
|
110
139
|
end
|
111
140
|
|
112
141
|
# ATM not implemented
|
113
142
|
# assert('Time#gmt_offset', '15.2.19.7.12') do
|
114
143
|
|
115
144
|
assert('Time#gmtime', '15.2.19.7.13') do
|
116
|
-
Time.
|
145
|
+
t = Time.now
|
146
|
+
assert_predicate(t.gmtime, :gmt?)
|
147
|
+
assert_predicate(t, :gmt?)
|
117
148
|
end
|
118
149
|
|
119
150
|
# ATM not implemented
|
120
151
|
# assert('Time#gmtoff', '15.2.19.7.14') do
|
121
152
|
|
122
153
|
assert('Time#hour', '15.2.19.7.15') do
|
123
|
-
Time.gm(2012, 12, 23, 7, 6).hour
|
154
|
+
assert_equal(7, Time.gm(2012, 12, 23, 7, 6).hour)
|
124
155
|
end
|
125
156
|
|
126
157
|
# ATM doesn't really work
|
127
158
|
# assert('Time#initialize', '15.2.19.7.16') do
|
128
159
|
|
129
160
|
assert('Time#initialize_copy', '15.2.19.7.17') do
|
130
|
-
|
131
|
-
|
161
|
+
t = Time.at(7.0e6)
|
162
|
+
assert_equal(t, t.clone)
|
132
163
|
end
|
133
164
|
|
134
165
|
assert('Time#localtime', '15.2.19.7.18') do
|
135
|
-
t1 = Time.
|
136
|
-
t2 = Time.
|
166
|
+
t1 = Time.utc(2014, 5 ,6)
|
167
|
+
t2 = Time.utc(2014, 5 ,6)
|
168
|
+
t3 = t2.getlocal
|
137
169
|
|
138
|
-
t1.localtime
|
139
|
-
t1
|
170
|
+
assert_equal(t3, t1.localtime)
|
171
|
+
assert_equal(t3, t1)
|
140
172
|
end
|
141
173
|
|
142
174
|
assert('Time#mday', '15.2.19.7.19') do
|
143
|
-
Time.gm(2012, 12, 23).mday
|
175
|
+
assert_equal(23, Time.gm(2012, 12, 23).mday)
|
144
176
|
end
|
145
177
|
|
146
178
|
assert('Time#min', '15.2.19.7.20') do
|
147
|
-
Time.gm(2012, 12, 23, 7, 6).min
|
179
|
+
assert_equal(6, Time.gm(2012, 12, 23, 7, 6).min)
|
148
180
|
end
|
149
181
|
|
150
182
|
assert('Time#mon', '15.2.19.7.21') do
|
151
|
-
Time.gm(2012, 12, 23).mon
|
183
|
+
assert_equal(12, Time.gm(2012, 12, 23).mon)
|
152
184
|
end
|
153
185
|
|
154
186
|
assert('Time#month', '15.2.19.7.22') do
|
155
|
-
Time.gm(2012, 12, 23).month
|
187
|
+
assert_equal(12, Time.gm(2012, 12, 23).month)
|
156
188
|
end
|
157
189
|
|
158
190
|
assert('Times#sec', '15.2.19.7.23') do
|
159
|
-
Time.gm(2012, 12, 23, 7, 6, 40).sec
|
191
|
+
assert_equal(40, Time.gm(2012, 12, 23, 7, 6, 40).sec)
|
160
192
|
end
|
161
193
|
|
162
194
|
assert('Time#to_f', '15.2.19.7.24') do
|
163
|
-
Time.at(
|
195
|
+
assert_operator(2.0, :eql?, Time.at(2).to_f)
|
164
196
|
end
|
165
197
|
|
166
198
|
assert('Time#to_i', '15.2.19.7.25') do
|
167
|
-
Time.at(
|
199
|
+
assert_operator(2, :eql?, Time.at(2.0).to_i)
|
168
200
|
end
|
169
201
|
|
170
202
|
assert('Time#usec', '15.2.19.7.26') do
|
171
|
-
Time.at(1300000000.0).usec
|
203
|
+
assert_equal(0, Time.at(1300000000.0).usec)
|
172
204
|
end
|
173
205
|
|
174
206
|
assert('Time#utc', '15.2.19.7.27') do
|
175
|
-
Time.
|
207
|
+
t = Time.now
|
208
|
+
assert_predicate(t.utc, :gmt?)
|
209
|
+
assert_predicate(t, :gmt?)
|
176
210
|
end
|
177
211
|
|
178
212
|
assert('Time#utc?', '15.2.19.7.28') do
|
179
|
-
Time.at(1300000000.0).utc
|
213
|
+
assert_predicate(Time.at(1300000000.0).utc, :utc?)
|
180
214
|
end
|
181
215
|
|
182
216
|
# ATM not implemented
|
183
217
|
# assert('Time#utc_offset', '15.2.19.7.29') do
|
184
218
|
|
185
219
|
assert('Time#wday', '15.2.19.7.30') do
|
186
|
-
Time.gm(2012, 12, 23).wday
|
220
|
+
assert_equal(0, Time.gm(2012, 12, 23).wday)
|
187
221
|
end
|
188
222
|
|
189
223
|
assert('Time#yday', '15.2.19.7.31') do
|
190
|
-
Time.gm(2012, 12, 23).yday
|
224
|
+
assert_equal(358, Time.gm(2012, 12, 23).yday)
|
191
225
|
end
|
192
226
|
|
193
227
|
assert('Time#year', '15.2.19.7.32') do
|
194
|
-
Time.gm(2012, 12, 23).year
|
228
|
+
assert_equal(2012, Time.gm(2012, 12, 23).year)
|
195
229
|
end
|
196
230
|
|
197
231
|
assert('Time#zone', '15.2.19.7.33') do
|
198
|
-
Time.at(1300000000.0).utc.zone
|
232
|
+
assert_equal('UTC', Time.at(1300000000.0).utc.zone)
|
199
233
|
end
|
200
234
|
|
201
235
|
# Not ISO specified
|
202
236
|
|
203
237
|
assert('Time#to_s') do
|
204
|
-
|
238
|
+
assert_equal("2003-04-05 06:07:08 UTC", Time.gm(2003,4,5,6,7,8,9).to_s)
|
205
239
|
end
|
206
240
|
|
207
241
|
assert('Time#inspect') do
|
208
|
-
|
242
|
+
assert_match("2013-10-28 16:27:48 [+-][0-9][0-9][0-9][0-9]",
|
243
|
+
Time.local(2013,10,28,16,27,48).inspect)
|
209
244
|
end
|
210
245
|
|
211
246
|
assert('day of week methods') do
|
@@ -224,7 +259,7 @@
|
|
224
259
|
2000.times do
|
225
260
|
t += 0.0005
|
226
261
|
end
|
227
|
-
t.usec
|
262
|
+
assert_equal(0, t.usec)
|
228
263
|
end
|
229
264
|
|
230
265
|
assert('Time.gm with Dec 31 23:59:59 1969 raise ArgumentError') do
|
@@ -10,16 +10,16 @@ class Array
|
|
10
10
|
# and pass the respective element.
|
11
11
|
#
|
12
12
|
# ISO 15.2.12.5.10
|
13
|
-
def each(&block)
|
14
|
-
|
13
|
+
# def each(&block)
|
14
|
+
# return to_enum :each unless block
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
16
|
+
# idx = 0
|
17
|
+
# while idx < length
|
18
|
+
# block.call(self[idx])
|
19
|
+
# idx += 1
|
20
|
+
# end
|
21
|
+
# self
|
22
|
+
# end
|
23
23
|
|
24
24
|
##
|
25
25
|
# Calls the given block for each element of +self+
|
@@ -83,13 +83,15 @@ def initialize(size=0, obj=nil, &block)
|
|
83
83
|
self
|
84
84
|
end
|
85
85
|
|
86
|
-
def _inspect
|
86
|
+
def _inspect(recur_list)
|
87
87
|
size = self.size
|
88
88
|
return "[]" if size == 0
|
89
|
+
return "[...]" if recur_list[self.object_id]
|
90
|
+
recur_list[self.object_id] = true
|
89
91
|
ary=[]
|
90
92
|
i=0
|
91
93
|
while i<size
|
92
|
-
ary<<self[i].
|
94
|
+
ary<<self[i]._inspect(recur_list)
|
93
95
|
i+=1
|
94
96
|
end
|
95
97
|
"["+ary.join(", ")+"]"
|
@@ -99,11 +101,7 @@ def _inspect
|
|
99
101
|
#
|
100
102
|
# ISO 15.2.12.5.31 (x)
|
101
103
|
def inspect
|
102
|
-
|
103
|
-
self._inspect
|
104
|
-
rescue SystemStackError
|
105
|
-
"[...]"
|
106
|
-
end
|
104
|
+
self._inspect({})
|
107
105
|
end
|
108
106
|
# ISO 15.2.12.5.32 (x)
|
109
107
|
alias to_s inspect
|
@@ -65,22 +65,22 @@ def collect(&block)
|
|
65
65
|
end
|
66
66
|
|
67
67
|
##
|
68
|
-
#
|
69
|
-
#
|
70
|
-
# +ifnone+
|
71
|
-
#
|
72
|
-
#
|
68
|
+
# Return the first element for which
|
69
|
+
# value from the block is true. If no
|
70
|
+
# object matches, calls +ifnone+ and
|
71
|
+
# returns its result. Otherwise returns
|
72
|
+
# +nil+.
|
73
73
|
#
|
74
74
|
# ISO 15.3.2.2.4
|
75
75
|
def detect(ifnone=nil, &block)
|
76
|
-
|
76
|
+
return to_enum :detect, ifnone unless block
|
77
|
+
|
77
78
|
self.each{|*val|
|
78
79
|
if block.call(*val)
|
79
|
-
|
80
|
-
break
|
80
|
+
return val.__svalue
|
81
81
|
end
|
82
82
|
}
|
83
|
-
|
83
|
+
ifnone.call unless ifnone.nil?
|
84
84
|
end
|
85
85
|
|
86
86
|
##
|
@@ -284,6 +284,8 @@ def min(&block)
|
|
284
284
|
#
|
285
285
|
# ISO 15.3.2.2.16
|
286
286
|
def partition(&block)
|
287
|
+
return to_enum :partition unless block
|
288
|
+
|
287
289
|
ary_T = []
|
288
290
|
ary_F = []
|
289
291
|
self.each{|*val|
|
@@ -304,6 +306,8 @@ def partition(&block)
|
|
304
306
|
#
|
305
307
|
# ISO 15.3.2.2.17
|
306
308
|
def reject(&block)
|
309
|
+
return to_enum :reject unless block
|
310
|
+
|
307
311
|
ary = []
|
308
312
|
self.each{|*val|
|
309
313
|
ary.push(val.__svalue) unless block.call(*val)
|
@@ -186,15 +186,17 @@ def merge(other, &block)
|
|
186
186
|
end
|
187
187
|
|
188
188
|
# internal method for Hash inspection
|
189
|
-
def _inspect
|
189
|
+
def _inspect(recur_list)
|
190
190
|
return "{}" if self.size == 0
|
191
|
+
return "{...}" if recur_list[self.object_id]
|
192
|
+
recur_list[self.object_id] = true
|
191
193
|
ary=[]
|
192
194
|
keys=self.keys
|
193
195
|
size=keys.size
|
194
196
|
i=0
|
195
197
|
while i<size
|
196
198
|
k=keys[i]
|
197
|
-
ary<<(k._inspect + "=>" + self[k]._inspect)
|
199
|
+
ary<<(k._inspect(recur_list) + "=>" + self[k]._inspect(recur_list))
|
198
200
|
i+=1
|
199
201
|
end
|
200
202
|
"{"+ary.join(", ")+"}"
|
@@ -204,11 +206,7 @@ def _inspect
|
|
204
206
|
#
|
205
207
|
# ISO 15.2.13.4.30 (x)
|
206
208
|
def inspect
|
207
|
-
|
208
|
-
self._inspect
|
209
|
-
rescue SystemStackError
|
210
|
-
"{...}"
|
211
|
-
end
|
209
|
+
self._inspect({})
|
212
210
|
end
|
213
211
|
# ISO 15.2.13.4.31 (x)
|
214
212
|
alias to_s inspect
|
@@ -105,14 +105,14 @@ def step(num=nil, step=1, &block)
|
|
105
105
|
return to_enum(:step, num, step) unless block
|
106
106
|
|
107
107
|
i = __coerce_step_counter(num, step)
|
108
|
-
if num ==
|
108
|
+
if num == self || step.infinite?
|
109
|
+
block.call(i) if step > 0 && i <= (num||i) || step < 0 && i >= (num||-i)
|
110
|
+
elsif num == nil
|
109
111
|
while true
|
110
112
|
block.call(i)
|
111
113
|
i += step
|
112
114
|
end
|
113
|
-
|
114
|
-
end
|
115
|
-
if step > 0
|
115
|
+
elsif step > 0
|
116
116
|
while i <= num
|
117
117
|
block.call(i)
|
118
118
|
i += step
|