From dd28c6e8c41b67493558878c29a39898ff963690 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sun, 14 Apr 2019 12:18:10 +0900 Subject: [PATCH 001/250] Update the description about `mrb_load_string(); fix #65 --- docs/articles/executing-ruby-code-with-mruby.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/articles/executing-ruby-code-with-mruby.md b/docs/articles/executing-ruby-code-with-mruby.md index 25a61aa..abcb614 100644 --- a/docs/articles/executing-ruby-code-with-mruby.md +++ b/docs/articles/executing-ruby-code-with-mruby.md @@ -78,7 +78,8 @@ main(void) { mrb_state *mrb = mrb_open(); if (!mrb) { /* handle error */ } - // mrb_load_nstring() for strings without null terminator or with known length + // mrb_load_string(mrb, str) to load from NULL terminated strings + // mrb_load_nstring(mrb, str, len) for strings without null terminator or with known length mrb_load_string(mrb, "puts 'hello world'"); mrb_close(mrb); return 0; From acf86dffacd76a833e7e1ba0e8b581a84efda746 Mon Sep 17 00:00:00 2001 From: Hir0 Date: Tue, 16 Apr 2019 11:22:21 +0900 Subject: [PATCH 002/250] Update download button and link --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 3e0ec52..e694b1b 100644 --- a/index.html +++ b/index.html @@ -11,7 +11,7 @@

From 9856a147e97a2cc84005782c2886ab6ee1d50419 Mon Sep 17 00:00:00 2001 From: Hir0 Date: Tue, 16 Apr 2019 11:24:03 +0900 Subject: [PATCH 003/250] Update download link for 2.0.1 --- downloads/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/downloads/index.html b/downloads/index.html index 620c185..e8b7ee0 100644 --- a/downloads/index.html +++ b/downloads/index.html @@ -7,7 +7,7 @@

Downloads

- Current stable: mruby 2.0.0 + Current stable: mruby 2.0.1

From 11eb2059e8ece57299f4ef1c08d9e9ff57400eb1 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 16 May 2019 08:56:51 +0900 Subject: [PATCH 004/250] Update API docs to 2.0.1. --- Gemfile.lock | 359 +- docs/api/Addrinfo.html | 66 +- docs/api/ArgumentError.html | 6 +- docs/api/Array.html | 1871 ++++----- docs/api/BasicSocket.html | 454 ++- docs/api/Comparable.html | 6 +- docs/api/EOFError.html | 6 +- docs/api/Enumerable.html | 758 ++-- docs/api/Enumerator.html | 241 +- docs/api/Enumerator/Chain.html | 579 +++ docs/api/Enumerator/Generator.html | 20 +- docs/api/Enumerator/Lazy.html | 15 +- docs/api/Enumerator/Yielder.html | 24 +- docs/api/Exception.html | 6 +- docs/api/FalseClass.html | 6 +- docs/api/Fiber.html | 52 +- docs/api/File.html | 24 +- docs/api/File/Constants.html | 200 +- docs/api/File/FileError.html | 6 +- docs/api/File/NoFileError.html | 6 +- docs/api/File/PermissionError.html | 6 +- docs/api/File/UnableToStat.html | 6 +- docs/api/FileTest.html | 6 +- docs/api/Fixnum.html | 461 +-- docs/api/Float.html | 881 ++-- docs/api/FloatDomainError.html | 6 +- docs/api/FrozenError.html | 6 +- docs/api/GC.html | 6 +- docs/api/Hash.html | 2822 ++++--------- docs/api/IO.html | 424 +- docs/api/IOError.html | 6 +- docs/api/IPSocket.html | 38 +- docs/api/IndexError.html | 6 +- docs/api/Integer.html | 156 +- docs/api/Integral.html | 14 +- docs/api/Kernel.html | 1754 ++++---- docs/api/KeyError.html | 6 +- docs/api/LocalJumpError.html | 6 +- docs/api/Math.html | 246 +- docs/api/Method.html | 114 +- docs/api/Module.html | 435 +- docs/api/NameError.html | 6 +- docs/api/NilClass.html | 6 +- docs/api/NoMemoryError.html | 6 +- docs/api/NoMethodError.html | 6 +- docs/api/NotImplementedError.html | 6 +- docs/api/Numeric.html | 257 +- docs/api/Object.html | 6 +- docs/api/ObjectSpace.html | 6 +- docs/api/Proc.html | 116 +- docs/api/Random.html | 6 +- docs/api/Range.html | 18 +- docs/api/RangeError.html | 6 +- docs/api/RegexpError.html | 6 +- docs/api/ScriptError.html | 6 +- docs/api/Socket.html | 6 +- docs/api/Socket/Constants.html | 6 +- docs/api/Socket/Option.html | 6 +- docs/api/SocketError.html | 6 +- docs/api/StandardError.html | 6 +- docs/api/StopIteration.html | 6 +- docs/api/String.html | 3595 ++++++++++------- docs/api/Struct.html | 164 +- docs/api/Symbol.html | 361 +- docs/api/SystemStackError.html | 6 +- docs/api/TCPServer.html | 6 +- docs/api/TCPSocket.html | 6 +- docs/api/Time.html | 414 +- docs/api/TrueClass.html | 6 +- docs/api/TypeError.html | 6 +- docs/api/UDPSocket.html | 6 +- docs/api/UNIXServer.html | 6 +- docs/api/UNIXSocket.html | 6 +- docs/api/UnboundMethod.html | 6 +- docs/api/_index.html | 27 +- docs/api/class_list.html | 2 +- docs/api/css/style.css | 11 +- docs/api/file.AUTHORS.html | 16 +- docs/api/file.CONTRIBUTING.html | 6 +- .../api/{file.MITL.html => file.LICENSE.html} | 14 +- docs/api/file.README.html | 10 +- docs/api/file.compile.html | 6 +- docs/api/file.debugger.html | 8 +- docs/api/file.gc-arena-howto.html | 6 +- docs/api/file.mrbconf.html | 6 +- docs/api/file.mrbgems.html | 10 +- docs/api/file_list.html | 24 +- docs/api/frames.html | 2 +- docs/api/function_list.html | 320 +- docs/api/header_list.html | 11 +- docs/api/headers.html | 8 +- docs/api/headers/mrbconf.h.html | 11 +- docs/api/headers/mruby.h.html | 214 +- docs/api/headers/mruby_2Farray.h.html | 175 +- docs/api/headers/mruby_2Fboxing_nan.h.html | 6 +- docs/api/headers/mruby_2Fboxing_no.h.html | 6 +- docs/api/headers/mruby_2Fboxing_word.h.html | 6 +- docs/api/headers/mruby_2Fclass.h.html | 39 +- docs/api/headers/mruby_2Fcommon.h.html | 6 +- docs/api/headers/mruby_2Fcompile.h.html | 34 +- docs/api/headers/mruby_2Fdata.h.html | 6 +- docs/api/headers/mruby_2Fdebug.h.html | 22 +- docs/api/headers/mruby_2Fdump.h.html | 6 +- docs/api/headers/mruby_2Ferror.h.html | 10 +- docs/api/headers/mruby_2Fext_2Fio.h.html | 6 +- docs/api/headers/mruby_2Fgc.h.html | 6 +- docs/api/headers/mruby_2Fhash.h.html | 442 +- docs/api/headers/mruby_2Firep.h.html | 68 +- docs/api/headers/mruby_2Fistruct.h.html | 6 +- docs/api/headers/mruby_2Fkhash.h.html | 6 +- docs/api/headers/mruby_2Fnumeric.h.html | 6 +- docs/api/headers/mruby_2Fobject.h.html | 22 +- docs/api/headers/mruby_2Fopcode.h.html | 147 +- docs/api/headers/mruby_2Fproc.h.html | 46 +- docs/api/headers/mruby_2Frange.h.html | 61 +- docs/api/headers/mruby_2Fre.h.html | 6 +- docs/api/headers/mruby_2Fstring.h.html | 123 +- docs/api/headers/mruby_2Fthrow.h.html | 15 +- docs/api/headers/mruby_2Ftime.h.html | 133 + docs/api/headers/mruby_2Fvalue.h.html | 26 +- docs/api/headers/mruby_2Fvariable.h.html | 46 +- docs/api/headers/mruby_2Fversion.h.html | 6 +- docs/api/index.html | 10 +- docs/api/js/app.js | 55 + docs/api/method_list.html | 1260 +++--- docs/api/top-level-namespace.html | 145 +- 126 files changed, 11474 insertions(+), 9386 deletions(-) create mode 100644 docs/api/Enumerator/Chain.html rename docs/api/{file.MITL.html => file.LICENSE.html} (90%) create mode 100644 docs/api/headers/mruby_2Ftime.h.html diff --git a/Gemfile.lock b/Gemfile.lock index 4c0c197..1b61ba2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,207 +1,254 @@ GEM remote: https://rubygems.org/ specs: - activesupport (4.2.7) + activesupport (4.2.11.1) i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.5.0) - public_suffix (~> 2.0, >= 2.0.2) - coderay (1.1.1) + addressable (2.6.0) + public_suffix (>= 2.0.2, < 4.0) + coderay (1.1.2) coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.12.2) + coffee-script-source (1.11.1) colorator (1.1.0) - ethon (0.10.1) - ffi (>= 1.9.17) + commonmarker (0.17.13) + ruby-enum (~> 0.5) + concurrent-ruby (1.1.5) + dnsruby (1.61.2) + addressable (~> 2.5) + em-websocket (0.5.1) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) + ethon (0.12.0) + ffi (>= 1.3.0) + eventmachine (1.2.7) execjs (2.7.0) - faraday (0.11.0) + faraday (0.15.4) multipart-post (>= 1.2, < 3) - ffi (>= 1.9.17) + ffi (1.10.0) forwardable-extended (2.6.0) - gemoji (2.1.0) - git (1.3.0) - github-pages (117) - activesupport (= 4.2.7) - github-pages-health-check (= 1.3.0) - jekyll (=> 3.6.3) - jekyll-avatar (= 0.4.2) - jekyll-coffeescript (= 1.0.1) + gemoji (3.0.1) + git (1.5.0) + github-pages (198) + activesupport (= 4.2.11.1) + github-pages-health-check (= 1.16.1) + jekyll (= 3.8.5) + jekyll-avatar (= 0.6.0) + jekyll-coffeescript (= 1.1.1) + jekyll-commonmark-ghpages (= 0.1.5) jekyll-default-layout (= 0.1.4) - jekyll-feed (= 0.8.0) - jekyll-gist (= 1.4.0) - jekyll-github-metadata (= 2.3.1) - jekyll-mentions (= 1.2.0) - jekyll-optional-front-matter (= 0.1.2) + jekyll-feed (= 0.11.0) + jekyll-gist (= 1.5.0) + jekyll-github-metadata (= 2.12.1) + jekyll-mentions (= 1.4.1) + jekyll-optional-front-matter (= 0.3.0) jekyll-paginate (= 1.1.0) - jekyll-readme-index (= 0.0.3) - jekyll-redirect-from (= 0.11.0) - jekyll-relative-links (= 0.2.1) - jekyll-sass-converter (= 1.5.0) - jekyll-seo-tag (= 2.1.0) - jekyll-sitemap (= 0.12.0) + jekyll-readme-index (= 0.2.0) + jekyll-redirect-from (= 0.14.0) + jekyll-relative-links (= 0.6.0) + jekyll-remote-theme (= 0.3.1) + jekyll-sass-converter (= 1.5.2) + jekyll-seo-tag (= 2.5.0) + jekyll-sitemap (= 1.2.0) jekyll-swiss (= 0.4.0) - jekyll-theme-architect (= 0.0.3) - jekyll-theme-cayman (= 0.0.3) - jekyll-theme-dinky (= 0.0.3) - jekyll-theme-hacker (= 0.0.3) - jekyll-theme-leap-day (= 0.0.3) - jekyll-theme-merlot (= 0.0.3) - jekyll-theme-midnight (= 0.0.3) - jekyll-theme-minimal (= 0.0.3) - jekyll-theme-modernist (= 0.0.3) - jekyll-theme-primer (= 0.1.7) - jekyll-theme-slate (= 0.0.3) - jekyll-theme-tactile (= 0.0.3) - jekyll-theme-time-machine (= 0.0.3) - jekyll-titles-from-headings (= 0.1.4) - jemoji (= 0.7.0) - kramdown (= 1.11.1) - liquid (= 3.0.6) - listen (= 3.0.6) + jekyll-theme-architect (= 0.1.1) + jekyll-theme-cayman (= 0.1.1) + jekyll-theme-dinky (= 0.1.1) + jekyll-theme-hacker (= 0.1.1) + jekyll-theme-leap-day (= 0.1.1) + jekyll-theme-merlot (= 0.1.1) + jekyll-theme-midnight (= 0.1.1) + jekyll-theme-minimal (= 0.1.1) + jekyll-theme-modernist (= 0.1.1) + jekyll-theme-primer (= 0.5.3) + jekyll-theme-slate (= 0.1.1) + jekyll-theme-tactile (= 0.1.1) + jekyll-theme-time-machine (= 0.1.1) + jekyll-titles-from-headings (= 0.5.1) + jemoji (= 0.10.2) + kramdown (= 1.17.0) + liquid (= 4.0.0) + listen (= 3.1.5) mercenary (~> 0.3) - minima (= 2.0.0) - nokogiri (=> 1.8.2) - rouge (= 1.11.1) + minima (= 2.5.0) + nokogiri (>= 1.8.5, < 2.0) + rouge (= 2.2.1) terminal-table (~> 1.4) - github-pages-health-check (1.3.0) + github-pages-health-check (1.16.1) addressable (~> 2.3) - net-dns (~> 0.8) + dnsruby (~> 1.60) octokit (~> 4.0) - public_suffix (~> 2.0) - typhoeus (~> 0.7) - html-pipeline (2.5.0) + public_suffix (~> 3.0) + typhoeus (~> 1.3) + html-pipeline (2.11.0) activesupport (>= 2) - nokogiri (>= 1.8.2) - i18n (0.7.0) - jekyll (>= 3.6.3) + nokogiri (>= 1.4) + http_parser.rb (0.6.0) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jekyll (3.8.5) addressable (~> 2.4) colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 0.7) jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 1.1) - kramdown (~> 1.3) - liquid (~> 3.0) + jekyll-watch (~> 2.0) + kramdown (~> 1.14) + liquid (~> 4.0) mercenary (~> 0.3.3) pathutil (~> 0.9) - rouge (~> 1.7) + rouge (>= 1.7, < 4) safe_yaml (~> 1.0) - jekyll-avatar (0.4.2) - jekyll (>= 3.6.3) - jekyll-coffeescript (1.0.1) + jekyll-avatar (0.6.0) + jekyll (~> 3.0) + jekyll-coffeescript (1.1.1) coffee-script (~> 2.2) + coffee-script-source (~> 1.11.1) + jekyll-commonmark (1.3.1) + commonmarker (~> 0.14) + jekyll (>= 3.7, < 5.0) + jekyll-commonmark-ghpages (0.1.5) + commonmarker (~> 0.17.6) + jekyll-commonmark (~> 1) + rouge (~> 2) jekyll-default-layout (0.1.4) - jekyll (>= 3.6.3) - jekyll-feed (0.8.0) - jekyll (>= 3.6.3) - jekyll-gist (1.4.0) + jekyll (~> 3.0) + jekyll-feed (0.11.0) + jekyll (~> 3.3) + jekyll-gist (1.5.0) octokit (~> 4.2) - jekyll-github-metadata (2.3.1) - jekyll (>= 3.6.3) + jekyll-github-metadata (2.12.1) + jekyll (~> 3.4) octokit (~> 4.0, != 4.4.0) - jekyll-mentions (1.2.0) - activesupport (~> 4.0) + jekyll-mentions (1.4.1) html-pipeline (~> 2.3) - jekyll (>= 3.6.3) - jekyll-optional-front-matter (0.1.2) - jekyll (>= 3.6.3) + jekyll (~> 3.0) + jekyll-optional-front-matter (0.3.0) + jekyll (~> 3.0) jekyll-paginate (1.1.0) - jekyll-readme-index (0.0.3) - jekyll (>= 3.6.3) - jekyll-redirect-from (0.11.0) - jekyll (>= 3.6.3) - jekyll-relative-links (0.2.1) - jekyll (>= 3.6.3) - jekyll-sass-converter (1.5.0) + jekyll-readme-index (0.2.0) + jekyll (~> 3.0) + jekyll-redirect-from (0.14.0) + jekyll (~> 3.3) + jekyll-relative-links (0.6.0) + jekyll (~> 3.3) + jekyll-remote-theme (0.3.1) + jekyll (~> 3.5) + rubyzip (>= 1.2.1, < 3.0) + jekyll-sass-converter (1.5.2) sass (~> 3.4) - jekyll-seo-tag (2.1.0) - jekyll (>= 3.6.3) - jekyll-sitemap (0.12.0) - jekyll (>= 3.6.3) + jekyll-seo-tag (2.5.0) + jekyll (~> 3.3) + jekyll-sitemap (1.2.0) + jekyll (~> 3.3) jekyll-swiss (0.4.0) - jekyll-theme-architect (0.0.3) - jekyll (>= 3.6.3) - jekyll-theme-cayman (0.0.3) - jekyll (>= 3.6.3) - jekyll-theme-dinky (0.0.3) - jekyll (>= 3.6.3) - jekyll-theme-hacker (0.0.3) - jekyll (>= 3.6.3) - jekyll-theme-leap-day (0.0.3) - jekyll (>= 3.6.3) - jekyll-theme-merlot (0.0.3) - jekyll (>= 3.6.3) - jekyll-theme-midnight (0.0.3) - jekyll (>= 3.6.3) - jekyll-theme-minimal (0.0.3) - jekyll (>= 3.6.3) - jekyll-theme-modernist (0.0.3) - jekyll (>= 3.6.3) - jekyll-theme-primer (0.1.7) - jekyll (>= 3.6.3) - jekyll-theme-slate (0.0.3) - jekyll (>= 3.6.3) - jekyll-theme-tactile (0.0.3) - jekyll (>= 3.6.3) - jekyll-theme-time-machine (0.0.3) - jekyll (>= 3.6.3) - jekyll-titles-from-headings (0.1.4) - jekyll (>= 3.6.3) - jekyll-watch (1.5.0) - listen (~> 3.0, < 3.1) - jemoji (0.7.0) - activesupport (~> 4.0) - gemoji (~> 2.0) + jekyll-theme-architect (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-cayman (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-dinky (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-hacker (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-leap-day (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-merlot (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-midnight (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-minimal (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-modernist (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-primer (0.5.3) + jekyll (~> 3.5) + jekyll-github-metadata (~> 2.9) + jekyll-seo-tag (~> 2.0) + jekyll-theme-slate (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-tactile (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-time-machine (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-titles-from-headings (0.5.1) + jekyll (~> 3.3) + jekyll-watch (2.2.1) + listen (~> 3.0) + jemoji (0.10.2) + gemoji (~> 3.0) html-pipeline (~> 2.2) - jekyll (>= 3.6.3) - json (1.8.6) - kramdown (1.11.1) - liquid (3.0.6) - listen (3.0.6) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9.7) + jekyll (~> 3.0) + kramdown (1.17.0) + liquid (4.0.0) + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) mercenary (0.3.6) mgem (0.3.0) - mini_portile2 (2.1.0) - minima (2.0.0) - minitest (5.10.1) - multipart-post (2.0.0) - net-dns (0.8.0) - nokogiri (>= 1.8.2) - octokit (4.6.2) + mini_portile2 (2.4.0) + minima (2.5.0) + jekyll (~> 3.5) + jekyll-feed (~> 0.9) + jekyll-seo-tag (~> 2.1) + minitest (5.11.3) + multipart-post (2.1.1) + nokogiri (1.10.3) + mini_portile2 (~> 2.4.0) + octokit (4.14.0) sawyer (~> 0.8.0, >= 0.5.3) - pathutil (0.14.0) + pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (2.0.5) - rb-fsevent (0.9.8) - rb-inotify (0.9.8) - ffi (>= 1.9.17) - rouge (1.11.1) - safe_yaml (1.0.4) - sass (3.4.23) - sawyer (0.8.1) - addressable (>= 2.3.5, < 2.6) - faraday (~> 0.8, < 1.0) - terminal-table (1.7.3) - unicode-display_width (~> 1.1.1) - thread_safe (0.3.5) - typhoeus (0.8.0) - ethon (>= 0.8.0) - tzinfo (1.2.2) + public_suffix (3.0.3) + rb-fsevent (0.10.3) + rb-inotify (0.10.0) + ffi (~> 1.0) + rouge (2.2.1) + ruby-enum (0.7.2) + i18n + ruby_dep (1.5.0) + rubyzip (1.2.2) + safe_yaml (1.0.5) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sawyer (0.8.2) + addressable (>= 2.3.5) + faraday (> 0.8, < 2.0) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + thread_safe (0.3.6) + typhoeus (1.3.1) + ethon (>= 0.9.0) + tzinfo (1.2.5) thread_safe (~> 0.1) - unicode-display_width (1.1.3) - yard (~> 0.9.11) + unicode-display_width (1.6.0) + yard (0.9.19) yard-coderay (0.1.0) coderay yard yard-mruby (0.3.0) - yard (~> 0.9.11) + yard (~> 0.9.0) PLATFORMS ruby - x86-mingw32 DEPENDENCIES git @@ -211,4 +258,4 @@ DEPENDENCIES yard-mruby BUNDLED WITH - 1.13.7 + 2.0.1 diff --git a/docs/api/Addrinfo.html b/docs/api/Addrinfo.html index 95b21a9..febb93c 100644 --- a/docs/api/Addrinfo.html +++ b/docs/api/Addrinfo.html @@ -6,7 +6,7 @@ Class: Addrinfo - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -1192,16 +1192,6 @@

 
 
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
 190
 191
 192
@@ -1218,10 +1208,20 @@ 

203 204 205 -206

+206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 -
# File 'mrbgems/mruby-socket/src/socket.c', line 180
+      
# File 'mrbgems/mruby-socket/src/socket.c', line 190
 
 static mrb_value
 mrb_addrinfo_getnameinfo(mrb_state *mrb, mrb_value self)
@@ -1240,8 +1240,8 @@ 

mrb_raise(mrb, E_SOCKET_ERROR, "invalid sockaddr"); } error = getnameinfo((struct sockaddr *)RSTRING_PTR(sastr), (socklen_t)RSTRING_LEN(sastr), RSTRING_PTR(host), NI_MAXHOST, RSTRING_PTR(serv), NI_MAXSERV, (int)flags); - if (error != 0) { - mrb_raisef(mrb, E_SOCKET_ERROR, "getnameinfo: %s", gai_strerror(error)); + if (error) { + mrb_raisef(mrb, E_SOCKET_ERROR, "getnameinfo: %S", mrb_str_new_cstr(mrb, gai_strerror(error))); } ary = mrb_ary_new_capa(mrb, 2); mrb_str_resize(mrb, host, strlen(RSTRING_PTR(host))); @@ -1788,19 +1788,23 @@

 
 
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
+219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232

-
# File 'mrbgems/mruby-socket/src/socket.c', line 209
+      
# File 'mrbgems/mruby-socket/src/socket.c', line 219
 
 static mrb_value
 mrb_addrinfo_unix_path(mrb_state *mrb, mrb_value self)
@@ -1810,7 +1814,11 @@ 

sastr = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@sockaddr")); if (((struct sockaddr *)RSTRING_PTR(sastr))->sa_family != AF_UNIX) mrb_raise(mrb, E_SOCKET_ERROR, "need AF_UNIX address"); - return mrb_str_new_cstr(mrb, ((struct sockaddr_un *)RSTRING_PTR(sastr))->sun_path); + if (RSTRING_LEN(sastr) < (mrb_int)offsetof(struct sockaddr_un, sun_path) + 1) { + return mrb_str_new(mrb, "", 0); + } else { + return mrb_str_new_cstr(mrb, ((struct sockaddr_un *)RSTRING_PTR(sastr))->sun_path); + } }

@@ -1822,9 +1830,9 @@

diff --git a/docs/api/ArgumentError.html b/docs/api/ArgumentError.html index d9a6b89..8d14467 100644 --- a/docs/api/ArgumentError.html +++ b/docs/api/ArgumentError.html @@ -6,7 +6,7 @@ Exception: ArgumentError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -154,9 +154,9 @@

Constructor Details

diff --git a/docs/api/Array.html b/docs/api/Array.html index a7b9679..50cdb0d 100644 --- a/docs/api/Array.html +++ b/docs/api/Array.html @@ -6,7 +6,7 @@ Class: Array - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -123,54 +123,18 @@

Overview

-

Constant Summary

-
- -
NONE = - -
-
Object.new
- -
- - - - - +

Constant Summary

-

- Class Method Summary - collapse -

+

Constants included + from Enumerable

+

Enumerable::NONE

+ -

Instance Method Summary @@ -452,29 +416,6 @@

kept for mruby-array-ext.

- - - -
  • - - - #__sort_sub__(left, right, &block) ⇒ Object - - - - - - - - - - - - - -

    Quick sort left : the beginning of sort region right : the end of sort region.

    -
    -
  • @@ -998,7 +939,7 @@

  • - #fetch(n = nil, ifnone = NONE, &block) ⇒ Object + #fetch(n, ifnone = NONE, &block) ⇒ Object @@ -1846,7 +1787,7 @@

  • - #to_ary ⇒ Object + #to_h(&blk) ⇒ Object @@ -1860,7 +1801,15 @@

    -

    call-seq: ary.to_ary -> ary.

    +
    + + + + + + + +
    call-seq: ary.to_h -> Hash ary.to_h{item… } -> Hash.

  • @@ -1869,7 +1818,7 @@

  • - #to_h ⇒ Hash + #transpose ⇒ Object @@ -1883,7 +1832,7 @@

    -

    Returns the result of interpreting aray as an array of [key, value] paris.

    +

    call-seq: ary.transpose -> new_ary.

  • @@ -1892,7 +1841,7 @@

  • - #transpose ⇒ Object + #union(*args) ⇒ Object @@ -1906,7 +1855,7 @@

    -

    call-seq: ary.transpose -> new_ary.

    +

    call-seq: ary.union(other_ary,…) -> new_ary.

  • @@ -2063,7 +2012,7 @@

    Methods included from Enumerable

    -

    #all?, #any?, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #find_all, #find_index, #flat_map, #grep, #group_by, #hash, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #sort_by, #take, #take_while, to_h, #zip

    +

    __update_hash, #all?, #any?, #chain, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #find_all, #find_index, #flat_map, #grep, #group_by, #hash, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #sort_by, #take, #take_while, to_h, #zip

    Constructor Details

    @@ -2093,7 +2042,7 @@

  • - (TypeError) + (ArgumentError) @@ -2131,7 +2080,7 @@

    # File 'mrblib/array.rb', line 68
     
     def initialize(size=0, obj=nil, &block)
    -  raise TypeError, "expected Integer for 1st argument" unless size.kind_of? Integer
    +  size = size.__to_int
       raise ArgumentError, "negative array size" if size < 0
     
       self.clear
    @@ -2155,76 +2104,6 @@ 

  • -
    -

    Class Method Details

    - - -
    -

    - - .try_convert(obj) ⇒ Object - - - - - -

    -
    -

    call-seq: - Array.try_convert(obj) -> array or nil

    - -

    Tries to convert +obj+ into an array, using +to_ary+ method. -converted array or +nil+ if +obj+ cannot be converted for any reason. -This method can be used to check if an argument is an array.

    - -

    Array.try_convert([1]) #=> [1] - Array.try_convert(“1”) #=> nil

    - -

    if tmp = Array.try_convert(arg) - # the argument is an array - elsif tmp = String.try_convert(arg) - # the argument is a string - end

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 19
    -
    -def self.try_convert(obj)
    -  if obj.respond_to?(:to_ary)
    -    obj.to_ary
    -  else
    -    nil
    -  end
    -end
    -
    -
    - -
    -

    Instance Method Details

    @@ -2275,6 +2154,16 @@

     
     
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
     146
     147
     148
    @@ -2287,20 +2176,10 @@ 

    155 156 157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168

    +158

  • -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 146
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 136
     
     def &(elem)
       raise TypeError, "can't convert #{elem.class} into Array" unless elem.class == Array
    @@ -2357,9 +2236,6 @@ 

     
     
    -421
    -422
    -423
     424
     425
     426
    @@ -2383,10 +2259,13 @@ 

    444 445 446 -447

    +447 +448 +449 +450

    -
    # File 'src/array.c', line 421
    +      
    # File 'src/array.c', line 424
     
     static mrb_value
     mrb_ary_times(mrb_state *mrb, mrb_value self)
    @@ -2544,29 +2423,29 @@ 

     
     
    -99
    -100
    -101
    -102
    -103
    -104
    -105
    -106
    -107
    -108
    -109
    -110
    -111
    -112
    -113
    -114
    -115
    -116
    -117
    -118
    +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 99
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 70
     
     def -(elem)
       raise TypeError, "can't convert #{elem.class} into Array" unless elem.class == Array
    @@ -2620,9 +2499,6 @@ 

     
     
    -505
    -506
    -507
     508
     509
     510
    @@ -2640,10 +2516,13 @@ 

    522 523 524 -525

    +525 +526 +527 +528

    -
    # File 'src/array.c', line 505
    +      
    # File 'src/array.c', line 508
     
     static mrb_value
     mrb_ary_push_m(mrb_state *mrb, mrb_value self)
    @@ -2708,13 +2587,6 @@ 

     
     
    -153
    -154
    -155
    -156
    -157
    -158
    -159
     160
     161
     162
    @@ -2730,10 +2602,17 @@ 

    172 173 174 -175

    +175 +176 +177 +178 +179 +180 +181 +182

    -
    # File 'mrblib/array.rb', line 153
    +      
    # File 'mrblib/array.rb', line 160
     
     def <=>(other)
       other = self.__ary_cmp(other)
    @@ -2794,21 +2673,21 @@ 

     
     
    -110
    -111
    -112
    -113
    -114
    -115
    -116
     117
     118
     119
     120
    -121
    +121 +122 +123 +124 +125 +126 +127 +128

    -
    # File 'mrblib/array.rb', line 110
    +      
    # File 'mrblib/array.rb', line 117
     
     def ==(other)
       other = self.__ary_eq(other)
    @@ -3071,9 +2950,6 @@ 

     
     
    -849
    -850
    -851
     852
     853
     854
    @@ -3103,23 +2979,27 @@ 

    878 879 880 -881

    +881 +882 +883 +884 +885

    -
    # File 'src/array.c', line 849
    +      
    # File 'src/array.c', line 852
     
     static mrb_value
     mrb_ary_aget(mrb_state *mrb, mrb_value self)
     {
       struct RArray *a = mrb_ary_ptr(self);
    -  mrb_int i, len, alen = ARY_LEN(a);
    +  mrb_int i, len, alen;
       mrb_value index;
     
       if (mrb_get_args(mrb, "o|i", &index, &len) == 1) {
         switch (mrb_type(index)) {
           /* a[n..m] */
         case MRB_TT_RANGE:
    -      if (mrb_range_beg_len(mrb, index, &i, &len, alen, TRUE) == 1) {
    +      if (mrb_range_beg_len(mrb, index, &i, &len, ARY_LEN(a), TRUE) == 1) {
             return ary_subseq(mrb, a, i, len);
           }
           else {
    @@ -3133,6 +3013,7 @@ 

    } i = aget_index(mrb, index); + alen = ARY_LEN(a); if (i < 0) i += alen; if (i < 0 || alen < i) return mrb_nil_value(); if (len < 0) return mrb_nil_value(); @@ -3303,10 +3184,6 @@

     
     
    -918
    -919
    -920
    -921
     922
     923
     924
    @@ -3329,10 +3206,14 @@ 

    941 942 943 -944

    +944 +945 +946 +947 +948

    -
    # File 'src/array.c', line 918
    +      
    # File 'src/array.c', line 922
     
     static mrb_value
     mrb_ary_aset(mrb_state *mrb, mrb_value self)
    @@ -3381,6 +3262,7 @@ 

     
     
    +1233
     1234
     1235
     1236
    @@ -3392,11 +3274,10 @@ 

    1242 1243 1244 -1245 -1246

    +1245

    -
    # File 'src/array.c', line 1234
    +      
    # File 'src/array.c', line 1233
     
     static mrb_value
     mrb_ary_cmp(mrb_state *mrb, mrb_value ary1)
    @@ -3431,6 +3312,7 @@ 

     
     
    +1218
     1219
     1220
     1221
    @@ -3443,11 +3325,10 @@ 

    1228 1229 1230 -1231 -1232

    +1231

    -
    # File 'src/array.c', line 1219
    +      
    # File 'src/array.c', line 1218
     
     static mrb_value
     mrb_ary_eq(mrb_state *mrb, mrb_value ary1)
    @@ -3495,23 +3376,23 @@ 

     
     
    -1016
    -1017
    -1018
    -1019
    -1020
    -1021
    -1022
    -1023
    -1024
     1025
     1026
     1027
     1028
    -1029
    +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038

    -
    # File 'src/array.c', line 1016
    +      
    # File 'src/array.c', line 1025
     
     static mrb_value
     mrb_ary_index_m(mrb_state *mrb, mrb_value self)
    @@ -3533,9 +3414,9 @@ 

    -

    +

    - #__sort_sub__(left, right, &block) ⇒ Object + #__svalueObject @@ -3543,9 +3424,7 @@

    -

    Quick sort -left : the beginning of sort region -right : the end of sort region

    +

    internal method to convert multi-value to single value

    @@ -3561,100 +3440,22 @@

     
     
    -199
    -200
    -201
    -202
    -203
    -204
    -205
    -206
    -207
    -208
    -209
    -210
    -211
    -212
    -213
    -214
    -215
    -216
    -217
    -218
    -219
    +1248 +1249 +1250 +1251 +1252 +1253 +1254 +1255 +1256 +1257 +1258 +1259 +1260

    -
    # File 'mrblib/array.rb', line 199
    -
    -def __sort_sub__(left, right, &block)
    -  if left < right
    -    i = left
    -    j = right
    -    pivot = self[i + (j - i) / 2]
    -    while true
    -      while ((block)? block.call(self[i], pivot): (self[i] <=> pivot)) < 0
    -        i += 1
    -      end
    -      while ((block)? block.call(pivot, self[j]): (pivot <=> self[j])) < 0
    -        j -= 1
    -      end
    -      break if (i >= j)
    -      tmp = self[i]; self[i] = self[j]; self[j] = tmp;
    -      i += 1
    -      j -= 1
    -    end
    -    __sort_sub__(left, i-1, &block)
    -    __sort_sub__(j+1, right, &block)
    -  end
    -end
    - - - - - -
    -

    - - #__svalueObject - - - - - -

    -
    -

    internal method to convert multi-value to single value

    - - -
    -
    -
    - - -
    - - - - - @@ -3733,9 +3548,6 @@

     
     
    -505
    -506
    -507
     508
     509
     510
    @@ -3753,10 +3565,13 @@ 

    522 523 524 -525

    +525 +526 +527 +528

    - + @@ -4382,32 +4175,32 @@

     
     
    +863
    +864
    +865
    +866
    +867
    +868
    +869
    +870
    +871
    +872
    +873
    +874
    +875
    +876
    +877
    +878
    +879
    +880
    +881
    +882
    +883
     884
    -885
    -886
    -887
    -888
    -889
    -890
    -891
    -892
    -893
    -894
    -895
    -896
    -897
    -898
    -899
    -900
    -901
    -902
    -903
    -904
    -905
    -906
    +885

    - + - + - + - + @@ -8126,9 +8070,9 @@

    -

    +

    - #to_hHash + #transposeObject @@ -8136,45 +8080,23 @@

    -

    Returns the result of interpreting aray as an array of -[key, value] paris.

    +

    call-seq: + ary.transpose -> new_ary

    -
    [[:foo, :bar], [1, 2]].to_h
    -  # => {:foo => :bar, 1 => 2}
    -
    +

    Assumes that self is an array of arrays and transposes the rows and columns.

    +

    If the length of the subarrays don’t match, an IndexError is raised.

    -
    -
    -
    - -
    -
    - +

    Examples:

    + +

    a = [[1,2], [3,4], [5,6]] + a.transpose #=> [[1, 3, 5], [2, 4, 6]]

    -

    Returns:

    -
      - -
    • - - - (Hash) - - - -
    • - -
    - -
    - - -
    @@ -8184,81 +8106,47 @@

     
     
    -121
    -122
    -123
    -124
    -125
    -126
    -127
    -128
    -129
    -130
    -131
    -132
    -133
    -134
    -135
    -136
    -137
    -138
    -139
    -140
    -141
    -142
    -143
    -144
    -145
    -146
    -147
    -148
    -149
    -150
    -151
    +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913

    -
    -
    -
    -1249
    -1250
    -1251
    -1252
    -1253
    -1254
    -1255
    -1256
    -1257
    -1258
    -1259
    -1260
    -1261
    -
    -
    # File 'src/array.c', line 1249
    +      
    # File 'src/array.c', line 1248
     
     static mrb_value
     mrb_ary_svalue(mrb_state *mrb, mrb_value ary)
    @@ -3692,14 +3493,28 @@ 

    86 87 88 -89

    +89 +90 +91 +92 +93 +94 +95 +96
    # File 'mrblib/array.rb', line 86
     
     def _inspect
    -  return "[]" if self.size == 0
    -  "["+self.map{|x|x.inspect}.join(", ")+"]"
    +  size = self.size
    +  return "[]" if size == 0
    +  ary=[]
    +  i=0
    +  while i<size
    +    ary<<self[i].inspect
    +    i+=1
    +  end
    +  "["+ary.join(", ")+"]"
     end
    -
    # File 'src/array.c', line 505
    +      
    # File 'src/array.c', line 508
     
     static mrb_value
     mrb_ary_push_m(mrb_state *mrb, mrb_value self)
    @@ -4059,18 +3874,18 @@ 

     
     
    -609
    -610
    -611
    -612
    -613
    -614
    -615
    -616
    -617
    +598 +599 +600 +601 +602 +603 +604 +605 +606

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 609
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 598
     
     def bsearch(&block)
       return to_enum :bsearch unless block
    @@ -4122,6 +3937,17 @@ 

     
     
    +620
    +621
    +622
    +623
    +624
    +625
    +626
    +627
    +628
    +629
    +630
     631
     632
     633
    @@ -4144,21 +3970,10 @@ 

    650 651 652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664

    -

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 631
    +653
    +
    +
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 620
     
     def bsearch_index(&block)
       return to_enum :bsearch_index unless block
    @@ -4226,43 +4041,21 @@ 

     
     
    -1089
    -1090
    -1091
    -1092
    -1093
    -1094
    -1095
    -1096
    -1097
    -1098
    -1099
    -1100
    -1101
    -1102
    -1103
    -1104
    -1105
    +1105 +1106 +1107 +1108 +1109 +1110

    -
    # File 'src/array.c', line 1089
    +      
    # File 'src/array.c', line 1105
     
    -MRB_API mrb_value
    -mrb_ary_clear(mrb_state *mrb, mrb_value self)
    +static mrb_value
    +mrb_ary_clear_m(mrb_state *mrb, mrb_value self)
     {
    -  struct RArray *a = mrb_ary_ptr(self);
    -
    -  ary_modify(mrb, a);
    -  if (ARY_SHARED_P(a)) {
    -    mrb_ary_decref(mrb, a->as.heap.aux.shared);
    -    ARY_UNSET_SHARED_FLAG(a);
    -  }
    -  else if (!ARY_EMBED_P(a)){
    -    mrb_free(mrb, a->as.heap.ptr);
    -  }
    -  ARY_SET_EMBED_LEN(a, 0);
    -
    -  return self;
    +  mrb_get_args(mrb, "");
    +  return mrb_ary_clear(mrb, self);
     }
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 884
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 863
     
     def combination(n, &block)
       size = self.size
    @@ -4470,14 +4263,14 @@ 

     
     
    -241
    -242
    -243
    -244
    -245
    +231 +232 +233 +234 +235

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 241
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 231
     
     def compact
       result = self.dup
    @@ -4524,17 +4317,17 @@ 

     
     
    -258
    -259
    -260
    -261
    -262
    -263
    -264
    -265
    +248 +249 +250 +251 +252 +253 +254 +255

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 258
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 248
     
     def compact!
       result = self.select { |e| !e.nil? }
    @@ -4630,17 +4423,17 @@ 

     
     
    -179
    -180
    -181
    -182
    -183
    -184
    -185
    -186
    +186 +187 +188 +189 +190 +191 +192 +193

    -
    # File 'mrblib/array.rb', line 179
    +      
    # File 'mrblib/array.rb', line 186
     
     def delete(key, &block)
       while i = self.index(key)
    @@ -4682,10 +4475,6 @@ 

     
     
    -946
    -947
    -948
    -949
     950
     951
     952
    @@ -4710,10 +4499,15 @@ 

    971 972 973 -974

    +974 +975 +976 +977 +978 +979

    -
    # File 'src/array.c', line 946
    +      
    # File 'src/array.c', line 950
     
     static mrb_value
     mrb_ary_delete_at(mrb_state *mrb, mrb_value self)
    @@ -4722,9 +4516,10 @@ 

    mrb_int index; mrb_value val; mrb_value *ptr; - mrb_int len, alen = ARY_LEN(a); + mrb_int len, alen; mrb_get_args(mrb, "i", &index); + alen = ARY_LEN(a); if (index < 0) index += alen; if (index < 0 || alen <= index) return mrb_nil_value(); @@ -4791,22 +4586,22 @@

     
     
    +479
    +480
    +481
    +482
    +483
    +484
    +485
    +486
    +487
    +488
    +489
     490
    -491
    -492
    -493
    -494
    -495
    -496
    -497
    -498
    -499
    -500
    -501
    -502
    +491

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 490
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 479
     
     def delete_if(&block)
       return to_enum :delete_if unless block
    @@ -4858,17 +4653,17 @@ 

     
     
    -803
    -804
    -805
    -806
    -807
    -808
    -809
    -810
    +782 +783 +784 +785 +786 +787 +788 +789

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 803
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 782
     
     def dig(idx,*args)
       n = self[idx]
    @@ -5041,16 +4836,16 @@ 

     
     
    -1107
    -1108
    -1109
    -1110
    -1111
     1112
    -1113
    +1113 +1114 +1115 +1116 +1117 +1118

    -
    # File 'src/array.c', line 1107
    +      
    # File 'src/array.c', line 1112
     
     static mrb_value
     mrb_ary_empty_p(mrb_state *mrb, mrb_value self)
    @@ -5107,21 +4902,21 @@ 

     
     
    -128
    -129
    -130
    -131
    -132
    -133
    -134
     135
     136
     137
     138
    -139
    +139 +140 +141 +142 +143 +144 +145 +146

    -
    # File 'mrblib/array.rb', line 128
    +      
    # File 'mrblib/array.rb', line 135
     
     def eql?(other)
       other = self.__ary_eq(other)
    @@ -5143,7 +4938,7 @@ 

    - #fetch(n = nil, ifnone = NONE, &block) ⇒ Object + #fetch(n, ifnone = NONE, &block) ⇒ Object @@ -5188,27 +4983,27 @@

     
     
    +293
    +294
    +295
    +296
    +297
    +298
    +299
    +300
    +301
    +302
    +303
     304
     305
     306
     307
    -308
    -309
    -310
    -311
    -312
    -313
    -314
    -315
    -316
    -317
    -318
    -319
    -

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 304
    -
    -def fetch(n=nil, ifnone=NONE, &block)
    +308
    +
    +
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 293
    +
    +def fetch(n, ifnone=NONE, &block)
       warn "block supersedes default value argument" if !n.nil? && ifnone != NONE && block
     
       idx = n
    @@ -5286,6 +5081,17 @@ 

     
     
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +350
    +351
    +352
    +353
     354
     355
     356
    @@ -5341,21 +5147,10 @@ 

    406 407 408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420

    +409

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 354
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 343
     
     def fill(arg0=nil, arg1=nil, arg2=nil, &block)
       if arg0.nil? && arg1.nil? && arg2.nil? && !block
    @@ -5456,11 +5251,6 @@ 

     
     
    -976
    -977
    -978
    -979
    -980
     981
     982
     983
    @@ -5475,25 +5265,32 @@ 

    992 993 994 -995

    +995 +996 +997 +998 +999 +1000 +1001

    -
    # File 'src/array.c', line 976
    +      
    # File 'src/array.c', line 981
     
     static mrb_value
     mrb_ary_first(mrb_state *mrb, mrb_value self)
     {
       struct RArray *a = mrb_ary_ptr(self);
    -  mrb_int size, alen = ARY_LEN(a);
    +  mrb_int size, alen;
     
       if (mrb_get_argc(mrb) == 0) {
    -    return (alen > 0)? ARY_PTR(a)[0]: mrb_nil_value();
    +    return (ARY_LEN(a) > 0)? ARY_PTR(a)[0]: mrb_nil_value();
       }
       mrb_get_args(mrb, "|i", &size);
       if (size < 0) {
         mrb_raise(mrb, E_ARGUMENT_ERROR, "negative array size");
       }
     
    +  alen = ARY_LEN(a);
       if (size > alen) size = alen;
       if (ARY_SHARED_P(a)) {
         return ary_subseq(mrb, a, 0, size);
    @@ -5546,14 +5343,14 @@ 

     
     
    -187
    -188
    -189
    -190
    -191
    +177 +178 +179 +180 +181

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 187
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 177
     
     def flatten(depth=nil)
       res = dup
    @@ -5606,6 +5403,16 @@ 

     
     
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +209
     210
     211
     212
    @@ -5616,20 +5423,10 @@ 

    217 218 219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230

    +220

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 210
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 200
     
     def flatten!(depth=nil)
       modified = false
    @@ -5695,23 +5492,23 @@ 

     
     
    -1016
    -1017
    -1018
    -1019
    -1020
    -1021
    -1022
    -1023
    -1024
     1025
     1026
     1027
     1028
    -1029
    +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038

    -
    # File 'src/array.c', line 1016
    +      
    # File 'src/array.c', line 1025
     
     static mrb_value
     mrb_ary_index_m(mrb_state *mrb, mrb_value self)
    @@ -5759,19 +5556,19 @@ 

     
     
    -410
    -411
    -412
     413
     414
     415
     416
     417
     418
    -419
    +419 +420 +421 +422

    -
    # File 'src/array.c', line 410
    +      
    # File 'src/array.c', line 413
     
     static mrb_value
     mrb_ary_replace_m(mrb_state *mrb, mrb_value self)
    @@ -5826,14 +5623,14 @@ 

     
     
    -551
    -552
    -553
    -554
    -555
    +540 +541 +542 +543 +544

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 551
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 540
     
     def insert(idx, *args)
       idx += self.size + 1 if idx < 0
    @@ -5878,16 +5675,16 @@ 

     
     
    -94
    -95
    -96
    -97
    -98
    -99
    -100
    +101 +102 +103 +104 +105 +106 +107

    -
    # File 'mrblib/array.rb', line 94
    +      
    # File 'mrblib/array.rb', line 101
     
     def inspect
       begin
    @@ -5959,17 +5756,17 @@ 

     
     
    +1209
     1210
     1211
     1212
     1213
     1214
     1215
    -1216
    -1217
    +1216

    -
    # File 'src/array.c', line 1210
    +      
    # File 'src/array.c', line 1209
     
     static mrb_value
     mrb_ary_join_m(mrb_state *mrb, mrb_value ary)
    @@ -6024,23 +5821,23 @@ 

     
     
    +701
    +702
    +703
    +704
    +705
    +706
    +707
    +708
    +709
    +710
    +711
     712
     713
    -714
    -715
    -716
    -717
    -718
    -719
    -720
    -721
    -722
    -723
    -724
    -725
    -

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 712
    +714
    +
    +
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 701
     
     def keep_if(&block)
       return to_enum :keep_if unless block
    @@ -6088,12 +5885,6 @@ 

     
     
    -997
    -998
    -999
    -1000
    -1001
    -1002
     1003
     1004
     1005
    @@ -6105,19 +5896,31 @@ 

    1011 1012 1013 -1014

    +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023

    -
    # File 'src/array.c', line 997
    +      
    # File 'src/array.c', line 1003
     
     static mrb_value
     mrb_ary_last(mrb_state *mrb, mrb_value self)
     {
       struct RArray *a = mrb_ary_ptr(self);
    -  mrb_int size, alen = ARY_LEN(a);
    +  mrb_int n, size, alen;
     
    -  if (mrb_get_args(mrb, "|i", &size) == 0)
    -    return (alen > 0)? ARY_PTR(a)[alen - 1]: mrb_nil_value();
    +  n = mrb_get_args(mrb, "|i", &size);
    +  alen = ARY_LEN(a);
    +  if (n == 0) {
    +    return (alen > 0) ? ARY_PTR(a)[alen - 1]: mrb_nil_value();
    +  }
     
       if (size < 0) {
         mrb_raise(mrb, E_ARGUMENT_ERROR, "negative array size");
    @@ -6160,16 +5963,16 @@ 

     
     
    +1079
    +1080
     1081
     1082
     1083
     1084
    -1085
    -1086
    -1087
    +1085

    -
    # File 'src/array.c', line 1081
    +      
    # File 'src/array.c', line 1079
     
     static mrb_value
     mrb_ary_size(mrb_state *mrb, mrb_value self)
    @@ -6234,31 +6037,31 @@ 

     
     
    -838
    -839
    -840
    -841
    -842
    -843
    -844
    -845
    -846
    -847
    -848
    -849
    -850
    -851
    -852
    -853
    -854
    -855
    -856
    -857
    -858
    -859
    -

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 838
    +817
    +818
    +819
    +820
    +821
    +822
    +823
    +824
    +825
    +826
    +827
    +828
    +829
    +830
    +831
    +832
    +833
    +834
    +835
    +836
    +837
    +838
    +
    +
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 817
     
     def permutation(n=self.size, &block)
       size = self.size
    @@ -6314,9 +6117,6 @@ 

     
     
    -527
    -528
    -529
     530
     531
     532
    @@ -6324,10 +6124,13 @@ 

    534 535 536 -537

    +537 +538 +539 +540

    -
    # File 'src/array.c', line 527
    +      
    # File 'src/array.c', line 530
     
     MRB_API mrb_value
     mrb_ary_pop(mrb_state *mrb, mrb_value ary)
    @@ -6372,9 +6175,6 @@ 

     
     
    -607
    -608
    -609
     610
     611
     612
    @@ -6409,10 +6209,13 @@ 

    641 642 643 -644

    +644 +645 +646 +647

    -
    # File 'src/array.c', line 607
    +      
    # File 'src/array.c', line 610
     
     static mrb_value
     mrb_ary_unshift_m(mrb_state *mrb, mrb_value self)
    @@ -6484,9 +6287,6 @@ 

     
     
    -505
    -506
    -507
     508
     509
     510
    @@ -6504,10 +6304,13 @@ 

    522 523 524 -525

    +525 +526 +527 +528

    -
    # File 'src/array.c', line 505
    +      
    # File 'src/array.c', line 508
     
     static mrb_value
     mrb_ary_push_m(mrb_state *mrb, mrb_value self)
    @@ -6678,27 +6481,27 @@ 

     
     
    +508
    +509
    +510
    +511
    +512
    +513
    +514
    +515
    +516
    +517
    +518
     519
     520
     521
     522
     523
     524
    -525
    -526
    -527
    -528
    -529
    -530
    -531
    -532
    -533
    -534
    -535
    -536
    +525

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 519
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 508
     
     def reject!(&block)
       return to_enum :reject! unless block
    @@ -6750,19 +6553,19 @@ 

     
     
    -410
    -411
    -412
     413
     414
     415
     416
     417
     418
    -419
    +419 +420 +421 +422

    -
    # File 'src/array.c', line 410
    +      
    # File 'src/array.c', line 413
     
     static mrb_value
     mrb_ary_replace_m(mrb_state *mrb, mrb_value self)
    @@ -6806,9 +6609,6 @@ 

     
     
    -471
    -472
    -473
     474
     475
     476
    @@ -6824,10 +6624,13 @@ 

    486 487 488 -489

    +489 +490 +491 +492

    -
    # File 'src/array.c', line 471
    +      
    # File 'src/array.c', line 474
     
     static mrb_value
     mrb_ary_reverse(mrb_state *mrb, mrb_value self)
    @@ -6880,9 +6683,6 @@ 

     
     
    -449
    -450
    -451
     452
     453
     454
    @@ -6900,10 +6700,13 @@ 

    466 467 468 -469

    +469 +470 +471 +472

    -
    # File 'src/array.c', line 449
    +      
    # File 'src/array.c', line 452
     
     static mrb_value
     mrb_ary_reverse_bang(mrb_state *mrb, mrb_value self)
    @@ -6958,19 +6761,19 @@ 

     
     
    -268
    -269
    -270
    -271
    -272
    -273
    -274
    -275
    -276
    -277
    +258 +259 +260 +261 +262 +263 +264 +265 +266 +267

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 268
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 258
     
     def reverse_each(&block)
       return to_enum :reverse_each unless block
    @@ -7014,15 +6817,6 @@ 

     
     
    -1031
    -1032
    -1033
    -1034
    -1035
    -1036
    -1037
    -1038
    -1039
     1040
     1041
     1042
    @@ -7030,10 +6824,19 @@ 

    1044 1045 1046 -1047

    +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056

    -
    # File 'src/array.c', line 1031
    +      
    # File 'src/array.c', line 1040
     
     static mrb_value
     mrb_ary_rindex_m(mrb_state *mrb, mrb_value self)
    @@ -7098,23 +6901,23 @@ 

     
     
    +427
    +428
    +429
    +430
    +431
    +432
    +433
    +434
    +435
    +436
    +437
     438
     439
    -440
    -441
    -442
    -443
    -444
    -445
    -446
    -447
    -448
    -449
    -450
    -451
    +440

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 438
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 427
     
     def rotate(count=1)
       ary = []
    @@ -7176,12 +6979,12 @@ 

     
     
    -469
    -470
    -471
    +458 +459 +460

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 469
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 458
     
     def rotate!(count=1)
       self.replace(self.rotate(count))
    @@ -7229,23 +7032,23 @@ 

     
     
    +730
    +731
    +732
    +733
    +734
    +735
    +736
    +737
    +738
    +739
    +740
     741
     742
    -743
    -744
    -745
    -746
    -747
    -748
    -749
    -750
    -751
    -752
    -753
    -754
    -

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 741
    +743
    +
    +
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 730
     
     def select!(&block)
       return to_enum :select! unless block
    @@ -7293,9 +7096,6 @@ 

     
     
    -541
    -542
    -543
     544
     545
     546
    @@ -7325,10 +7125,13 @@ 

    570 571 572 -573

    +573 +574 +575 +576

    -
    # File 'src/array.c', line 541
    +      
    # File 'src/array.c', line 544
     
     MRB_API mrb_value
     mrb_ary_shift(mrb_state *mrb, mrb_value self)
    @@ -7395,16 +7198,16 @@ 

     
     
    +1079
    +1080
     1081
     1082
     1083
     1084
    -1085
    -1086
    -1087
    +1085

    -
    # File 'src/array.c', line 1081
    +      
    # File 'src/array.c', line 1079
     
     static mrb_value
     mrb_ary_size(mrb_state *mrb, mrb_value self)
    @@ -7662,9 +7465,6 @@ 

     
     
    -849
    -850
    -851
     852
     853
     854
    @@ -7694,23 +7494,27 @@ 

    878 879 880 -881

    +881 +882 +883 +884 +885

    -
    # File 'src/array.c', line 849
    +      
    # File 'src/array.c', line 852
     
     static mrb_value
     mrb_ary_aget(mrb_state *mrb, mrb_value self)
     {
       struct RArray *a = mrb_ary_ptr(self);
    -  mrb_int i, len, alen = ARY_LEN(a);
    +  mrb_int i, len, alen;
       mrb_value index;
     
       if (mrb_get_args(mrb, "o|i", &index, &len) == 1) {
         switch (mrb_type(index)) {
           /* a[n..m] */
         case MRB_TT_RANGE:
    -      if (mrb_range_beg_len(mrb, index, &i, &len, alen, TRUE) == 1) {
    +      if (mrb_range_beg_len(mrb, index, &i, &len, ARY_LEN(a), TRUE) == 1) {
             return ary_subseq(mrb, a, i, len);
           }
           else {
    @@ -7724,6 +7528,7 @@ 

    } i = aget_index(mrb, index); + alen = ARY_LEN(a); if (i < 0) i += alen; if (i < 0 || alen < i) return mrb_nil_value(); if (len < 0) return mrb_nil_value(); @@ -7880,6 +7685,49 @@

     
     
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
     174
     175
     176
    @@ -7892,58 +7740,16 @@ 

    183 184 185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228

    +186

    -
    # File 'mrbgems/mruby-array-ext/src/array.c', line 174
    +      
    # File 'mrbgems/mruby-array-ext/src/array.c', line 131
     
     static mrb_value
     mrb_ary_slice_bang(mrb_state *mrb, mrb_value self)
     {
       struct RArray *a = mrb_ary_ptr(self);
    -  mrb_int i, j, k, len, alen = ARY_LEN(a);
    +  mrb_int i, j, k, len, alen;
       mrb_value val;
       mrb_value *ptr;
       mrb_value ary;
    @@ -7956,7 +7762,7 @@ 

    mrb_get_args(mrb, "o|i", &index, &len); switch (mrb_type(index)) { case MRB_TT_RANGE: - if (mrb_range_beg_len(mrb, index, &i, &len, alen, TRUE) == 1) { + if (mrb_range_beg_len(mrb, index, &i, &len, ARY_LEN(a), TRUE) == 1) { goto delete_pos_len; } else { @@ -7973,6 +7779,7 @@

    mrb_get_args(mrb, "ii", &i, &len); delete_pos_len: + alen = ARY_LEN(a); if (i < 0) i += alen; if (i < 0 || alen < i) return mrb_nil_value(); if (len < 0) return mrb_nil_value(); @@ -8014,12 +7821,12 @@

     
     
    -233
    -234
    -235
    +270 +271 +272

    -
    # File 'mrblib/array.rb', line 233
    +      
    # File 'mrblib/array.rb', line 270
     
     def sort(&block)
       self.dup.sort!(&block)
    @@ -8057,21 +7864,135 @@ 

     
     
    +205
    +206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +215
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +224
     225
     226
     227
     228
     229
     230
    -231
    +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268

    -
    # File 'mrblib/array.rb', line 225
    +      
    # File 'mrblib/array.rb', line 205
     
     def sort!(&block)
    -  size = self.size
    -  if size > 1
    -    __sort_sub__(0, size - 1, &block)
    +  stack = [ [ 0, self.size - 1 ] ]
    +  until stack.empty?
    +    left, mid, right = stack.pop
    +    if right == nil
    +      right = mid
    +      # sort self[left..right]
    +      if left < right
    +        if left + 1 == right
    +          lval = self[left]
    +          rval = self[right]
    +          cmp = if block then block.call(lval,rval) else lval <=> rval end
    +          if cmp.nil?
    +            raise ArgumentError, "comparison of #{lval.inspect} and #{rval.inspect} failed"
    +          end
    +          if cmp > 0
    +            self[left]  = rval
    +            self[right] = lval
    +          end
    +        else
    +          mid = ((left + right + 1) / 2).floor
    +          stack.push [ left, mid, right ]
    +          stack.push [ mid, right ]
    +          stack.push [ left, (mid - 1) ] if left < mid - 1
    +        end
    +      end
    +    else
    +      lary = self[left, mid - left]
    +      lsize = lary.size
    +
    +      # The entity sharing between lary and self may cause a large memory
    +      # copy operation in the merge loop below.  This harmless operation
    +      # cancels the sharing and provides a huge performance gain.
    +      lary[0] = lary[0]
    +
    +      # merge
    +      lidx = 0
    +      ridx = mid
    +      (left..right).each { |i|
    +        if lidx >= lsize
    +          break
    +        elsif ridx > right
    +          self[i, lsize - lidx] = lary[lidx, lsize - lidx]
    +          break
    +        else
    +          lval = lary[lidx]
    +          rval = self[ridx]
    +          cmp = if block then block.call(lval,rval) else lval <=> rval end
    +          if cmp.nil?
    +            raise ArgumentError, "comparison of #{lval.inspect} and #{rval.inspect} failed"
    +          end
    +          if cmp <= 0
    +            self[i] = lval
    +            lidx += 1
    +          else
    +            self[i] = rval
    +            ridx += 1
    +          end
    +        end
    +      }
    +    end
       end
       self
     end
    @@ -8081,9 +8002,9 @@

    -

    +

    - #to_aryObject + #to_h(&blk) ⇒ Object @@ -8092,9 +8013,18 @@

    call-seq: - ary.to_ary -> ary

    + ary.to_h -> Hash + ary.to_h{|item| … } -> Hash

    -

    Returns +self+.

    +

    Returns the result of interpreting aray as an array of +[key, value] pairs. If a block is given, it should +return [key, value] pairs to construct a hash.

    + +
    [[:foo, :bar], [1, 2]].to_h
    +  # => {:foo => :bar, 1 => 2}
    +[1, 2].to_h{|x| [x, x*2]}
    +  # => {1 => 2, 2 => 4}
    +
    @@ -8110,15 +8040,29 @@

     
     
    -791
    -792
    -793
    +929 +930 +931 +932 +933 +934 +935 +936 +937 +938

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 791
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 929
     
    -def to_ary
    -  self
    +def to_h(&blk)
    +  h = {}
    +  self.each do |v|
    +    v = blk.call(v) if blk
    +    raise TypeError, "wrong element type #{v.class}" unless Array === v
    +    raise ArgumentError, "wrong array length (expected 2, was #{v.length})" unless v.length == 2
    +    h[v[0]] = v[1]
    +  end
    +  h
     end
    -
    # File 'mrbgems/mruby-array-ext/src/array.c', line 121
    -
    -static mrb_value
    -mrb_ary_to_h(mrb_state *mrb, mrb_value ary)
    -{
    -  mrb_int i;
    -  mrb_value v, hash;
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 900
     
    -  hash = mrb_hash_new_capa(mrb, 0);
    -
    -  for (i = 0; i < RARRAY_LEN(ary); ++i) {
    -    mrb_value elt = RARRAY_PTR(ary)[i];
    -    v = mrb_check_array_type(mrb, elt);
    -
    -    if (mrb_nil_p(v)) {
    -      mrb_raisef(mrb, E_TYPE_ERROR, "wrong element type %S at %S (expected array)",
    -                 mrb_str_new_cstr(mrb,  mrb_obj_classname(mrb, elt)),
    -                 mrb_fixnum_value(i)
    -      );
    -    }
    -
    -    if (RARRAY_LEN(v) != 2) {
    -      mrb_raisef(mrb, E_ARGUMENT_ERROR, "wrong array length at %S (expected 2, was %S)",
    -                 mrb_fixnum_value(i),
    -                 mrb_fixnum_value(RARRAY_LEN(v))
    -      );
    -    }
    +def transpose
    +  return [] if empty?
     
    -    mrb_hash_set(mrb, hash, RARRAY_PTR(v)[0], RARRAY_PTR(v)[1]);
    -  }
    +  column_count = nil
    +  self.each do |row|
    +    raise TypeError unless row.is_a?(Array)
    +    column_count ||= row.count
    +    raise IndexError, 'element size differs' unless column_count == row.count
    +  end
     
    -  return hash;
    -}
    + Array.new(column_count) do |column_index| + self.map { |row| row[column_index] } + end +end
    -

    +

    - #transposeObject + #union(*args) ⇒ Object @@ -8267,16 +8155,13 @@

    call-seq: - ary.transpose -> new_ary

    + ary.union(other_ary,…) -> new_ary

    -

    Assumes that self is an array of arrays and transposes the rows and columns.

    +

    Set Union—Returns a new array by joining this array with +other_ary, removing duplicates.

    -

    If the length of the subarrays don’t match, an IndexError is raised.

    - -

    Examples:

    - -

    a = [[1,2], [3,4], [5,6]] - a.transpose #=> [[1, 3, 5], [2, 4, 6]]

    +

    [“a”, “b”, “c”].union([“c”, “d”, “a”], [“a”, “c”, “e”]) + #=> [“a”, “b”, “c”, “d”, “e”]

    @@ -8292,37 +8177,25 @@

     
     
    -921
    -922
    -923
    -924
    -925
    -926
    -927
    -928
    -929
    -930
    -931
    -932
    -933
    -934
    +118 +119 +120 +121 +122 +123 +124 +125

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 921
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 118
     
    -def transpose
    -  return [] if empty?
    -
    -  column_count = nil
    -  self.each do |row|
    -    raise TypeError unless row.is_a?(Array)
    -    column_count ||= row.count
    -    raise IndexError, 'element size differs' unless column_count == row.count
    -  end
    -
    -  Array.new(column_count) do |column_index|
    -    self.map { |row| row[column_index] }
    +def union(*args)
    +  ary = self.dup
    +  args.each do |x|
    +    ary.concat(x)
    +    ary.uniq!
       end
    +  ary
     end
    @@ -8366,14 +8239,14 @@

     
     
    -82
    -83
    -84
    -85
    -86
    +53 +54 +55 +56 +57

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 82
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 53
     
     def uniq(&block)
       ary = self.dup
    @@ -8425,53 +8298,45 @@ 

     
     
    -43
    -44
    -45
    -46
    -47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -61
    -62
    -63
    -64
    -65
    -66
    -67
    +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 43
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 18
     
     def uniq!(&block)
    -  ary = self.dup
    -  result = []
    +  hash = {}
       if block
    -    hash = {}
    -    while ary.size > 0
    -      val = ary.shift
    +    self.each do |val|
           key = block.call(val)
    -      hash[key] = val unless hash.has_key?(key)
    -    end
    -    hash.each_value do |value|
    -      result << value
    +      hash[key] = val unless hash.key?(key)
         end
    +    result = hash.values
       else
    -    while ary.size > 0
    -      result << ary.shift
    -      ary.delete(result.last)
    +    hash = {}
    +    self.each do |val|
    +      hash[val] = val
         end
    +    result = hash.keys
       end
       if result.size == self.size
         nil
    @@ -8511,9 +8376,6 @@ 

     
     
    -607
    -608
    -609
     610
     611
     612
    @@ -8548,10 +8410,13 @@ 

    641 642 643 -644

    +644 +645 +646 +647

    -
    # File 'src/array.c', line 607
    +      
    # File 'src/array.c', line 610
     
     static mrb_value
     mrb_ary_unshift_m(mrb_state *mrb, mrb_value self)
    @@ -8687,15 +8552,15 @@ 

     
     
    -130
    -131
    -132
    -133
    -134
    -135
    +101 +102 +103 +104 +105 +106

    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 130
    +      
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 101
     
     def |(elem)
       raise TypeError, "can't convert #{elem.class} into Array" unless elem.class == Array
    @@ -8713,9 +8578,9 @@ 

    diff --git a/docs/api/BasicSocket.html b/docs/api/BasicSocket.html index 8bc40a0..9b54174 100644 --- a/docs/api/BasicSocket.html +++ b/docs/api/BasicSocket.html @@ -6,7 +6,7 @@ Class: BasicSocket - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -112,15 +112,21 @@

    Direct Known Subclasses

    IPSocket, Socket, UNIXSocket

    -

    Constant Summary

    -
    - -
    @@do_not_reverse_lookup = - -
    -
    true
    - -
    + +

    + Constant Summary + collapse +

    + +
    + +
    @@do_not_reverse_lookup = + +
    +
    true
    + +
    + @@ -920,23 +926,23 @@

     
     
    -484
    -485
    -486
    -487
    -488
    -489
    -490
    -491
    -492
    -493
    -494
    -495
    -496
    -497
    +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511

    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 484
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 498
     
     static mrb_value
     mrb_basicsocket_set_is_socket(mrb_state *mrb, mrb_value self)
    @@ -972,20 +978,6 @@ 

     
     
    -357
    -358
    -359
    -360
    -361
    -362
    -363
    -364
    -365
    -366
    -367
    -368
    -369
    -370
     371
     372
     373
    @@ -993,10 +985,24 @@ 

    375 376 377 -378

    +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392

    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 357
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 371
     
     static mrb_value
     mrb_basicsocket_recvfrom(mrb_state *mrb, mrb_value self)
    @@ -1040,20 +1046,6 @@ 

     
     
    -399
    -400
    -401
    -402
    -403
    -404
    -405
    -406
    -407
    -408
    -409
    -410
    -411
    -412
     413
     414
     415
    @@ -1067,10 +1059,24 @@ 

    423 424 425 -426

    +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440

    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 399
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 413
     
     static mrb_value
     mrb_basicsocket_setnonblock(mrb_state *mrb, mrb_value self)
    @@ -1120,16 +1126,16 @@ 

     
     
    -759
    -760
    -761
    -762
    -763
    -764
    -765
    +772 +773 +774 +775 +776 +777 +778

    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 759
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 772
     
     static mrb_value
     mrb_win32_basicsocket_close(mrb_state *mrb, mrb_value self)
    @@ -1158,20 +1164,6 @@ 

     
     
    -272
    -273
    -274
    -275
    -276
    -277
    -278
    -279
    -280
    -281
    -282
    -283
    -284
    -285
     286
     287
     288
    @@ -1179,10 +1171,24 @@ 

    290 291 292 -293

    +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307

    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 272
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 286
     
     static mrb_value
     mrb_basicsocket_getpeereid(mrb_state *mrb, mrb_value self)
    @@ -1202,7 +1208,7 @@ 

    mrb_ary_push(mrb, ary, mrb_fixnum_value((mrb_int)egid)); return ary; #else - mrb_raise(mrb, E_RUNTIME_ERROR, "getpeereid is not avaialble on this system"); + mrb_raise(mrb, E_RUNTIME_ERROR, "getpeereid is not available on this system"); return mrb_nil_value(); #endif }

    @@ -1226,21 +1232,21 @@

     
     
    -295
    -296
    -297
    -298
    -299
    -300
    -301
    -302
    -303
    -304
    -305
    -306
    +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320

    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 295
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 309
     
     static mrb_value
     mrb_basicsocket_getpeername(mrb_state *mrb, mrb_value self)
    @@ -1274,21 +1280,21 @@ 

     
     
    -308
    -309
    -310
    -311
    -312
    -313
    -314
    -315
    -316
    -317
    -318
    -319
    +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333

    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 308
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 322
     
     static mrb_value
     mrb_basicsocket_getsockname(mrb_state *mrb, mrb_value self)
    @@ -1322,28 +1328,28 @@ 

     
     
    -321
    -322
    -323
    -324
    -325
    -326
    -327
    -328
    -329
    -330
    -331
    -332
    -333
    -334
     335
     336
     337
     338
    -339
    +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353

    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 321
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 335
     
     static mrb_value
     mrb_basicsocket_getsockopt(mrb_state *mrb, mrb_value self)
    @@ -1426,24 +1432,24 @@ 

     
     
    -341
    -342
    -343
    -344
    -345
    -346
    -347
    -348
    -349
    -350
    -351
    -352
    -353
    -354
    -355
    +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369

    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 341
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 355
     
     static mrb_value
     mrb_basicsocket_recv(mrb_state *mrb, mrb_value self)
    @@ -1562,27 +1568,27 @@ 

    recvmsg(maxlen, flags=0)

     
     
    -380
    -381
    -382
    -383
    -384
    -385
    -386
    -387
    -388
    -389
    -390
    -391
    -392
    -393
     394
     395
     396
    -397
    +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 380
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 394
     
     static mrb_value
     mrb_basicsocket_send(mrb_state *mrb, mrb_value self)
    @@ -1634,20 +1640,6 @@ 

    sendmsg_nonblock

     
     
    -428
    -429
    -430
    -431
    -432
    -433
    -434
    -435
    -436
    -437
    -438
    -439
    -440
    -441
     442
     443
     444
    @@ -1677,10 +1669,24 @@ 

    sendmsg_nonblock

    468 469 470 -471
    +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 428
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 442
     
     static mrb_value
     mrb_basicsocket_setsockopt(mrb_state *mrb, mrb_value self)
    @@ -1713,12 +1719,12 @@ 

    sendmsg_nonblock

    } } else if (argc == 1) { if (strcmp(mrb_obj_classname(mrb, so), "Socket::Option") != 0) - mrb_raisef(mrb, E_ARGUMENT_ERROR, "not an instance of Socket::Option"); + mrb_raise(mrb, E_ARGUMENT_ERROR, "not an instance of Socket::Option"); level = mrb_fixnum(mrb_funcall(mrb, so, "level", 0)); optname = mrb_fixnum(mrb_funcall(mrb, so, "optname", 0)); optval = mrb_funcall(mrb, so, "data", 0); } else { - mrb_raisef(mrb, E_ARGUMENT_ERROR, "wrong number of arguments (%d for 3)", argc); + mrb_raisef(mrb, E_ARGUMENT_ERROR, "wrong number of arguments (%S for 3)", mrb_fixnum_value(argc)); } s = socket_fd(mrb, self); @@ -1746,19 +1752,19 @@

     
     
    -473
    -474
    -475
    -476
    -477
    -478
    -479
    -480
    -481
    -482
    +487 +488 +489 +490 +491 +492 +493 +494 +495 +496

    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 473
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 487
     
     static mrb_value
     mrb_basicsocket_shutdown(mrb_state *mrb, mrb_value self)
    @@ -1790,19 +1796,6 @@ 

     
     
    -768
    -769
    -770
    -771
    -772
    -773
    -774
    -775
    -776
    -777
    -778
    -779
    -780
     781
     782
     783
    @@ -1831,10 +1824,23 @@ 

    806 807 808 -809

    +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822

    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 768
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 781
     
     static mrb_value
     mrb_win32_basicsocket_sysread(mrb_state *mrb, mrb_value self)
    @@ -1898,15 +1904,15 @@ 

     
     
    -811
    -812
    -813
    -814
    -815
    -816
    +824 +825 +826 +827 +828 +829

    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 811
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 824
     
     static mrb_value
     mrb_win32_basicsocket_sysseek(mrb_state *mrb, mrb_value self)
    @@ -1934,23 +1940,23 @@ 

     
     
    -818
    -819
    -820
    -821
    -822
    -823
    -824
    -825
    -826
    -827
    -828
    -829
    -830
    -831
    +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844

    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 818
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 831
     
     static mrb_value
     mrb_win32_basicsocket_syswrite(mrb_state *mrb, mrb_value self)
    @@ -1976,9 +1982,9 @@ 

    diff --git a/docs/api/Comparable.html b/docs/api/Comparable.html index 2509dba..c909f75 100644 --- a/docs/api/Comparable.html +++ b/docs/api/Comparable.html @@ -6,7 +6,7 @@ Module: Comparable - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -702,9 +702,9 @@

    diff --git a/docs/api/EOFError.html b/docs/api/EOFError.html index e87354a..8e6a595 100644 --- a/docs/api/EOFError.html +++ b/docs/api/EOFError.html @@ -6,7 +6,7 @@ Exception: EOFError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -150,9 +150,9 @@

    Constructor Details

    diff --git a/docs/api/Enumerable.html b/docs/api/Enumerable.html index 40526fb..b7d34cf 100644 --- a/docs/api/Enumerable.html +++ b/docs/api/Enumerable.html @@ -6,7 +6,7 @@ Module: Enumerable - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -80,7 +80,7 @@
    Included in:
    -
    Array, Enumerator, Enumerator::Generator, Hash, Range
    +
    Array, Enumerator, Enumerator::Chain, Enumerator::Generator, Hash, Range
    @@ -88,7 +88,7 @@
    Defined in:
    mrblib/enum.rb,
    - mrbgems/mruby-enum-ext/mrblib/enum.rb,
    mrbgems/mruby-enum-lazy/mrblib/lazy.rb,
    mrbgems/mruby-enumerator/mrblib/enumerator.rb
    + src/enum.c,
    mrbgems/mruby-enum-ext/mrblib/enum.rb,
    mrbgems/mruby-enum-lazy/mrblib/lazy.rb,
    mrbgems/mruby-enum-chain/mrblib/chain.rb,
    mrbgems/mruby-enumerator/mrblib/enumerator.rb
    @@ -96,7 +96,8 @@

    Overview

    -

    Enumerable

    +

    chain.rb Enumerator::Chain class +See Copyright Notice in mruby.h

    @@ -107,15 +108,21 @@

    Overview

    -

    Constant Summary

    -
    - -
    NONE = - -
    -
    Object.new
    - -
    + +

    + Constant Summary + collapse +

    + +
    + +
    NONE = + +
    +
    Object.new
    + +
    + @@ -134,6 +141,29 @@

  • + .__update_hash ⇒ Object + + + + + + + + + + + + + +

    internal method __update_hash(oldhash, index, itemhash).

    +
    + +
  • + + +
  • + + .to_h ⇒ Object @@ -166,6 +196,29 @@

  • + #+(other) ⇒ Object + + + + + + + + + + + + + +
    +
    + +
  • + + +
  • + + #all?(pat = NONE, &block) ⇒ Boolean @@ -222,6 +275,29 @@

  • + + + +
  • + + + #chain(*args) ⇒ Object + + + + + + + + + + + + + +
    +
    +
  • @@ -1200,7 +1276,7 @@

  • - #to_h ⇒ Object + #to_h(&blk) ⇒ Object @@ -1276,7 +1352,67 @@

    Class Method Details

    -

    +

    + + .__update_hashObject + + + + + +

    +
    +

    internal method __update_hash(oldhash, index, itemhash)

    + + +
    +
    +
    + + +
    + + + + + + +
    +
    +
    +
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +
    +
    # File 'src/enum.c', line 11
    +
    +static mrb_value
    +enum_update_hash(mrb_state *mrb, mrb_value self)
    +{
    +  mrb_int hash;
    +  mrb_int index;
    +  mrb_int hv;
    +
    +  mrb_get_args(mrb, "iii", &hash, &index, &hv);
    +  hash ^= ((uint32_t)hv << (index % 16));
    +
    +  return mrb_fixnum_value(hash);
    +}
    +
    +
    + +
    +

    .to_hObject @@ -1290,12 +1426,12 @@

     
     
    -817
    -818
    -819
    +814 +815 +816

  • -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 817
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 814
     
     def nil.to_h
       {}
    @@ -1312,7 +1448,37 @@ 

    Instance Method Details

    -

    +

    + + #+(other) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +10
    +11
    +12
    +
    +
    # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 10
    +
    +def +(other)
    +  Enumerator::Chain.new(self, other)
    +end
    +
    +
    + +
    +

    #all?(pat = NONE, &block) ⇒ Boolean @@ -1371,17 +1537,17 @@

     
     
    -24
    -25
     26
     27
     28
     29
     30
    -31
    +31 +32 +33

    -
    # File 'mrblib/enum.rb', line 24
    +      
    # File 'mrblib/enum.rb', line 26
     
     def all?(&block)
       if block
    @@ -1457,17 +1623,17 @@ 

     
     
    -41
    -42
     43
     44
     45
     46
     47
    -48
    +48 +49 +50

    -
    # File 'mrblib/enum.rb', line 41
    +      
    # File 'mrblib/enum.rb', line 43
     
     def any?(&block)
       if block
    @@ -1480,6 +1646,36 @@ 

    + + +
    +

    + + #chain(*args) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +6
    +7
    +8
    +
    +
    # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 6
    +
    +def chain(*args)
    +  Enumerator::Chain.new(self, *args)
    +end
    +
    @@ -1518,16 +1714,16 @@

     
     
    -57
    -58
     59
     60
     61
     62
    -63
    +63 +64 +65

    -
    # File 'mrblib/enum.rb', line 57
    +      
    # File 'mrblib/enum.rb', line 59
     
     def collect(&block)
       return to_enum :collect unless block
    @@ -1576,6 +1772,12 @@ 

     
     
    +249
    +250
    +251
    +252
    +253
    +254
     255
     256
     257
    @@ -1586,16 +1788,10 @@ 

    262 263 264 -265 -266 -267 -268 -269 -270 -271

    +265

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 255
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 249
     
     def count(v=NONE, &block)
       count = 0
    @@ -1663,6 +1859,12 @@ 

     
     
    +664
    +665
    +666
    +667
    +668
    +669
     670
     671
     672
    @@ -1683,22 +1885,10 @@ 

    687 688 689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702

    +690

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 670
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 664
     
     def cycle(nv = nil, &block)
       return to_enum(:cycle, nv) unless block
    @@ -1708,13 +1898,7 @@ 

    if nv.nil? n = -1 else - unless nv.respond_to?(:to_int) - raise TypeError, "no implicit conversion of #{nv.class} into Integer" - end - n = nv.to_int - unless n.kind_of?(Integer) - raise TypeError, "no implicit conversion of #{nv.class} into Integer" - end + n = nv.__to_int return nil if n <= 0 end @@ -1775,8 +1959,6 @@

     
     
    -73
    -74
     75
     76
     77
    @@ -1784,10 +1966,12 @@ 

    79 80 81 -82

    +82 +83 +84

    -
    # File 'mrblib/enum.rb', line 73
    +      
    # File 'mrblib/enum.rb', line 75
     
     def detect(ifnone=nil, &block)
       ret = ifnone
    @@ -1835,7 +2019,7 @@ 

  • - (TypeError) + (ArgumentError) @@ -1858,17 +2042,15 @@

    19 20 21 -22 -23

  • +22
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 15
     
     def drop(n)
    -  raise TypeError, "no implicit conversion of #{n.class} into Integer" unless n.respond_to?(:to_int)
    +  n = n.__to_int
       raise ArgumentError, "attempt to drop negative size" if n < 0
     
    -  n = n.to_int
       ary = []
       self.each {|*val| n == 0 ? ary << val.__svalue : n -= 1 }
       ary
    @@ -1916,6 +2098,7 @@ 

     
     
    +38
     39
     40
     41
    @@ -1924,11 +2107,10 @@ 

    44 45 46 -47 -48

    +47

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 39
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 38
     
     def drop_while(&block)
       return to_enum :drop_while unless block
    @@ -2000,7 +2182,7 @@ 

  • - (TypeError) + (ArgumentError) @@ -2016,6 +2198,7 @@

     
     
    +114
     115
     116
     117
    @@ -2028,19 +2211,18 @@ 

    124 125 126 -127 -128

    +127

  • -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 115
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 114
     
     def each_cons(n, &block)
    -  raise TypeError, "no implicit conversion of #{n.class} into Integer" unless n.respond_to?(:to_int)
    +  n = n.__to_int
       raise ArgumentError, "invalid size" if n <= 0
     
       return to_enum(:each_cons,n) unless block
       ary = []
    -  n = n.to_int
    +  n = n.to_i
       self.each do |*val|
         ary.shift if ary.size == n
         ary << val.__svalue
    @@ -2103,7 +2285,7 @@ 

  • - (TypeError) + (ArgumentError) @@ -2119,6 +2301,7 @@

     
     
    +142
     143
     144
     145
    @@ -2134,19 +2317,18 @@ 

    155 156 157 -158 -159

    +158

  • -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 143
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 142
     
     def each_slice(n, &block)
    -  raise TypeError, "no implicit conversion of #{n.class} into Integer" unless n.respond_to?(:to_int)
    +  n = n.__to_int
       raise ArgumentError, "invalid slice size" if n <= 0
     
       return to_enum(:each_slice,n) unless block
       ary = []
    -  n = n.to_int
    +  n = n.to_i
       self.each do |*val|
         ary << val.__svalue
         if ary.size == n
    @@ -2194,8 +2376,6 @@ 

     
     
    -91
    -92
     93
     94
     95
    @@ -2203,10 +2383,12 @@ 

    97 98 99 -100

    +100 +101 +102

    -
    # File 'mrblib/enum.rb', line 91
    +      
    # File 'mrblib/enum.rb', line 93
     
     def each_with_index(&block)
       return to_enum :each_with_index unless block
    @@ -2261,15 +2443,15 @@ 

     
     
    -613
    -614
    -615
    -616
    -617
    -618
    +607 +608 +609 +610 +611 +612

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 613
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 607
     
     def each_with_object(obj, &block)
       return to_enum(:each_with_object, obj) unless block
    @@ -2316,17 +2498,17 @@ 

     
     
    -107
    -108
     109
     110
     111
     112
     113
    -114
    +114 +115 +116

    -
    # File 'mrblib/enum.rb', line 107
    +      
    # File 'mrblib/enum.rb', line 109
     
     def entries
       ary = []
    @@ -2377,18 +2559,18 @@ 

     
     
    -129
    -130
     131
     132
     133
     134
     135
     136
    -137
    +137 +138 +139

    -
    # File 'mrblib/enum.rb', line 129
    +      
    # File 'mrblib/enum.rb', line 131
     
     def find_all(&block)
       return to_enum :find_all unless block
    @@ -2446,26 +2628,26 @@ 

     
     
    +710
    +711
    +712
    +713
    +714
    +715
    +716
    +717
    +718
    +719
    +720
    +721
     722
     723
     724
     725
    -726
    -727
    -728
    -729
    -730
    -731
    -732
    -733
    -734
    -735
    -736
    -737
    -738
    +726

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 722
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 710
     
     def find_index(val=NONE, &block)
       return to_enum(:find_index, val) if !block && val == NONE
    @@ -2522,6 +2704,10 @@ 

     
     
    +216
    +217
    +218
    +219
     220
     221
     222
    @@ -2539,16 +2725,10 @@ 

    234 235 236 -237 -238 -239 -240 -241 -242 -243

    +237

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 220
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 216
     
     def first(*args)
       case args.length
    @@ -2558,9 +2738,7 @@ 

    end return nil when 1 - n = args[0] - raise TypeError, "no implicit conversion of #{n.class} into Integer" unless n.respond_to?(:to_int) - i = n.to_int + i = args[0].__to_int raise ArgumentError, "attempt to take negative size" if i < 0 ary = [] return ary if i == 0 @@ -2634,6 +2812,12 @@

     
     
    +281
    +282
    +283
    +284
    +285
    +286
     287
     288
     289
    @@ -2641,16 +2825,10 @@ 

    291 292 293 -294 -295 -296 -297 -298 -299 -300

    +294

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 287
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 281
     
     def flat_map(&block)
       return to_enum :flat_map unless block
    @@ -2704,8 +2882,6 @@ 

     
     
    -147
    -148
     149
     150
     151
    @@ -2713,10 +2889,12 @@ 

    153 154 155 -156

    +156 +157 +158

    -
    # File 'mrblib/enum.rb', line 147
    +      
    # File 'mrblib/enum.rb', line 149
     
     def grep(pattern, &block)
       ary = []
    @@ -2769,6 +2947,7 @@ 

     
     
    +171
     172
     173
     174
    @@ -2778,11 +2957,10 @@ 

    178 179 180 -181 -182

    +181

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 172
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 171
     
     def group_by(&block)
       return to_enum :group_by unless block
    @@ -2827,8 +3005,6 @@ 

     
     
    -338
    -339
     340
     341
     342
    @@ -2836,17 +3012,17 @@ 

    344 345 346 -347

    +347 +348

    -
    # File 'mrblib/enum.rb', line 338
    +      
    # File 'mrblib/enum.rb', line 340
     
     def hash
       h = 12347
       i = 0
       self.each do |e|
    -    n = (e.hash & (0x7fffffff >> (i % 16))) << (i % 16)
    -    h ^= n
    +    h = __update_hash(h, i, e.hash)
         i += 1
       end
       h
    @@ -2905,15 +3081,15 @@ 

     
     
    -165
    -166
     167
     168
     169
    -170
    +170 +171 +172

    -
    # File 'mrblib/enum.rb', line 165
    +      
    # File 'mrblib/enum.rb', line 167
     
     def include?(obj)
       self.each{|*val|
    @@ -2976,8 +3152,6 @@ 

     
     
    -180
    -181
     182
     183
     184
    @@ -3001,10 +3175,12 @@ 

    202 203 204 -205

    +205 +206 +207

    -
    # File 'mrblib/enum.rb', line 180
    +      
    # File 'mrblib/enum.rb', line 182
     
     def inject(*args, &block)
       raise ArgumentError, "too many arguments" if args.size > 2
    @@ -3127,8 +3303,6 @@ 

     
     
    -221
    -222
     223
     224
     225
    @@ -3145,10 +3319,12 @@ 

    236 237 238 -239

    +239 +240 +241

    -
    # File 'mrblib/enum.rb', line 221
    +      
    # File 'mrblib/enum.rb', line 223
     
     def max(&block)
       flag = true  # 1st element?
    @@ -3218,6 +3394,12 @@ 

     
     
    +309
    +310
    +311
    +312
    +313
    +314
     315
     316
     317
    @@ -3232,16 +3414,10 @@ 

    326 327 328 -329 -330 -331 -332 -333 -334 -335

    +329

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 315
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 309
     
     def max_by(&block)
       return to_enum :max_by unless block
    @@ -3301,8 +3477,6 @@ 

     
     
    -248
    -249
     250
     251
     252
    @@ -3319,10 +3493,12 @@ 

    263 264 265 -266

    +266 +267 +268

    -
    # File 'mrblib/enum.rb', line 248
    +      
    # File 'mrblib/enum.rb', line 250
     
     def min(&block)
       flag = true  # 1st element?
    @@ -3392,6 +3568,12 @@ 

     
     
    +343
    +344
    +345
    +346
    +347
    +348
     349
     350
     351
    @@ -3406,16 +3588,10 @@ 

    360 361 362 -363 -364 -365 -366 -367 -368 -369

    +363

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 349
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 343
     
     def min_by(&block)
       return to_enum :min_by unless block
    @@ -3482,6 +3658,12 @@ 

     
     
    +379
    +380
    +381
    +382
    +383
    +384
     385
     386
     387
    @@ -3499,16 +3681,10 @@ 

    399 400 401 -402 -403 -404 -405 -406 -407 -408

    +402

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 385
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 379
     
     def minmax(&block)
       max = nil
    @@ -3577,6 +3753,12 @@ 

     
     
    +417
    +418
    +419
    +420
    +421
    +422
     423
     424
     425
    @@ -3597,16 +3779,10 @@ 

    440 441 442 -443 -444 -445 -446 -447 -448 -449

    +443

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 423
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 417
     
     def minmax_by(&block)
       return to_enum :minmax_by unless block
    @@ -3699,6 +3875,12 @@ 

     
     
    +466
    +467
    +468
    +469
    +470
    +471
     472
     473
     474
    @@ -3708,16 +3890,10 @@ 

    478 479 480 -481 -482 -483 -484 -485 -486 -487

    +481

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 472
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 466
     
     def none?(pat=NONE, &block)
       if pat != NONE
    @@ -3800,6 +3976,12 @@ 

     
     
    +506
    +507
    +508
    +509
    +510
    +511
     512
     513
     514
    @@ -3814,16 +3996,10 @@ 

    523 524 525 -526 -527 -528 -529 -530 -531 -532

    +526

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 512
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 506
     
     def one?(pat=NONE, &block)
       count = 0
    @@ -3886,8 +4062,6 @@ 

     
     
    -284
    -285
     286
     287
     288
    @@ -3897,10 +4071,12 @@ 

    292 293 294 -295

    +295 +296 +297

    -
    # File 'mrblib/enum.rb', line 284
    +      
    # File 'mrblib/enum.rb', line 286
     
     def partition(&block)
       ary_T = []
    @@ -3951,16 +4127,16 @@ 

     
     
    -304
    -305
     306
     307
     308
     309
    -310
    +310 +311 +312

    -
    # File 'mrblib/enum.rb', line 304
    +      
    # File 'mrblib/enum.rb', line 306
     
     def reject(&block)
       ary = []
    @@ -4017,20 +4193,20 @@ 

     
     
    +632
    +633
    +634
    +635
    +636
    +637
     638
     639
     640
     641
    -642
    -643
    -644
    -645
    -646
    -647
    -648
    +642

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 638
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 632
     
     def reverse_each(&block)
       return to_enum :reverse_each unless block
    @@ -4082,12 +4258,12 @@ 

     
     
    -327
    -328
    -329
    +329 +330 +331

    -
    # File 'mrblib/enum.rb', line 327
    +      
    # File 'mrblib/enum.rb', line 329
     
     def sort(&block)
       self.map{|*val| val.__svalue}.sort(&block)
    @@ -4131,6 +4307,7 @@ 

     
     
    +193
     194
     195
     196
    @@ -4143,13 +4320,10 @@ 

    203 204 205 -206 -207 -208 -209

    +206

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 194
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 193
     
     def sort_by(&block)
       return to_enum :sort_by unless block
    @@ -4161,9 +4335,7 @@ 

    ary.push([block.call(e), i]) } if ary.size > 1 - ary.__sort_sub__(0, ary.size - 1) do |a,b| - a <=> b - end + ary.sort! end ary.collect{|e,i| orig[i]} end

    @@ -4202,7 +4374,7 @@

  • - (TypeError) + (ArgumentError) @@ -4218,6 +4390,7 @@

     
     
    +58
     59
     60
     61
    @@ -4229,15 +4402,14 @@ 

    67 68 69 -70 -71

    +70

  • -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 59
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 58
     
     def take(n)
    -  raise TypeError, "no implicit conversion of #{n.class} into Integer" unless n.respond_to?(:to_int)
    -  i = n.to_int
    +  n = n.__to_int
    +  i = n.to_i
       raise ArgumentError, "attempt to take negative size" if i < 0
       ary = []
       return ary if i == 0
    @@ -4291,6 +4463,7 @@ 

     
     
    +85
     86
     87
     88
    @@ -4299,11 +4472,10 @@ 

    91 92 93 -94 -95

    +94

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 86
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 85
     
     def take_while(&block)
       return to_enum :take_while unless block
    @@ -4323,7 +4495,7 @@ 

    - #to_hObject + #to_h(&blk) ⇒ Object @@ -4355,27 +4527,45 @@

     
     
    +794
    +795
    +796
    +797
    +798
    +799
    +800
    +801
    +802
    +803
    +804
    +805
     806
     807
     808
     809
     810
     811
    -812
    -813
    -814
    -815
    +812

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 806
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 794
     
    -def to_h
    +def to_h(&blk)
       h = {}
    -  self.each do |*v|
    -    v = v.__svalue
    -    raise TypeError, "wrong element type #{v.class} (expected Array)" unless v.is_a? Array
    -    raise ArgumentError, "element has wrong array length (expected 2, was #{v.size})" if v.size != 2
    -    h[v[0]] = v[1]
    +  if blk
    +    self.each do |v|
    +      v = blk.call(v)
    +      raise TypeError, "wrong element type #{v.class} (expected Array)" unless v.is_a? Array
    +      raise ArgumentError, "element has wrong array length (expected 2, was #{v.size})" if v.size != 2
    +      h[v[0]] = v[1]
    +    end
    +  else
    +    self.each do |*v|
    +      v = v.__svalue
    +      raise TypeError, "wrong element type #{v.class} (expected Array)" unless v.is_a? Array
    +      raise ArgumentError, "element has wrong array length (expected 2, was #{v.size})" if v.size != 2
    +      h[v[0]] = v[1]
    +    end
       end
       h
     end
    @@ -4399,6 +4589,9 @@

     
     
    +818
    +819
    +820
     821
     822
     823
    @@ -4410,13 +4603,10 @@ 

    829 830 831 -832 -833 -834 -835

    +832

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 821
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 818
     
     def uniq(&block)
       hash = {}
    @@ -4465,6 +4655,18 @@ 

     
     
    +755
    +756
    +757
    +758
    +759
    +760
    +761
    +762
    +763
    +764
    +765
    +766
     767
     768
     769
    @@ -4479,22 +4681,10 @@ 

    778 779 780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793

    +781

    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 767
    +      
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 755
     
     def zip(*arg, &block)
       result = block ? nil : []
    @@ -4533,9 +4723,9 @@ 

    diff --git a/docs/api/Enumerator.html b/docs/api/Enumerator.html index 723da2c..639a72e 100644 --- a/docs/api/Enumerator.html +++ b/docs/api/Enumerator.html @@ -6,7 +6,7 @@ Class: Enumerator - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -104,7 +104,7 @@
    Defined in:
    mrbgems/mruby-enumerator/mrblib/enumerator.rb,
    - mrbgems/mruby-enum-lazy/mrblib/lazy.rb
    + mrbgems/mruby-enum-lazy/mrblib/lazy.rb,
    mrbgems/mruby-enum-chain/mrblib/chain.rb
    @@ -216,7 +216,7 @@

    Defined Under Namespace

    - Classes: Generator, Lazy, Yielder + Classes: Chain, Generator, Lazy, Yielder

    @@ -236,7 +236,7 @@

    Instance Attribute Summary collaps
  • - #args ⇒ Object + #args ⇒ Object @@ -246,8 +246,6 @@

    Instance Attribute Summary collaps - writeonly - @@ -255,7 +253,7 @@

    Instance Attribute Summary collaps -

    Sets the attribute args.

    +

    Returns the value of attribute args.

  • @@ -264,7 +262,7 @@

    Instance Attribute Summary collaps
  • - #fib ⇒ Object + #fib ⇒ Object @@ -273,8 +271,8 @@

    Instance Attribute Summary collaps + readonly - writeonly @@ -283,7 +281,7 @@

    Instance Attribute Summary collaps -

    Sets the attribute fib.

    +

    Returns the value of attribute fib.

  • @@ -292,7 +290,7 @@

    Instance Attribute Summary collaps
  • - #meth ⇒ Object + #meth ⇒ Object @@ -302,8 +300,6 @@

    Instance Attribute Summary collaps - writeonly - @@ -311,7 +307,7 @@

    Instance Attribute Summary collaps -

    Sets the attribute meth.

    +

    Returns the value of attribute meth.

  • @@ -320,7 +316,7 @@

    Instance Attribute Summary collaps
  • - #obj ⇒ Object + #obj ⇒ Object @@ -330,8 +326,6 @@

    Instance Attribute Summary collaps - writeonly - @@ -339,7 +333,7 @@

    Instance Attribute Summary collaps -

    Sets the attribute obj.

    +

    Returns the value of attribute obj.

  • @@ -448,7 +442,7 @@

  • - #initialize(obj = nil, meth = :each, *args, &block) ⇒ Enumerator + #initialize(obj = NONE, meth = :each, *args, &block) ⇒ Enumerator @@ -708,7 +702,7 @@

    Methods included from Enumerable

    -

    #all?, #any?, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_object, #entries, #find_all, #find_index, #first, #flat_map, #grep, #group_by, #hash, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #sort, #sort_by, #take, #take_while, #to_h, to_h, #uniq, #zip

    +

    #+, __update_hash, #all?, #any?, #chain, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_object, #entries, #find_all, #find_index, #first, #flat_map, #grep, #group_by, #hash, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #sort, #sort_by, #take, #take_while, #to_h, to_h, #uniq, #zip

    Constructor Details

    @@ -745,6 +739,13 @@

    p fib.take(10) # => [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]

  • +

    In the second, deprecated, form, a generated Enumerator iterates over the +given object using the given method with the given arguments passed. This +form is left only for internal use.

    + +

    Use of this form is discouraged. Use Kernel#enum_for or Kernel#to_enum +instead.

    + @@ -759,12 +760,6 @@

     
     
    -112
    -113
    -114
    -115
    -116
    -117
     118
     119
     120
    @@ -777,24 +772,24 @@ 

    127 128 129 -130

    +130 +131 +132 +133

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 112
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 118
     
    -def initialize(obj=nil, meth=:each, *args, &block)
    +def initialize(obj=NONE, meth=:each, *args, &block)
       if block
         obj = Generator.new(&block)
    -  else
    -    raise ArgumentError unless obj
    -  end
    -  if @obj and !self.respond_to?(meth)
    -    raise NoMethodError, "undefined method #{meth}"
    +  elsif obj == NONE
    +    raise ArgumentError, "wrong number of arguments (given 0, expected 1+)"
       end
     
       @obj = obj
       @meth = meth
    -  @args = args.dup
    +  @args = args
       @fib = nil
       @dst = nil
       @lookahead = nil
    @@ -812,11 +807,11 @@ 

    Instance Attribute Details

    - +
    -

    +

    - #args=(value) ⇒ Object + #argsObject @@ -824,7 +819,7 @@

    -

    Sets the attribute args

    +

    Returns the value of attribute args

    @@ -840,15 +835,15 @@

     
     
    -131
    -132
    -133
    +134 +135 +136

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 131
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 134
     
    -def args=(value)
    -  @args = value
    +def args
    +  @args
     end
    @@ -856,11 +851,11 @@

    - +
    -

    +

    - #fib=(value) ⇒ Object + #fibObject (readonly) @@ -868,7 +863,7 @@

    -

    Sets the attribute fib

    +

    Returns the value of attribute fib

    @@ -884,15 +879,15 @@

     
     
    -131
    -132
    -133
    +135 +136 +137

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 131
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 135
     
    -def fib=(value)
    -  @fib = value
    +def fib
    +  @fib
     end
    @@ -900,11 +895,11 @@

    - +
    -

    +

    - #meth=(value) ⇒ Object + #methObject @@ -912,7 +907,7 @@

    -

    Sets the attribute meth

    +

    Returns the value of attribute meth

    @@ -928,15 +923,15 @@

     
     
    -131
    -132
    -133
    +134 +135 +136

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 131
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 134
     
    -def meth=(value)
    -  @meth = value
    +def meth
    +  @meth
     end
    @@ -944,11 +939,11 @@

    - +
    -

    +

    - #obj=(value) ⇒ Object + #objObject @@ -956,7 +951,7 @@

    -

    Sets the attribute obj

    +

    Returns the value of attribute obj

    @@ -972,15 +967,15 @@

     
     
    -131
    -132
    -133
    +134 +135 +136

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 131
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 134
     
    -def obj=(value)
    -  @obj = value
    +def obj
    +  @obj
     end
    @@ -1053,6 +1048,7 @@

     
     
    +270
     271
     272
     273
    @@ -1067,11 +1063,10 @@ 

    282 283 284 -285 -286

    +285

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 271
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 270
     
     def each(*argv, &block)
       obj = self
    @@ -1127,12 +1122,12 @@ 

     
     
    -184
     185
    -186
    +186 +187

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 184
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 185
     
     def each_with_index(&block)
       with_index(0, &block)
    @@ -1224,14 +1219,14 @@ 

     
     
    +520
     521
     522
     523
    -524
    -525
    +524

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 521
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 520
     
     def feed(value)
       raise TypeError, "feed value already set" if @feedvalue
    @@ -1283,9 +1278,6 @@ 

     
     
    -134
    -135
    -136
     137
     138
     139
    @@ -1293,10 +1285,13 @@ 

    141 142 143 -144

    +144 +145 +146 +147

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 134
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 137
     
     def initialize_copy(obj)
       raise TypeError, "can't copy type #{obj.class}" unless obj.kind_of? Enumerator
    @@ -1329,7 +1324,6 @@ 

     
     
    -225
     226
     227
     228
    @@ -1337,20 +1331,17 @@ 

    230 231 232 -233 -234

    +233

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 225
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 226
     
     def inspect
    -  return "#<#{self.class}: uninitialized>" unless @obj
    -
       if @args && @args.size > 0
         args = @args.join(", ")
    -    "#<#{self.class}: #{@obj}:#{@meth}(#{args})>"
    +    "#<#{self.class}: #{@obj.inspect}:#{@meth}(#{args})>"
       else
    -    "#<#{self.class}: #{@obj}:#{@meth}>"
    +    "#<#{self.class}: #{@obj.inspect}:#{@meth}>"
       end
     end
    @@ -1402,12 +1393,12 @@

     
     
    +312
     313
    -314
    -315
    +314

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 313
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 312
     
     def next
       next_values.__svalue
    @@ -1498,6 +1489,7 @@ 

     
     
    +360
     361
     362
     363
    @@ -1535,11 +1527,10 @@ 

    395 396 397 -398 -399

    +398

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 361
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 360
     
     def next_values
       if @lookahead
    @@ -1629,12 +1620,12 @@ 

     
     
    +420
     421
    -422
    -423
    +422

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 421
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 420
     
     def peek
       peek_values.__svalue
    @@ -1694,15 +1685,15 @@ 

     
     
    +450
     451
     452
     453
     454
    -455
    -456
    +455

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 451
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 450
     
     def peek_values
       if @lookahead.nil?
    @@ -1747,6 +1738,7 @@ 

     
     
    +465
     466
     467
     468
    @@ -1754,11 +1746,10 @@ 

    470 471 472 -473 -474

    +473

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 466
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 465
     
     def rewind
       @obj.rewind if @obj.respond_to? :rewind
    @@ -1809,9 +1800,6 @@ 

     
     
    -157
    -158
    -159
     160
     161
     162
    @@ -1825,20 +1813,19 @@ 

    170 171 172 -173

    +173 +174

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 157
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 160
     
     def with_index(offset=0, &block)
       return to_enum :with_index, offset unless block
     
    -  offset = if offset.nil?
    -    0
    -  elsif offset.respond_to?(:to_int)
    -    offset.to_int
    +  if offset.nil?
    +    offset = 0
       else
    -    raise TypeError, "no implicit conversion of #{offset.class} into Integer"
    +    offset = offset.__to_int
       end
     
       n = offset - 1
    @@ -1909,17 +1896,17 @@ 

     
     
    -216
     217
     218
     219
     220
     221
     222
    -223
    +223 +224

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 216
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 217
     
     def with_object(object, &block)
       return to_enum(:with_object, object) unless block
    @@ -1939,9 +1926,9 @@ 

    diff --git a/docs/api/Enumerator/Chain.html b/docs/api/Enumerator/Chain.html new file mode 100644 index 0000000..8d23e3d --- /dev/null +++ b/docs/api/Enumerator/Chain.html @@ -0,0 +1,579 @@ + + + + + + + Class: Enumerator::Chain + + — Documentation by YARD 0.9.19 + + + + + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Enumerator::Chain + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    Enumerable
    +
    + + + + + + +
    +
    Defined in:
    +
    mrbgems/mruby-enum-chain/mrblib/chain.rb
    +
    + +
    + + + + +

    Constant Summary

    + +

    Constants included + from Enumerable

    +

    Enumerable::NONE

    + + + + + + +

    + Instance Method Summary + collapse +

    + + + + + + + + + + + + + +

    Methods included from Enumerable

    +

    #+, __update_hash, #all?, #any?, #chain, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #find_all, #find_index, #first, #flat_map, #grep, #group_by, #hash, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #sort, #sort_by, #take, #take_while, #to_h, to_h, #uniq, #zip

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(*args) ⇒ Chain + + + + + +

    +
    +

    Returns a new instance of Chain

    + + +
    +
    +
    + + +
    + + + + + + +
    +
    +
    +
    +19
    +20
    +21
    +
    +
    # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 19
    +
    +def initialize(*args)
    +  @enums = args
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #__copy_enumsObject + + + + + +

    + + + + +
    +
    +
    +
    +54
    +55
    +56
    +57
    +58
    +
    +
    # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 54
    +
    +def __copy_enums
    +  @enums.each_with_object([]) do |e, a|
    +    a << e.clone
    +  end
    +end
    +
    +
    + +
    +

    + + #each(&block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +
    +
    # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 27
    +
    +def each(&block)
    +  return to_enum unless block_given?
    +
    +  @enums.each { |e| e.each(&block) }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #initialize_copy(orig) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +23
    +24
    +25
    +
    +
    # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 23
    +
    +def initialize_copy(orig)
    +  @enums = orig.__copy_enums
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +50
    +51
    +52
    +
    +
    # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 50
    +
    +def inspect
    +  "#<#{self.class}: #{@enums.inspect}>"
    +end
    +
    +
    + +
    +

    + + #rewindObject + + + + + +

    + + + + +
    +
    +
    +
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +
    +
    # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 42
    +
    +def rewind
    +  @enums.reverse_each do |e|
    +    e.rewind if e.respond_to?(:rewind)
    +  end
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #sizeObject + + + + + +

    + + + + +
    +
    +
    +
    +35
    +36
    +37
    +38
    +39
    +40
    +
    +
    # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 35
    +
    +def size
    +  @enums.reduce(0) do |a, e|
    +    return nil unless e.respond_to?(:size)
    +    a + e.size
    +  end
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/Enumerator/Generator.html b/docs/api/Enumerator/Generator.html index 5479408..0f7e9b4 100644 --- a/docs/api/Enumerator/Generator.html +++ b/docs/api/Enumerator/Generator.html @@ -6,7 +6,7 @@ Class: Enumerator::Generator - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -202,7 +202,7 @@

    Methods included from Enumerable

    -

    #all?, #any?, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #find_all, #find_index, #first, #flat_map, #grep, #group_by, #hash, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #sort, #sort_by, #take, #take_while, #to_h, to_h, #uniq, #zip

    +

    #+, __update_hash, #all?, #any?, #chain, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #find_all, #find_index, #first, #flat_map, #grep, #group_by, #hash, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #sort, #sort_by, #take, #take_while, #to_h, to_h, #uniq, #zip

    Constructor Details

    @@ -246,14 +246,14 @@

     
     
    +529
     530
     531
     532
    -533
    -534
    +533

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 530
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 529
     
     def initialize(&block)
       raise TypeError, "wrong argument type #{self.class} (expected Proc)" unless block.kind_of? Proc
    @@ -287,13 +287,13 @@ 

     
     
    +535
     536
     537
    -538
    -539
    +538

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 536
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 535
     
     def each(*args, &block)
       args.unshift Yielder.new(&block)
    @@ -309,9 +309,9 @@ 

    diff --git a/docs/api/Enumerator/Lazy.html b/docs/api/Enumerator/Lazy.html index 5814e9c..be47a26 100644 --- a/docs/api/Enumerator/Lazy.html +++ b/docs/api/Enumerator/Lazy.html @@ -6,7 +6,7 @@ Class: Enumerator::Lazy - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -133,6 +133,11 @@

    Constants included +

    Instance Attribute Summary

    + +

    Attributes inherited from Enumerator

    +

    #args, #fib, #meth, #obj

    +

    @@ -475,7 +480,7 @@

    Methods inherited from Methods included from Enumerable

    -

    #all?, #any?, #count, #cycle, #detect, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #find_index, #first, #group_by, #hash, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reverse_each, #sort, #sort_by, #to_h, to_h

    +

    #+, __update_hash, #all?, #any?, #chain, #count, #cycle, #detect, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #find_index, #first, #group_by, #hash, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reverse_each, #sort, #sort_by, #to_h, to_h

    Constructor Details

    @@ -973,7 +978,7 @@

    def to_enum(meth=:each, *args, &block) unless self.respond_to?(meth) - raise NoMethodError, "undefined method #{meth}" + raise ArgumentError, "undefined method #{meth}" end lz = Lazy.new(self, &block) lz.obj = self @@ -1089,9 +1094,9 @@

    diff --git a/docs/api/Enumerator/Yielder.html b/docs/api/Enumerator/Yielder.html index 38baf12..2c223ad 100644 --- a/docs/api/Enumerator/Yielder.html +++ b/docs/api/Enumerator/Yielder.html @@ -6,7 +6,7 @@ Class: Enumerator::Yielder - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -247,14 +247,14 @@

     
     
    +543
     544
     545
     546
    -547
    -548
    +547

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 544
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 543
     
     def initialize(&block)
       raise LocalJumpError, "no block given" unless block
    @@ -288,13 +288,13 @@ 

     
     
    +553
     554
     555
    -556
    -557
    +556

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 554
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 553
     
     def << *args
       self.yield(*args)
    @@ -320,12 +320,12 @@ 

     
     
    +549
     550
    -551
    -552
    +551

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 550
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 549
     
     def yield(*args)
       @proc.call(*args)
    @@ -340,9 +340,9 @@ 

    diff --git a/docs/api/Exception.html b/docs/api/Exception.html index abfe1af..68fbc7d 100644 --- a/docs/api/Exception.html +++ b/docs/api/Exception.html @@ -6,7 +6,7 @@ Exception: Exception - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -814,9 +814,9 @@

    diff --git a/docs/api/FalseClass.html b/docs/api/FalseClass.html index a393bbd..44268ba 100644 --- a/docs/api/FalseClass.html +++ b/docs/api/FalseClass.html @@ -6,7 +6,7 @@ Class: FalseClass - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -711,9 +711,9 @@

    diff --git a/docs/api/Fiber.html b/docs/api/Fiber.html index 635ea11..988b99e 100644 --- a/docs/api/Fiber.html +++ b/docs/api/Fiber.html @@ -6,7 +6,7 @@ Class: Fiber - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -417,8 +417,7 @@

    134 135 136 -137 -138

    +137
    # File 'mrbgems/mruby-fiber/src/fiber.c', line 64
    @@ -489,7 +488,6 @@ 

    ci->proc = p; mrb_field_write_barrier(mrb, (struct RBasic*)mrb_obj_ptr(self), (struct RBasic*)p); ci->pc = p->body.irep->iseq; - ci->nregs = p->body.irep->nregs; ci[1] = ci[0]; c->ci++; /* push dummy callinfo */ @@ -525,20 +523,20 @@

     
     
    -282
    -283
    -284
    -285
    -286
     287
     288
     289
     290
     291
    -292
    +292 +293 +294 +295 +296 +297

    -
    # File 'mrbgems/mruby-fiber/src/fiber.c', line 282
    +      
    # File 'mrbgems/mruby-fiber/src/fiber.c', line 287
     
     static mrb_value
     fiber_eq(mrb_state *mrb, mrb_value self)
    @@ -656,11 +654,6 @@ 

     
     
    -246
    -247
    -248
    -249
    -250
     251
     252
     253
    @@ -668,10 +661,15 @@ 

    255 256 257 -258

    +258 +259 +260 +261 +262 +263

    -
    # File 'mrbgems/mruby-fiber/src/fiber.c', line 246
    +      
    # File 'mrbgems/mruby-fiber/src/fiber.c', line 251
     
     static mrb_value
     fiber_resume(mrb_state *mrb, mrb_value self)
    @@ -751,11 +749,6 @@ 

     
     
    -306
    -307
    -308
    -309
    -310
     311
     312
     313
    @@ -773,10 +766,15 @@ 

    325 326 327 -328

    +328 +329 +330 +331 +332 +333

    -
    # File 'mrbgems/mruby-fiber/src/fiber.c', line 306
    +      
    # File 'mrbgems/mruby-fiber/src/fiber.c', line 311
     
     static mrb_value
     fiber_transfer(mrb_state *mrb, mrb_value self)
    @@ -811,9 +809,9 @@ 

    diff --git a/docs/api/File.html b/docs/api/File.html index cbf2f1d..b09c55c 100644 --- a/docs/api/File.html +++ b/docs/api/File.html @@ -6,7 +6,7 @@ Class: File - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -1817,8 +1817,6 @@

     
     
    -349
    -350
     351
     352
     353
    @@ -1849,10 +1847,12 @@ 

    378 379 380 -381

    +381 +382 +383

    -
    # File 'mrbgems/mruby-io/src/file.c', line 349
    +      
    # File 'mrbgems/mruby-io/src/file.c', line 351
     
     mrb_value
     mrb_file_flock(mrb_state *mrb, mrb_value self)
    @@ -1907,8 +1907,6 @@ 

     
     
    -335
    -336
     337
     338
     339
    @@ -1919,10 +1917,12 @@ 

    344 345 346 -347

    +347 +348 +349

    -
    # File 'mrbgems/mruby-io/src/file.c', line 335
    +      
    # File 'mrbgems/mruby-io/src/file.c', line 337
     
     static mrb_value
     mrb_file_mtime(mrb_state *mrb, mrb_value self)
    @@ -1935,7 +1935,7 @@ 

    fd = (int)mrb_fixnum(mrb_io_fileno(mrb, self)); if (fstat(fd, &st) == -1) return mrb_false_value(); - return mrb_funcall(mrb, obj, "at", 1, mrb_float_value(mrb, st.st_mtime)); + return mrb_funcall(mrb, obj, "at", 1, mrb_fixnum_value(st.st_mtime)); }

    @@ -1947,9 +1947,9 @@

    diff --git a/docs/api/File/Constants.html b/docs/api/File/Constants.html index a3eacd9..475a81e 100644 --- a/docs/api/File/Constants.html +++ b/docs/api/File/Constants.html @@ -6,7 +6,7 @@ Module: File::Constants - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -95,100 +95,106 @@ -

    Constant Summary

    -
    - -
    RDONLY = - -
    -
    0
    - -
    WRONLY = - -
    -
    1
    - -
    RDWR = - -
    -
    2
    - -
    NONBLOCK = - -
    -
    4
    - -
    APPEND = - -
    -
    8
    - -
    BINARY = - -
    -
    0
    - -
    SYNC = - -
    -
    128
    - -
    NOFOLLOW = - -
    -
    256
    - -
    CREAT = - -
    -
    512
    - -
    TRUNC = - -
    -
    1024
    - -
    EXCL = - -
    -
    2048
    - -
    NOCTTY = - -
    -
    131072
    - -
    DSYNC = - -
    -
    4194304
    - -
    FNM_SYSCASE = - -
    -
    0
    - -
    FNM_NOESCAPE = - -
    -
    1
    - -
    FNM_PATHNAME = - -
    -
    2
    - -
    FNM_DOTMATCH = - -
    -
    4
    - -
    FNM_CASEFOLD = - -
    -
    8
    - -
    + +

    + Constant Summary + collapse +

    + +
    + +
    RDONLY = + +
    +
    0
    + +
    WRONLY = + +
    +
    1
    + +
    RDWR = + +
    +
    2
    + +
    NONBLOCK = + +
    +
    4
    + +
    APPEND = + +
    +
    8
    + +
    BINARY = + +
    +
    0
    + +
    SYNC = + +
    +
    128
    + +
    NOFOLLOW = + +
    +
    256
    + +
    CREAT = + +
    +
    512
    + +
    TRUNC = + +
    +
    1024
    + +
    EXCL = + +
    +
    2048
    + +
    NOCTTY = + +
    +
    131072
    + +
    DSYNC = + +
    +
    4194304
    + +
    FNM_SYSCASE = + +
    +
    0
    + +
    FNM_NOESCAPE = + +
    +
    1
    + +
    FNM_PATHNAME = + +
    +
    2
    + +
    FNM_DOTMATCH = + +
    +
    4
    + +
    FNM_CASEFOLD = + +
    +
    8
    + +
    + @@ -201,9 +207,9 @@

    Constant Summary

    diff --git a/docs/api/File/FileError.html b/docs/api/File/FileError.html index 277bd2c..dd7b087 100644 --- a/docs/api/File/FileError.html +++ b/docs/api/File/FileError.html @@ -6,7 +6,7 @@ Exception: File::FileError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -138,9 +138,9 @@

    Constructor Details

    diff --git a/docs/api/File/NoFileError.html b/docs/api/File/NoFileError.html index 4689879..a09ab1d 100644 --- a/docs/api/File/NoFileError.html +++ b/docs/api/File/NoFileError.html @@ -6,7 +6,7 @@ Exception: File::NoFileError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -142,9 +142,9 @@

    Constructor Details

    diff --git a/docs/api/File/PermissionError.html b/docs/api/File/PermissionError.html index 9c35d9c..5ad6d50 100644 --- a/docs/api/File/PermissionError.html +++ b/docs/api/File/PermissionError.html @@ -6,7 +6,7 @@ Exception: File::PermissionError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -142,9 +142,9 @@

    Constructor Details

    diff --git a/docs/api/File/UnableToStat.html b/docs/api/File/UnableToStat.html index 589e6a6..7c64bf4 100644 --- a/docs/api/File/UnableToStat.html +++ b/docs/api/File/UnableToStat.html @@ -6,7 +6,7 @@ Exception: File::UnableToStat - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -142,9 +142,9 @@

    Constructor Details

    diff --git a/docs/api/FileTest.html b/docs/api/FileTest.html index 77be073..92028e5 100644 --- a/docs/api/FileTest.html +++ b/docs/api/FileTest.html @@ -6,7 +6,7 @@ Class: FileTest - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -115,9 +115,9 @@ diff --git a/docs/api/Fixnum.html b/docs/api/Fixnum.html index 733ee33..35df11f 100644 --- a/docs/api/Fixnum.html +++ b/docs/api/Fixnum.html @@ -6,7 +6,7 @@ Class: Fixnum - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -537,7 +537,7 @@

    Methods included from Methods inherited from Numeric

    -

    #**, #+@, #-@, #/, #<, #<=, #<=>, #>, #>=, #abs, #finite?, #infinite?, #quo

    +

    #**, #+@, #-@, #/, #<, #<=, #<=>, #>, #>=, #__coerce_step_counter, #abs, #finite?, #infinite?, #quo

    @@ -587,42 +587,42 @@

     
     
    -800
    -801
    -802
    -803
    -804
    -805
    -806
    -807
    -808
    -809
    -810
    -811
    -812
    -813
    -814
    -815
    -816
    -817
    -818
    -819
    -820
    -821
    -822
    -823
    -824
    -825
    -826
    -827
    -828
    -829
    -830
    -831
    -832
    +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897

    -
    # File 'src/numeric.c', line 800
    +      
    # File 'src/numeric.c', line 865
     
     static mrb_value
     fix_mod(mrb_state *mrb, mrb_value x)
    @@ -691,17 +691,17 @@ 

     
     
    -966
    -967
    -968
    -969
    -970
    -971
    -972
    -973
    +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038

    -
    # File 'src/numeric.c', line 966
    +      
    # File 'src/numeric.c', line 1031
     
     static mrb_value
     fix_and(mrb_state *mrb, mrb_value x)
    @@ -747,17 +747,17 @@ 

     
     
    -753
    -754
    -755
    -756
    -757
    -758
    -759
    -760
    +818 +819 +820 +821 +822 +823 +824 +825

    -
    # File 'src/numeric.c', line 753
    +      
    # File 'src/numeric.c', line 818
     
     static mrb_value
     fix_mul(mrb_state *mrb, mrb_value x)
    @@ -803,17 +803,17 @@ 

     
     
    -1214
    -1215
    -1216
    -1217
    -1218
    -1219
    -1220
    -1221
    +1274 +1275 +1276 +1277 +1278 +1279 +1280 +1281

    -
    # File 'src/numeric.c', line 1214
    +      
    # File 'src/numeric.c', line 1274
     
     static mrb_value
     fix_plus(mrb_state *mrb, mrb_value self)
    @@ -859,17 +859,17 @@ 

     
     
    -1257
    -1258
    -1259
    -1260
    -1261
    -1262
    -1263
    -1264
    +1317 +1318 +1319 +1320 +1321 +1322 +1323 +1324

    -
    # File 'src/numeric.c', line 1257
    +      
    # File 'src/numeric.c', line 1317
     
     static mrb_value
     fix_minus(mrb_state *mrb, mrb_value self)
    @@ -938,25 +938,25 @@ 

     
     
    -1079
    -1080
    -1081
    -1082
    -1083
    -1084
    -1085
    -1086
    -1087
    -1088
    -1089
    -1090
    -1091
    -1092
    -1093
    -1094
    +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159

    -
    # File 'src/numeric.c', line 1079
    +      
    # File 'src/numeric.c', line 1144
     
     static mrb_value
     fix_lshift(mrb_state *mrb, mrb_value x)
    @@ -1037,26 +1037,26 @@ 

     
     
    -907
    -908
    -909
    -910
    -911
    -912
    -913
    -914
    -915
    -916
    -917
    -918
    -919
    -920
    -921
    -922
    -923
    +972 +973 +974 +975 +976 +977 +978 +979 +980 +981 +982 +983 +984 +985 +986 +987 +988

    -
    # File 'src/numeric.c', line 907
    +      
    # File 'src/numeric.c', line 972
     
     static mrb_value
     fix_equal(mrb_state *mrb, mrb_value x)
    @@ -1134,25 +1134,25 @@ 

     
     
    -1104
    -1105
    -1106
    -1107
    -1108
    -1109
    -1110
    -1111
    -1112
    -1113
    -1114
    -1115
    -1116
    -1117
    -1118
    -1119
    +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184

    -
    # File 'src/numeric.c', line 1104
    +      
    # File 'src/numeric.c', line 1169
     
     static mrb_value
     fix_rshift(mrb_state *mrb, mrb_value x)
    @@ -1204,17 +1204,17 @@ 

     
     
    -1000
    -1001
    -1002
    -1003
    -1004
    -1005
    -1006
    -1007
    +1065 +1066 +1067 +1068 +1069 +1070 +1071 +1072

    -
    # File 'src/numeric.c', line 1000
    +      
    # File 'src/numeric.c', line 1065
     
     static mrb_value
     fix_xor(mrb_state *mrb, mrb_value x)
    @@ -1283,46 +1283,46 @@ 

     
     
    -840
    -841
    -842
    -843
    -844
    -845
    -846
    -847
    -848
    -849
    -850
    -851
    -852
    -853
    -854
    -855
    -856
    -857
    -858
    -859
    -860
    -861
    -862
    -863
    -864
    -865
    -866
    -867
    -868
    -869
    -870
    -871
    -872
    -873
    -874
    -875
    -876
    +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941

    -
    # File 'src/numeric.c', line 840
    +      
    # File 'src/numeric.c', line 905
     
     static mrb_value
     fix_divmod(mrb_state *mrb, mrb_value x)
    @@ -1416,19 +1416,6 @@ 

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -1438,18 +1425,18 @@

     
     
    -287
    -288
    -289
    -290
    -291
    -292
    -293
    -294
    -295
    +354 +355 +356 +357 +358 +359 +360 +361 +362

    -
    # File 'src/numeric.c', line 287
    +      
    # File 'src/numeric.c', line 354
     
     static mrb_value
     fix_eql(mrb_state *mrb, mrb_value x)
    @@ -1527,17 +1514,17 @@ 

     
     
    -1312
    -1313
    -1314
    -1315
    -1316
    -1317
    -1318
    -1319
    +1372 +1373 +1374 +1375 +1376 +1377 +1378 +1379

    -
    # File 'src/numeric.c', line 1312
    +      
    # File 'src/numeric.c', line 1372
     
     static mrb_value
     fix_to_s(mrb_state *mrb, mrb_value self)
    @@ -1579,14 +1566,14 @@ 

     
     
    -1131
    -1132
    -1133
    -1134
    -1135
    +1196 +1197 +1198 +1199 +1200

    -
    # File 'src/numeric.c', line 1131
    +      
    # File 'src/numeric.c', line 1196
     
     static mrb_value
     fix_to_f(mrb_state *mrb, mrb_value num)
    @@ -1660,17 +1647,17 @@ 

     
     
    -1312
    -1313
    -1314
    -1315
    -1316
    -1317
    -1318
    -1319
    +1372 +1373 +1374 +1375 +1376 +1377 +1378 +1379

    -
    # File 'src/numeric.c', line 1312
    +      
    # File 'src/numeric.c', line 1372
     
     static mrb_value
     fix_to_s(mrb_state *mrb, mrb_value self)
    @@ -1714,17 +1701,17 @@ 

     
     
    -983
    -984
    -985
    -986
    -987
    -988
    -989
    -990
    +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055

    -
    # File 'src/numeric.c', line 983
    +      
    # File 'src/numeric.c', line 1048
     
     static mrb_value
     fix_or(mrb_state *mrb, mrb_value x)
    @@ -1796,16 +1783,16 @@ 

     
     
    -936
    -937
    -938
    -939
    -940
    -941
    -942
    +1001 +1002 +1003 +1004 +1005 +1006 +1007

    -
    # File 'src/numeric.c', line 936
    +      
    # File 'src/numeric.c', line 1001
     
     static mrb_value
     fix_rev(mrb_state *mrb, mrb_value num)
    @@ -1824,9 +1811,9 @@ 

    diff --git a/docs/api/Float.html b/docs/api/Float.html index 0143436..ee58eac 100644 --- a/docs/api/Float.html +++ b/docs/api/Float.html @@ -6,7 +6,7 @@ Class: Float - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -93,11 +93,6 @@ -
    -
    Includes:
    -
    Integral
    -
    - @@ -105,18 +100,14 @@
    Defined in:
    -
    mrblib/float.rb,
    - src/numeric.c
    -
    +
    src/numeric.c

    Overview

    -

    Float

    - -

    ISO 15.2.9

    +

    15.2.9

    @@ -728,19 +719,8 @@

    -

    Methods included from Integral

    -

    #div, #downto, #negative?, #next, #nonzero?, #positive?, #step, #times, #upto, #zero?

    - - - - - - - - -

    Methods inherited from Numeric

    -

    #**, #+@, #-@, #/, #<, #<=, #<=>, #>, #>=, #abs, #quo

    +

    #**, #+@, #-@, #/, #<, #<=, #<=>, #>, #>=, #__coerce_step_counter, #abs, #quo

    @@ -859,20 +839,20 @@

     
     
    -262
    -263
    -264
    -265
    -266
    -267
    -268
    -269
    -270
    -271
    -272
    +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339

    -
    # File 'src/numeric.c', line 262
    +      
    # File 'src/numeric.c', line 329
     
     static mrb_value
     flo_mod(mrb_state *mrb, mrb_value x)
    @@ -905,10 +885,10 @@ 

     
     
    -949
    +1014

    -
    # File 'src/numeric.c', line 949
    +      
    # File 'src/numeric.c', line 1014
     
     static mrb_value flo_and(mrb_state *mrb, mrb_value x);
    @@ -971,17 +951,17 @@

     
     
    -213
    -214
    -215
    -216
    -217
    -218
    -219
    -220
    +269 +270 +271 +272 +273 +274 +275 +276

    -
    # File 'src/numeric.c', line 213
    +      
    # File 'src/numeric.c', line 269
     
     static mrb_value
     flo_mul(mrb_state *mrb, mrb_value x)
    @@ -1023,17 +1003,17 @@ 

     
     
    -1467
    -1468
    -1469
    -1470
    -1471
    -1472
    -1473
    -1474
    +1527 +1528 +1529 +1530 +1531 +1532 +1533 +1534

    -
    # File 'src/numeric.c', line 1467
    +      
    # File 'src/numeric.c', line 1527
     
     static mrb_value
     flo_plus(mrb_state *mrb, mrb_value x)
    @@ -1103,17 +1083,17 @@ 

     
     
    -195
    -196
    -197
    -198
    -199
    -200
    -201
    -202
    +251 +252 +253 +254 +255 +256 +257 +258

    -
    # File 'src/numeric.c', line 195
    +      
    # File 'src/numeric.c', line 251
     
     static mrb_value
     flo_minus(mrb_state *mrb, mrb_value x)
    @@ -1143,17 +1123,17 @@ 

     
     
    -454
    -455
    -456
    -457
    -458
    -459
    -460
    -461
    +521 +522 +523 +524 +525 +526 +527 +528

    -
    # File 'src/numeric.c', line 454
    +      
    # File 'src/numeric.c', line 521
     
     static mrb_value
     flo_rshift(mrb_state *mrb, mrb_value x)
    @@ -1226,24 +1206,24 @@ 

     
     
    -321
    -322
    -323
    -324
    -325
    -326
    -327
    -328
    -329
    -330
    -331
    -332
    -333
    -334
    -335
    +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402

    -
    # File 'src/numeric.c', line 321
    +      
    # File 'src/numeric.c', line 388
     
     static mrb_value
     flo_eq(mrb_state *mrb, mrb_value x)
    @@ -1280,17 +1260,17 @@ 

     
     
    -445
    -446
    -447
    -448
    -449
    -450
    -451
    -452
    +512 +513 +514 +515 +516 +517 +518 +519

    -
    # File 'src/numeric.c', line 445
    +      
    # File 'src/numeric.c', line 512
     
     static mrb_value
     flo_lshift(mrb_state *mrb, mrb_value x)
    @@ -1320,10 +1300,10 @@ 

     
     
    -951
    +1016

    -
    # File 'src/numeric.c', line 951
    +      
    # File 'src/numeric.c', line 1016
     
     static mrb_value flo_xor(mrb_state *mrb, mrb_value x);
    @@ -1391,20 +1371,20 @@

     
     
    -568
    -569
    -570
    -571
    -572
    -573
    -574
    -575
    -576
    -577
    -578
    +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645

    -
    # File 'src/numeric.c', line 568
    +      
    # File 'src/numeric.c', line 635
     
     static mrb_value
     flo_ceil(mrb_state *mrb, mrb_value num)
    @@ -1449,23 +1429,23 @@ 

     
     
    -879
    -880
    -881
    -882
    -883
    -884
    -885
    -886
    -887
    -888
    -889
    -890
    -891
    -892
    +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957

    -
    # File 'src/numeric.c', line 879
    +      
    # File 'src/numeric.c', line 944
     
     static mrb_value
     flo_divmod(mrb_state *mrb, mrb_value x)
    @@ -1526,18 +1506,18 @@ 

     
     
    -298
    -299
    -300
    -301
    -302
    -303
    -304
    -305
    -306
    +365 +366 +367 +368 +369 +370 +371 +372 +373

    -
    # File 'src/numeric.c', line 298
    +      
    # File 'src/numeric.c', line 365
     
     static mrb_value
     flo_eql(mrb_state *mrb, mrb_value x)
    @@ -1546,7 +1526,7 @@ 

    mrb_get_args(mrb, "o", &y); if (!mrb_float_p(y)) return mrb_false_value(); - return mrb_bool_value(mrb_float(x) == (mrb_float)mrb_fixnum(y)); + return mrb_bool_value(mrb_float(x) == mrb_float(y)); }

    @@ -1600,19 +1580,6 @@

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -1622,14 +1589,14 @@

     
     
    -512
    -513
    -514
    -515
    -516
    +579 +580 +581 +582 +583

    -
    # File 'src/numeric.c', line 512
    +      
    # File 'src/numeric.c', line 579
     
     static mrb_value
     flo_finite_p(mrb_state *mrb, mrb_value num)
    @@ -1700,20 +1667,20 @@ 

     
     
    -542
    -543
    -544
    -545
    -546
    -547
    -548
    -549
    -550
    -551
    -552
    +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619

    -
    # File 'src/numeric.c', line 542
    +      
    # File 'src/numeric.c', line 609
     
     static mrb_value
     flo_floor(mrb_state *mrb, mrb_value num)
    @@ -1781,19 +1748,6 @@ 

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -1803,19 +1757,19 @@

     
     
    -490
    -491
    -492
    -493
    -494
    -495
    -496
    -497
    -498
    -499
    +557 +558 +559 +560 +561 +562 +563 +564 +565 +566

    -
    # File 'src/numeric.c', line 490
    +      
    # File 'src/numeric.c', line 557
     
     static mrb_value
     flo_infinite_p(mrb_state *mrb, mrb_value num)
    @@ -1889,25 +1843,103 @@ 

     
     
    -177
    -178
    -179
    -180
    -181
    -182
    -183
    -184
    +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240

    -
    # File 'src/numeric.c', line 177
    +      
    # File 'src/numeric.c', line 194
     
     static mrb_value
     flo_to_s(mrb_state *mrb, mrb_value flt)
     {
    -  if (isnan(mrb_float(flt))) {
    +  mrb_float f = mrb_float(flt);
    +
    +  if (isinf(f)) {
    +    return f < 0 ? mrb_str_new_lit(mrb, "-Infinity")
    +                 : mrb_str_new_lit(mrb, "Infinity");
    +  }
    +  else if (isnan(f)) {
         return mrb_str_new_lit(mrb, "NaN");
       }
    -  return mrb_float_to_str(mrb, flt, MRB_FLO_TO_STR_FMT);
    +  else {
    +    char fmt[] = "%." MRB_STRINGIZE(FLO_TO_STR_PREC) "g";
    +    mrb_value str = mrb_float_to_str(mrb, flt, fmt);
    +    mrb_int len;
    +    char *begp;
    +
    +    insert_dot_zero:
    +    begp = RSTRING_PTR(str);
    +    len = RSTRING_LEN(str);
    +    for (char *p = begp, *endp = p + len; p < endp; ++p) {
    +      if (*p == '.') {
    +        return str;
    +      }
    +      else if (*p == 'e') {
    +        ptrdiff_t e_pos = p - begp;
    +        mrb_str_cat(mrb, str, ".0", 2);
    +        p = RSTRING_PTR(str) + e_pos;
    +        memmove(p + 2, p, len - e_pos);
    +        memcpy(p, ".0", 2);
    +        return str;
    +      }
    +    }
    +
    +    if (FLO_TO_STR_PREC + (begp[0] == '-') <= len) {
    +      --fmt[sizeof(fmt) - 3];  /* %.16g(%.8g) -> %.15g(%.7g) */
    +      str = mrb_float_to_str(mrb, flt, fmt);
    +      goto insert_dot_zero;
    +    }
    +    else {
    +      mrb_str_cat(mrb, str, ".0", 2);
    +    }
    +
    +    return str;
    +  }
     }
    @@ -1954,14 +1986,14 @@

     
     
    -687
    -688
    -689
    -690
    -691
    +753 +754 +755 +756 +757

    -
    # File 'src/numeric.c', line 687
    +      
    # File 'src/numeric.c', line 753
     
     static mrb_value
     flo_nan_p(mrb_state *mrb, mrb_value num)
    @@ -2049,58 +2081,58 @@ 

     
     
    -611
    -612
    -613
    -614
    -615
    -616
    -617
    -618
    -619
    -620
    -621
    -622
    -623
    -624
    -625
    -626
    -627
    -628
    -629
    -630
    -631
    -632
    -633
    -634
    -635
    -636
    -637
    -638
    -639
    -640
    -641
    -642
    -643
    -644
    -645
    -646
    -647
    -648
    -649
    -650
    -651
    -652
    -653
    -654
    -655
    -656
    -657
    -658
    -659
    +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726

    -
    # File 'src/numeric.c', line 611
    +      
    # File 'src/numeric.c', line 678
     
     static mrb_value
     flo_round(mrb_state *mrb, mrb_value num)
    @@ -2210,14 +2242,14 @@ 

     
     
    -471
    -472
    -473
    -474
    -475
    +538 +539 +540 +541 +542

    -
    # File 'src/numeric.c', line 471
    +      
    # File 'src/numeric.c', line 538
     
     static mrb_value
     flo_to_f(mrb_state *mrb, mrb_value num)
    @@ -2235,8 +2267,6 @@ 

    #to_iInteger - #to_intInteger - #truncateInteger @@ -2264,37 +2294,6 @@

    - - -
    - -

    Returns:

    - - -
    - - - - - -
  • - #to_intInteger -
    -
    - - -
    @@ -2360,23 +2359,23 @@

     
     
    -672
    -673
    -674
    -675
    -676
    -677
    -678
    -679
    -680
    -681
    -682
    -683
    -684
    -685
    +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751

  • -
    # File 'src/numeric.c', line 672
    +      
    # File 'src/numeric.c', line 738
     
     static mrb_value
     flo_truncate(mrb_state *mrb, mrb_value num)
    @@ -2403,8 +2402,6 @@ 

    #to_iInteger - #to_intInteger - #truncateInteger @@ -2432,37 +2429,6 @@

    - - -
    - -

    Returns:

    - - -
    - - - - - -
  • - #to_intInteger -
    -
    - - -
    @@ -2528,23 +2494,23 @@

     
     
    -672
    -673
    -674
    -675
    -676
    -677
    -678
    -679
    -680
    -681
    -682
    -683
    -684
    -685
    +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751

  • -
    # File 'src/numeric.c', line 672
    +      
    # File 'src/numeric.c', line 738
     
     static mrb_value
     flo_truncate(mrb_state *mrb, mrb_value num)
    @@ -2622,25 +2588,103 @@ 

     
     
    -177
    -178
    -179
    -180
    -181
    -182
    -183
    -184
    +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240

    -
    # File 'src/numeric.c', line 177
    +      
    # File 'src/numeric.c', line 194
     
     static mrb_value
     flo_to_s(mrb_state *mrb, mrb_value flt)
     {
    -  if (isnan(mrb_float(flt))) {
    +  mrb_float f = mrb_float(flt);
    +
    +  if (isinf(f)) {
    +    return f < 0 ? mrb_str_new_lit(mrb, "-Infinity")
    +                 : mrb_str_new_lit(mrb, "Infinity");
    +  }
    +  else if (isnan(f)) {
         return mrb_str_new_lit(mrb, "NaN");
       }
    -  return mrb_float_to_str(mrb, flt, MRB_FLO_TO_STR_FMT);
    +  else {
    +    char fmt[] = "%." MRB_STRINGIZE(FLO_TO_STR_PREC) "g";
    +    mrb_value str = mrb_float_to_str(mrb, flt, fmt);
    +    mrb_int len;
    +    char *begp;
    +
    +    insert_dot_zero:
    +    begp = RSTRING_PTR(str);
    +    len = RSTRING_LEN(str);
    +    for (char *p = begp, *endp = p + len; p < endp; ++p) {
    +      if (*p == '.') {
    +        return str;
    +      }
    +      else if (*p == 'e') {
    +        ptrdiff_t e_pos = p - begp;
    +        mrb_str_cat(mrb, str, ".0", 2);
    +        p = RSTRING_PTR(str) + e_pos;
    +        memmove(p + 2, p, len - e_pos);
    +        memcpy(p, ".0", 2);
    +        return str;
    +      }
    +    }
    +
    +    if (FLO_TO_STR_PREC + (begp[0] == '-') <= len) {
    +      --fmt[sizeof(fmt) - 3];  /* %.16g(%.8g) -> %.15g(%.7g) */
    +      str = mrb_float_to_str(mrb, flt, fmt);
    +      goto insert_dot_zero;
    +    }
    +    else {
    +      mrb_str_cat(mrb, str, ".0", 2);
    +    }
    +
    +    return str;
    +  }
     }
    @@ -2653,8 +2697,6 @@

    #to_iInteger - #to_intInteger - #truncateInteger @@ -2682,37 +2724,6 @@

    - - -
    - -

    Returns:

    - - -
    - - - - - -
  • - #to_intInteger -
    -
    - - -
    @@ -2778,23 +2789,23 @@

     
     
    -672
    -673
    -674
    -675
    -676
    -677
    -678
    -679
    -680
    -681
    -682
    -683
    -684
    -685
    +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751

  • -
    # File 'src/numeric.c', line 672
    +      
    # File 'src/numeric.c', line 738
     
     static mrb_value
     flo_truncate(mrb_state *mrb, mrb_value num)
    @@ -2830,10 +2841,10 @@ 

     
     
    -950
    +1015

    -
    # File 'src/numeric.c', line 950
    +      
    # File 'src/numeric.c', line 1015
     
     static mrb_value flo_or(mrb_state *mrb, mrb_value x);
    @@ -2868,17 +2879,17 @@

     
     
    -363
    -364
    -365
    -366
    -367
    -368
    -369
    -370
    +430 +431 +432 +433 +434 +435 +436 +437

    -
    # File 'src/numeric.c', line 363
    +      
    # File 'src/numeric.c', line 430
     
     static mrb_value
     flo_rev(mrb_state *mrb, mrb_value x)
    @@ -2898,9 +2909,9 @@ 

    diff --git a/docs/api/FloatDomainError.html b/docs/api/FloatDomainError.html index 6255961..fbe92e2 100644 --- a/docs/api/FloatDomainError.html +++ b/docs/api/FloatDomainError.html @@ -6,7 +6,7 @@ Exception: FloatDomainError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -150,9 +150,9 @@

    Constructor Details

    diff --git a/docs/api/FrozenError.html b/docs/api/FrozenError.html index 2798ea0..574cd5a 100644 --- a/docs/api/FrozenError.html +++ b/docs/api/FrozenError.html @@ -6,7 +6,7 @@ Exception: FrozenError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -118,9 +118,9 @@ diff --git a/docs/api/GC.html b/docs/api/GC.html index 07e0d1a..01f696e 100644 --- a/docs/api/GC.html +++ b/docs/api/GC.html @@ -6,7 +6,7 @@ Module: GC - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -99,9 +99,9 @@ diff --git a/docs/api/Hash.html b/docs/api/Hash.html index 4ff3dc9..6dc7f92 100644 --- a/docs/api/Hash.html +++ b/docs/api/Hash.html @@ -6,7 +6,7 @@ Class: Hash - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -165,29 +165,6 @@

    call-seq: Hash[ key, value, … ] -> new_hash Hash[ [ [key, value], … ] ] -> new_hash Hash[ object ] -> new_hash.

    - - - -
  • - - - .try_convert(obj) ⇒ Object - - - - - - - - - - - - - -

    call-seq: Hash.try_convert(obj) -> hash or nil.

    -
    -
  • @@ -378,30 +355,7 @@

    -

    Deletes and returns a key-value pair from hsh whose key is equal to key.

    -
    - - - - -
  • - - - #__update(h) ⇒ Object - - - - - - - - - - - - - -
    +

    core of 15.2.13.4.8.

  • @@ -479,7 +433,7 @@

  • - #compact! ⇒ Hash + #compact! ⇒ Object @@ -493,7 +447,7 @@

    -

    Removes all nil values from the hash.

    +

    call-seq: hsh.compact! -> hsh.

  • @@ -665,29 +619,6 @@

    call-seq: hsh.dig(key,…) -> object.

    - - - -
  • - - - #dup ⇒ Object - - - - - - - - - - - - - -

    15.2.13.4.24.

    -
    -
  • @@ -910,7 +841,7 @@

    -

    Returns true if the given key is present in hsh.

    +

    15.2.13.4.13.

    @@ -919,7 +850,7 @@

  • - #has_value? ⇒ Boolean + #has_value? ⇒ Object @@ -956,7 +887,7 @@

    -

    Returns true if the given key is present in hsh.

    +

    15.2.13.4.15.

  • @@ -1106,7 +1037,7 @@

    -

    Returns true if the given key is present in hsh.

    +

    15.2.13.4.18.

    @@ -1175,7 +1106,7 @@

    -

    Returns true if the given key is present in hsh.

    +

    15.2.13.4.21.

    @@ -1239,7 +1170,7 @@

  • - #rehash ⇒ Object + #rehash ⇒ Hash @@ -1253,7 +1184,7 @@

    -

    call-seq: hsh.rehash -> hsh.

    +

    Rebuilds the hash based on the current hash values for each key.

  • @@ -1518,29 +1449,6 @@

    call-seq: hsh.to_h -> hsh or new_hash.

    - - - -
  • - - - #to_hash ⇒ Hash - - - - - - - - - - - - - -

    Returns +self+.

    -
    -
  • @@ -1694,7 +1602,7 @@

  • - #value? ⇒ Boolean + #value? ⇒ Object @@ -1773,7 +1681,7 @@

    Methods included from Enumerable

    -

    #all?, #any?, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #find_all, #find_index, #first, #flat_map, #grep, #group_by, #hash, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reverse_each, #sort, #sort_by, #take, #take_while, to_h, #uniq, #zip

    +

    #+, __update_hash, #all?, #any?, #chain, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #find_all, #find_index, #first, #flat_map, #grep, #group_by, #hash, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reverse_each, #sort, #sort_by, #take, #take_while, to_h, #uniq, #zip

    Constructor Details

    @@ -1874,31 +1782,31 @@

     
     
    -330
    -331
    -332
    -333
    -334
    -335
    -336
    -337
    -338
    -339
    -340
    -341
    -342
    -343
    -344
    -345
    -346
    -347
    -348
    -349
    -350
    -351
    +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815

  • -
    # File 'src/hash.c', line 330
    +      
    # File 'src/hash.c', line 794
     
     static mrb_value
     mrb_hash_init(mrb_state *mrb, mrb_value hash)
    @@ -2022,9 +1930,9 @@ 

    length = object.length if length == 1 o = object[0] - if o.respond_to?(:to_hash) + if Hash === o h = self.new - object[0].to_hash.each { |k, v| h[k] = v } + o.each { |k, v| h[k] = v } return h elsif o.respond_to?(:to_a) h = self.new @@ -2057,65 +1965,6 @@

    - - -
    -

    - - .try_convert(obj) ⇒ Object - - - - - -

    -
    -

    call-seq: - Hash.try_convert(obj) -> hash or nil

    - -

    Try to convert obj into a hash, using to_hash method. -Returns converted hash or nil if obj cannot be converted -for any reason.

    - -
    Hash.try_convert({1=>2})   # => {1=>2}
    -Hash.try_convert("1=>2")   # => nil
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -74
    -75
    -76
    -77
    -78
    -79
    -80
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 74
    -
    -def self.try_convert(obj)
    -  if obj.respond_to?(:to_hash)
    -    obj.to_hash
    -  else
    -    nil
    -  end
    -end
    -
    @@ -2153,6 +2002,19 @@

    +

    Raises:

    +
    @@ -2162,26 +2024,18 @@

     
     
    -302
    -303
    -304
    -305
    -306
    -307
    -308
    -309
    -310
    -311
    +312 +313 +314 +315 +316 +317

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 302
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 312
     
     def <(hash)
    -  begin
    -    hash = hash.to_hash
    -  rescue NoMethodError
    -    raise TypeError, "can't convert #{hash.class} to Hash"
    -  end
    +  raise TypeError, "can't convert #{hash.class} to Hash" unless Hash === hash
       size < hash.size and all? {|key, val|
         hash.key?(key) and hash[key] == val
       }
    @@ -2220,6 +2074,19 @@ 

    +

    Raises:

    +
    @@ -2229,26 +2096,18 @@

     
     
    -326
    -327
    -328
    -329
    -330
    -331
     332
     333
     334
    -335
    +335 +336 +337

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 326
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 332
     
     def <=(hash)
    -  begin
    -    hash = hash.to_hash
    -  rescue NoMethodError
    -    raise TypeError, "can't convert #{hash.class} to Hash"
    -  end
    +  raise TypeError, "can't convert #{hash.class} to Hash" unless Hash === hash
       size <= hash.size and all? {|key, val|
         hash.key?(key) and hash[key] == val
       }
    @@ -2301,18 +2160,14 @@ 

    21 22 23 -24 -25 -26

    +24
    # File 'mrblib/hash.rb', line 13
     
     def ==(hash)
       return true if self.equal?(hash)
    -  begin
    -    hash = hash.to_hash
    -  rescue NoMethodError
    +  unless Hash === hash
         return false
       end
       return false if self.size != hash.size
    @@ -2356,6 +2211,19 @@ 

    +

    Raises:

    +
    @@ -2365,26 +2233,18 @@

     
     
    -350
    -351
     352
     353
     354
     355
     356
    -357
    -358
    -359
    +357

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 350
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 352
     
     def >(hash)
    -  begin
    -    hash = hash.to_hash
    -  rescue NoMethodError
    -    raise TypeError, "can't convert #{hash.class} to Hash"
    -  end
    +  raise TypeError, "can't convert #{hash.class} to Hash" unless Hash === hash
       size > hash.size and hash.all? {|key, val|
         key?(key) and self[key] == val
       }
    @@ -2423,6 +2283,19 @@ 

    +

    Raises:

    +
    @@ -2432,26 +2305,18 @@

     
     
    +372
    +373
     374
     375
     376
    -377
    -378
    -379
    -380
    -381
    -382
    -383
    +377

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 374
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 372
     
     def >=(hash)
    -  begin
    -    hash = hash.to_hash
    -  rescue NoMethodError
    -    raise TypeError, "can't convert #{hash.class} to Hash"
    -  end
    +  raise TypeError, "can't convert #{hash.class} to Hash" unless Hash === hash
       size >= hash.size and hash.all? {|key, val|
         key?(key) and self[key] == val
       }
    @@ -2496,17 +2361,17 @@ 

     
     
    -367
    -368
    -369
    -370
    -371
    -372
    -373
    -374
    +831 +832 +833 +834 +835 +836 +837 +838

    -
    # File 'src/hash.c', line 367
    +      
    # File 'src/hash.c', line 831
     
     static mrb_value
     mrb_hash_aget(mrb_state *mrb, mrb_value self)
    @@ -2562,18 +2427,18 @@ 

     
     
    -669
    -670
    -671
    -672
    -673
    -674
    -675
    -676
    -677
    +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135

    -
    # File 'src/hash.c', line 669
    +      
    # File 'src/hash.c', line 1127
     
     static mrb_value
     mrb_hash_aset(mrb_state *mrb, mrb_value self)
    @@ -2592,11 +2457,7 @@ 

    - - #delete(key) ⇒ Object - - #delete(key) {|key| ... } ⇒ Object - + #__deleteObject @@ -2604,81 +2465,34 @@

    -

    Deletes and returns a key-value pair from hsh whose key is -equal to key. If the key is not found, returns the -default value. If the optional code block is given and the -key is not found, pass in the key and return the result of -block.

    - -
    h = { "a" => 100, "b" => 200 }
    -h.delete("a")                              #=> 100
    -h.delete("z")                              #=> nil
    -h.delete("z") { |el| "#{el} not found" }   #=> "z not found"
    -
    +

    core of 15.2.13.4.8

    -

    Overloads:

    -
      - - - -
    • - #delete(key) {|key| ... } ⇒ Object -
      -
      - - -
      -
      -
      - -

      Yields:

      -
        - -
      • - - - (key) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - @@ -2832,26 +2628,32 @@

     
     
    -640
    -641
    -642
    -643
    -644
    -645
    -646
    -647
    -648
    +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106

    @@ -2893,19 +2695,27 @@

     
     
    -127
    -128
    -129
    -130
    -131
    +133 +134 +135 +136 +137 +138 +139 +140 +141

    @@ -2915,7 +2725,7 @@

    - #compact!Hash + #compact!Object @@ -2923,7 +2733,11 @@

    -

    Removes all nil values from the hash. Returns the hash.

    +

    call-seq: + hsh.compact! -> hsh

    + +

    Removes all nil values from the hash. Returns the hash. +Returns nil if the hash does not contain nil values.

    h = { a: 1, b: false, c: nil } h.compact! #=> { a: 1, b: false }

    @@ -2933,33 +2747,6 @@

    -
    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Hash) - - - -
    • - -
    - -
    - - -
    @@ -2969,62 +2756,36 @@

     
     
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -61
    -62
    -63
    -64
    -65
    -66
    -67
    -68
    -69
    -70
    -71
    -72
    -73
    +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121

    -
    +
    +
    +
    +  
    +    
    +
     
     
    -572
    -573
    -574
    -575
    -576
    -577
    -578
    -579
    -580
    +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014
    -
    # File 'src/hash.c', line 572
    +      
    # File 'src/hash.c', line 1006
     
     static mrb_value
     mrb_hash_delete(mrb_state *mrb, mrb_value self)
    @@ -2692,38 +2506,6 @@ 

    - - -
    -

    - - #__update(h) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -346
    -347
    -348
    -349
    -
    -
    # File 'mrblib/hash.rb', line 346
    -
    -def __update(h)
    -  h.each_key{|k| self[k] = h[k]}
    -  self
    -end
    -
    @@ -2753,21 +2535,35 @@

     
     
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
     197
     198
     199
     200
    -201
    -202
    +201

    -
    # File 'mrblib/hash.rb', line 197
    +      
    # File 'mrblib/hash.rb', line 189
     
     def _inspect
       return "{}" if self.size == 0
    -  "{"+self.map {|k,v|
    -    k._inspect + "=>" + v._inspect
    -  }.join(", ")+"}"
    +  ary=[]
    +  keys=self.keys
    +  size=keys.size
    +  i=0
    +  while i<size
    +    k=keys[i]
    +    ary<<(k._inspect + "=>" + self[k]._inspect)
    +    i+=1
    +  end
    +  "{"+ary.join(", ")+"}"
     end
    -
    # File 'src/hash.c', line 640
    +      
    # File 'src/hash.c', line 1095
     
     MRB_API mrb_value
     mrb_hash_clear(mrb_state *mrb, mrb_value hash)
     {
    -  khash_t(ht) *h = RHASH_TBL(hash);
    +  htable *t = RHASH_TBL(hash);
     
       mrb_hash_modify(mrb, hash);
    -  if (h) kh_clear(ht, mrb, h);
    +  if (t) {
    +    ht_free(mrb, t);
    +    RHASH_TBL(hash) = NULL;
    +  }
       return hash;
     }
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 127
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 133
     
     def compact
    -  result = self.dup
    -  result.compact!
    -  result
    +  h = {}
    +  self.keys.select{|k|
    +    self[k] != nil
    +  }.each {|k|
    +    h[k] = self[k]
    +  }
    +  h
     end
    -
    # File 'mrbgems/mruby-hash-ext/src/hash-ext.c', line 48
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 109
     
    -static mrb_value
    -hash_compact_bang(mrb_state *mrb, mrb_value hash)
    -{
    -  khiter_t k;
    -  khash_t(ht) *h = RHASH_TBL(hash);
    -  mrb_int n = -1;
    -
    -  if (!h) return mrb_nil_value();
    -  for (k = kh_begin(h); k != kh_end(h); k++) {
    -    if (kh_exist(h, k)) {
    -      mrb_value val = kh_value(h, k).v;
    -      khiter_t k2;
    -
    -      if (mrb_nil_p(val)) {
    -        kh_del(ht, mrb, h, k);
    -        n = kh_value(h, k).n;
    -        for (k2 = kh_begin(h); k2 != kh_end(h); k2++) {
    -          if (!kh_exist(h, k2)) continue;
    -          if (kh_value(h, k2).n > n) kh_value(h, k2).n--;
    -        }
    -      }
    -    }
    +def compact!
    +  keys = self.keys
    +  nk = keys.select{|k|
    +    self[k] != nil
       }
    -  if (n < 0) return mrb_nil_value();
    -  return hash;
    -}
    + return nil if (keys.size == nk.size) + h = {} + nk.each {|k| + h[k] = self[k] + } + h + self.replace(h) +end
    @@ -3098,27 +2859,27 @@

     
     
    -412
    -413
    -414
    -415
    -416
    -417
    -418
    -419
    -420
    -421
    -422
    -423
    -424
    -425
    -426
    -427
    -428
    -429
    - - -
    # File 'src/hash.c', line 412
    +876
    +877
    +878
    +879
    +880
    +881
    +882
    +883
    +884
    +885
    +886
    +887
    +888
    +889
    +890
    +891
    +892
    +893
    + + +
    # File 'src/hash.c', line 876
     
     static mrb_value
     mrb_hash_default(mrb_state *mrb, mrb_value hash)
    @@ -3210,26 +2971,26 @@ 

     
     
    -452
    -453
    -454
    -455
    -456
    -457
    -458
    -459
    -460
    -461
    -462
    -463
    -464
    -465
    -466
    -467
    -468
    +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932

    -
    # File 'src/hash.c', line 452
    +      
    # File 'src/hash.c', line 916
     
     static mrb_value
     mrb_hash_set_default(mrb_state *mrb, mrb_value hash)
    @@ -3314,17 +3075,17 @@ 

     
     
    -486
    -487
    -488
    -489
    -490
    -491
    -492
    -493
    +950 +951 +952 +953 +954 +955 +956 +957

    -
    # File 'src/hash.c', line 486
    +      
    # File 'src/hash.c', line 950
     
     static mrb_value
     mrb_hash_default_proc(mrb_state *mrb, mrb_value hash)
    @@ -3399,28 +3160,28 @@ 

     
     
    -508
    -509
    -510
    -511
    -512
    -513
    -514
    -515
    -516
    -517
    -518
    -519
    -520
    -521
    -522
    -523
    -524
    -525
    -526
    - - -
    # File 'src/hash.c', line 508
    +972
    +973
    +974
    +975
    +976
    +977
    +978
    +979
    +980
    +981
    +982
    +983
    +984
    +985
    +986
    +987
    +988
    +989
    +990
    + + +
    # File 'src/hash.c', line 972
     
     static mrb_value
     mrb_hash_set_default_proc(mrb_state *mrb, mrb_value hash)
    @@ -3479,23 +3240,21 @@ 

     
     
    +52
    +53
    +54
    +55
     56
    -57
    -58
    -59
    -60
    -61
    -62
    +57

    -
    # File 'mrblib/hash.rb', line 56
    +      
    # File 'mrblib/hash.rb', line 52
     
     def delete(key, &block)
       if block && !self.has_key?(key)
    -    block.call(key)
    -  else
    -    self.__delete(key)
    +    return block.call(key)
       end
    +  self.__delete(key)
     end
    @@ -3540,17 +3299,17 @@

     
     
    -189
    -190
    -191
    -192
    -193
    -194
    -195
    -196
    +199 +200 +201 +202 +203 +204 +205 +206

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 189
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 199
     
     def delete_if(&block)
       return to_enum :delete_if unless block
    @@ -3597,17 +3356,17 @@ 

     
     
    +387
    +388
    +389
    +390
    +391
    +392
     393
    -394
    -395
    -396
    -397
    -398
    -399
    -400
    +394

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 393
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 387
     
     def dig(idx,*args)
       n = self[idx]
    @@ -3620,120 +3379,6 @@ 

    -

    - -
    -

    - - #dupObject - - - - - -

    -
    -

    15.2.13.4.24

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -228
    -229
    -230
    -231
    -232
    -233
    -234
    -235
    -236
    -237
    -238
    -239
    -240
    -241
    -242
    -243
    -244
    -245
    -246
    -247
    -248
    -249
    -250
    -251
    -252
    -253
    -254
    -255
    -256
    -257
    -258
    -259
    -260
    -261
    -262
    -263
    -264
    -265
    -266
    -
    -
    # File 'src/hash.c', line 228
    -
    -static mrb_value
    -mrb_hash_dup(mrb_state *mrb, mrb_value hash)
    -{
    -  struct RHash* ret;
    -  khash_t(ht) *h, *ret_h;
    -  khiter_t k, ret_k;
    -  mrb_value ifnone, vret;
    -
    -  h = RHASH_TBL(hash);
    -  ret = (struct RHash*)mrb_obj_alloc(mrb, MRB_TT_HASH, mrb->hash_class);
    -  ret->ht = kh_init(ht, mrb);
    -
    -  if (h && kh_size(h) > 0) {
    -    ret_h = ret->ht;
    -
    -    for (k = kh_begin(h); k != kh_end(h); k++) {
    -      if (kh_exist(h, k)) {
    -        int ai = mrb_gc_arena_save(mrb);
    -        ret_k = kh_put(ht, mrb, ret_h, KEY(kh_key(h, k)));
    -        mrb_gc_arena_restore(mrb, ai);
    -        kh_val(ret_h, ret_k).v = kh_val(h, k).v;
    -        kh_val(ret_h, ret_k).n = kh_size(ret_h)-1;
    -      }
    -    }
    -  }
    -
    -  if (MRB_RHASH_DEFAULT_P(hash)) {
    -    ret->flags |= MRB_HASH_DEFAULT;
    -  }
    -  if (MRB_RHASH_PROCDEFAULT_P(hash)) {
    -    ret->flags |= MRB_HASH_PROC_DEFAULT;
    -  }
    -  vret = mrb_obj_value(ret);
    -  ifnone = RHASH_IFNONE(hash);
    -  if (!mrb_nil_p(ifnone)) {
    -      mrb_iv_set(mrb, vret, mrb_intern_lit(mrb, "ifnone"), ifnone);
    -  }
    -  return vret;
    -}
    -
    @@ -3787,6 +3432,11 @@

     
     
    +81
    +82
    +83
    +84
    +85
     86
     87
     88
    @@ -3794,15 +3444,10 @@ 

    90 91 92 -93 -94 -95 -96 -97 -98

    +93

    -
    # File 'mrblib/hash.rb', line 86
    +      
    # File 'mrblib/hash.rb', line 81
     
     def each(&block)
       return to_enum :each unless block
    @@ -3866,15 +3511,15 @@ 

     
     
    -119
    -120
    -121
    -122
    -123
    -124
    +114 +115 +116 +117 +118 +119

    -
    # File 'mrblib/hash.rb', line 119
    +      
    # File 'mrblib/hash.rb', line 114
     
     def each_key(&block)
       return to_enum :each_key unless block
    @@ -3931,15 +3576,15 @@ 

     
     
    -145
    -146
    -147
    -148
    -149
    -150
    +140 +141 +142 +143 +144 +145

    -
    # File 'mrblib/hash.rb', line 145
    +      
    # File 'mrblib/hash.rb', line 140
     
     def each_value(&block)
       return to_enum :each_value unless block
    @@ -3999,19 +3644,6 @@ 

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -4021,25 +3653,19 @@

     
     
    -712
    -713
    -714
    -715
    -716
    -717
    -718
    -719
    +1186 +1187 +1188 +1189 +1190

    -
    # File 'src/hash.c', line 712
    +      
    # File 'src/hash.c', line 1186
     
    -MRB_API mrb_value
    -mrb_hash_empty_p(mrb_state *mrb, mrb_value self)
    +static mrb_value
    +mrb_hash_empty_m(mrb_state *mrb, mrb_value self)
     {
    -  khash_t(ht) *h = RHASH_TBL(self);
    -
    -  if (h) return mrb_bool_value(kh_size(h) == 0);
    -  return mrb_true_value();
    +  return mrb_bool_value(mrb_hash_empty_p(mrb, self));
     }
    @@ -4089,6 +3715,8 @@

     
     
    +31
    +32
     33
     34
     35
    @@ -4098,20 +3726,14 @@ 

    39 40 41 -42 -43 -44 -45 -46

    +42

    -
    # File 'mrblib/hash.rb', line 33
    +      
    # File 'mrblib/hash.rb', line 31
     
     def eql?(hash)
       return true if self.equal?(hash)
    -  begin
    -    hash = hash.to_hash
    -  rescue NoMethodError
    +  unless Hash === hash
         return false
       end
       return false if self.size != hash.size
    @@ -4180,22 +3802,22 @@ 

     
     
    -161
    -162
    -163
    -164
    -165
    -166
    -167
    -168
    -169
    -170
     171
     172
    -173
    +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 161
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 171
     
     def fetch(key, none=NONE, &block)
       unless self.key?(key)
    @@ -4254,14 +3876,14 @@ 

     
     
    -497
    -498
    -499
    -500
    -501
    +492 +493 +494 +495 +496

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 497
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 492
     
     def fetch_values(*keys, &block)
       keys.map do |k|
    @@ -4313,12 +3935,12 @@ 

     
     
    -214
    -215
    -216
    +224 +225 +226

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 214
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 224
     
     def flatten(level=1)
       self.to_a.flatten(level)
    @@ -4331,15 +3953,7 @@ 

    - - #has_key?(key) ⇒ Boolean - - #include?(key) ⇒ Boolean - - #key?(key) ⇒ Boolean - - #member?(key) ⇒ Boolean - + #has_key?Boolean @@ -4347,119 +3961,7 @@

    -

    Returns true if the given key is present in hsh.

    - -

    h = { “a” => 100, “b” => 200 } - h.has_key?(“a”) #=> true - h.has_key?(“z”) #=> false

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #has_key?(key) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #include?(key) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #key?(key) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #member?(key) ⇒ Boolean -
      -
      - +

      15.2.13.4.13

      @@ -4476,27 +3978,6 @@

      -

    • - -
    - -
    - - - - - - -

    Returns:

    -
      - -
    • - - - (Boolean) - - -
    @@ -4509,41 +3990,29 @@

     
     
    -829
    -830
    -831
    -832
    -833
    -834
    -835
    -836
    -837
    -838
    -839
    -840
    -841
    -842
    -843
    -844
    +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300

    -
    # File 'src/hash.c', line 829
    +      
    # File 'src/hash.c', line 1291
     
     static mrb_value
     mrb_hash_has_key(mrb_state *mrb, mrb_value hash)
     {
       mrb_value key;
    -  khash_t(ht) *h;
    -  khiter_t k;
    +  mrb_bool key_p;
     
       mrb_get_args(mrb, "o", &key);
    -
    -  h = RHASH_TBL(hash);
    -  if (h) {
    -    k = kh_get(ht, mrb, h, key);
    -    return mrb_bool_value(k != kh_end(h));
    -  }
    -  return mrb_false_value();
    +  key_p = mrb_hash_key_p(mrb, hash, key);
    +  return mrb_bool_value(key_p);
     }
    @@ -4644,19 +4113,6 @@

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -4666,51 +4122,33 @@

     
     
    -861
    -862
    -863
    -864
    -865
    -866
    -867
    -868
    -869
    -870
    -871
    -872
    -873
    -874
    -875
    -876
    -877
    -878
    -879
    -880
    -881
    +1334 +1335 +1336 +1337 +1338 +1339 +1340 +1341 +1342 +1343 +1344 +1345

    -
    # File 'src/hash.c', line 861
    +      
    # File 'src/hash.c', line 1334
     
     static mrb_value
     mrb_hash_has_value(mrb_state *mrb, mrb_value hash)
     {
       mrb_value val;
    -  khash_t(ht) *h;
    -  khiter_t k;
    -
    +  struct has_v_arg arg;
    +  
       mrb_get_args(mrb, "o", &val);
    -  h = RHASH_TBL(hash);
    -
    -  if (h) {
    -    for (k = kh_begin(h); k != kh_end(h); k++) {
    -      if (!kh_exist(h, k)) continue;
    -
    -      if (mrb_equal(mrb, kh_value(h, k).v, val)) {
    -        return mrb_true_value();
    -      }
    -    }
    -  }
    -  return mrb_false_value();
    +  arg.found = FALSE;
    +  arg.val = val;
    +  ht_foreach(mrb, RHASH_TBL(hash), hash_has_value_i, &arg);
    +  return mrb_bool_value(arg.found);
     }
    @@ -4720,15 +4158,7 @@

    - - #has_key?(key) ⇒ Boolean - - #include?(key) ⇒ Boolean - - #key?(key) ⇒ Boolean - - #member?(key) ⇒ Boolean - + #include?Boolean @@ -4736,26 +4166,7 @@

    -

    Returns true if the given key is present in hsh.

    - -

    h = { “a” => 100, “b” => 200 } - h.has_key?(“a”) #=> true - h.has_key?(“z”) #=> false

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #has_key?(key) ⇒ Boolean -
      -
      - +

      15.2.13.4.15

      @@ -4778,183 +4189,57 @@

      + + + + + +
      +
       
      -      
      -    
      -      
      -      
    • - #include?(key) ⇒ Boolean -
      -
      - +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300
    • +
      +
      # File 'src/hash.c', line 1291
       
      -  
      +static mrb_value
      +mrb_hash_has_key(mrb_state *mrb, mrb_value hash)
      +{
      +  mrb_value key;
      +  mrb_bool key_p;
      +
      +  mrb_get_args(mrb, "o", &key);
      +  key_p = mrb_hash_key_p(mrb, hash, key);
      +  return mrb_bool_value(key_p);
      +}
      +
    -
    - -

    Returns:

    -
      + +
      +

      -
    • - - - (Boolean) - - - -
    • + #inspectObject -

    -
    - + + Also known as: + to_s + + - - - -
  • - #key?(key) ⇒ Boolean -
    + +
  • - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - -
  • - #member?(key) ⇒ Boolean -
    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - -
  • - - - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - - - - - - - - -
    -
    -
    -
    -829
    -830
    -831
    -832
    -833
    -834
    -835
    -836
    -837
    -838
    -839
    -840
    -841
    -842
    -843
    -844
    -
    -
    # File 'src/hash.c', line 829
    -
    -static mrb_value
    -mrb_hash_has_key(mrb_state *mrb, mrb_value hash)
    -{
    -  mrb_value key;
    -  khash_t(ht) *h;
    -  khiter_t k;
    -
    -  mrb_get_args(mrb, "o", &key);
    -
    -  h = RHASH_TBL(hash);
    -  if (h) {
    -    k = kh_get(ht, mrb, h, key);
    -    return mrb_bool_value(k != kh_end(h));
    -  }
    -  return mrb_false_value();
    -}
    -
    - - -
    -

    - - #inspectObject - - - - Also known as: - to_s - - - - -

    -
    -

    ISO 15.2.13.4.30 (x)

    +

    ISO 15.2.13.4.30 (x)

    @@ -4970,16 +4255,16 @@

     
     
    +206
     207
     208
     209
     210
     211
    -212
    -213
    +212

    -
    # File 'mrblib/hash.rb', line 207
    +      
    # File 'mrblib/hash.rb', line 206
     
     def inspect
       begin
    @@ -5028,14 +4313,14 @@ 

     
     
    -229
    -230
    -231
    -232
    -233
    +239 +240 +241 +242 +243

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 229
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 239
     
     def invert
       h = self.class.new
    @@ -5081,20 +4366,20 @@ 

     
     
    -246
    -247
    -248
    -249
    -250
    -251
    -252
    -253
    -254
    -255
    -256
    +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 246
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 256
     
     def keep_if(&block)
       return to_enum :keep_if unless block
    @@ -5149,15 +4434,15 @@ 

     
     
    -271
    -272
    -273
    -274
    -275
    -276
    +281 +282 +283 +284 +285 +286

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 271
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 281
     
     def key(val)
       self.each do |k, v|
    @@ -5173,15 +4458,7 @@ 

    - - #has_key?(key) ⇒ Boolean - - #include?(key) ⇒ Boolean - - #key?(key) ⇒ Boolean - - #member?(key) ⇒ Boolean - + #key?Boolean @@ -5189,88 +4466,7 @@

    -

    Returns true if the given key is present in hsh.

    - -

    h = { “a” => 100, “b” => 200 } - h.has_key?(“a”) #=> true - h.has_key?(“z”) #=> false

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #has_key?(key) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #include?(key) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #key?(key) ⇒ Boolean -
      -
      - +

      15.2.13.4.18

      @@ -5287,58 +4483,6 @@

      -

    • - -
    - -
    - - - - - -
  • - #member?(key) ⇒ Boolean -
    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - -
  • - - - -

    Returns:

    -
      - -
    • - - - (Boolean) - - -
    @@ -5351,41 +4495,29 @@

     
     
    -829
    -830
    -831
    -832
    -833
    -834
    -835
    -836
    -837
    -838
    -839
    -840
    -841
    -842
    -843
    -844
    +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300

    -
    # File 'src/hash.c', line 829
    +      
    # File 'src/hash.c', line 1291
     
     static mrb_value
     mrb_hash_has_key(mrb_state *mrb, mrb_value hash)
     {
       mrb_value key;
    -  khash_t(ht) *h;
    -  khiter_t k;
    +  mrb_bool key_p;
     
       mrb_get_args(mrb, "o", &key);
    -
    -  h = RHASH_TBL(hash);
    -  if (h) {
    -    k = kh_get(ht, mrb, h, key);
    -    return mrb_bool_value(k != kh_end(h));
    -  }
    -  return mrb_false_value();
    +  key_p = mrb_hash_key_p(mrb, hash, key);
    +  return mrb_bool_value(key_p);
     }
    @@ -5450,66 +4582,34 @@

     
     
    -748
    -749
    -750
    -751
    -752
    -753
    -754
    -755
    -756
    -757
    -758
    -759
    -760
    -761
    -762
    -763
    -764
    -765
    -766
    -767
    -768
    -769
    -770
    -771
    -772
    -773
    -774
    -775
    -776
    +1212 +1213 +1214 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224

    -
    # File 'src/hash.c', line 748
    +      
    # File 'src/hash.c', line 1212
     
     MRB_API mrb_value
     mrb_hash_keys(mrb_state *mrb, mrb_value hash)
     {
    -  khash_t(ht) *h = RHASH_TBL(hash);
    -  khiter_t k;
    -  mrb_int end;
    +  htable *t = RHASH_TBL(hash);
    +  mrb_int size;
       mrb_value ary;
    -  mrb_value *p;
    -
    -  if (!h || kh_size(h) == 0) return mrb_ary_new(mrb);
    -  ary = mrb_ary_new_capa(mrb, kh_size(h));
    -  end = kh_size(h)-1;
    -  mrb_ary_set(mrb, ary, end, mrb_nil_value());
    -  p = RARRAY_PTR(ary);
    -  for (k = kh_begin(h); k != kh_end(h); k++) {
    -    if (kh_exist(h, k)) {
    -      mrb_value kv = kh_key(h, k);
    -      mrb_hash_value hv = kh_value(h, k);
    -
    -      if (hv.n <= end) {
    -        p[hv.n] = kv;
    -      }
    -      else {
    -        p[end] = kv;
    -      }
    -    }
    -  }
    +
    +  if (!t || (size = t->size) == 0)
    +    return mrb_ary_new(mrb);
    +  ary = mrb_ary_new_capa(mrb, size);
    +  ht_foreach(mrb, t, hash_keys_i, (void*)&ary);
       return ary;
     }
    @@ -5620,25 +4720,21 @@

     
     
    -693
    -694
    -695
    -696
    -697
    -698
    -699
    -700
    +1160 +1161 +1162 +1163 +1164 +1165

    -
    # File 'src/hash.c', line 693
    +      
    # File 'src/hash.c', line 1160
     
     static mrb_value
     mrb_hash_size_m(mrb_state *mrb, mrb_value self)
     {
    -  khash_t(ht) *h = RHASH_TBL(self);
    -
    -  if (!h) return mrb_fixnum_value(0);
    -  return mrb_fixnum_value(kh_size(h));
    +  mrb_int size = mrb_hash_size(mrb, self);
    +  return mrb_fixnum_value(size);
     }
    @@ -5648,135 +4744,15 @@

    - - #has_key?(key) ⇒ Boolean - - #include?(key) ⇒ Boolean - - #key?(key) ⇒ Boolean - - #member?(key) ⇒ Boolean - - - - - + #member?Boolean -

    -
    -

    Returns true if the given key is present in hsh.

    - -

    h = { “a” => 100, “b” => 200 } - h.has_key?(“a”) #=> true - h.has_key?(“z”) #=> false

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #has_key?(key) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #include?(key) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #key?(key) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #member?(key) ⇒ Boolean -
      + + + + +

    - +

    15.2.13.4.21

    @@ -5793,27 +4769,6 @@

    - - - - -

    - - - - - - -

    Returns:

    -
      - -
    • - - - (Boolean) - - -
    @@ -5826,41 +4781,29 @@

     
     
    -829
    -830
    -831
    -832
    -833
    -834
    -835
    -836
    -837
    -838
    -839
    -840
    -841
    -842
    -843
    -844
    +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300

    -
    # File 'src/hash.c', line 829
    +      
    # File 'src/hash.c', line 1291
     
     static mrb_value
     mrb_hash_has_key(mrb_state *mrb, mrb_value hash)
     {
       mrb_value key;
    -  khash_t(ht) *h;
    -  khiter_t k;
    +  mrb_bool key_p;
     
       mrb_get_args(mrb, "o", &key);
    -
    -  h = RHASH_TBL(hash);
    -  if (h) {
    -    k = kh_get(ht, mrb, h, key);
    -    return mrb_bool_value(k != kh_end(h));
    -  }
    -  return mrb_false_value();
    +  key_p = mrb_hash_key_p(mrb, hash, key);
    +  return mrb_bool_value(key_p);
     }
    @@ -5913,29 +4856,25 @@

     
     
    +175
    +176
    +177
    +178
    +179
    +180
     181
     182
     183
     184
     185
    -186
    -187
    -188
    -189
    -190
    -191
    -192
    -193
    -194
    +186

    -
    # File 'mrblib/hash.rb', line 181
    +      
    # File 'mrblib/hash.rb', line 175
     
     def merge(other, &block)
    -  h = {}
    -  raise TypeError, "can't convert argument into Hash" unless other.respond_to?(:to_hash)
    -  other = other.to_hash
    -  self.each_key{|k| h[k] = self[k]}
    +  raise TypeError, "Hash required (#{other.class} given)" unless Hash === other
    +  h = self.dup
       if block
         other.each_key{|k|
           h[k] = (self.has_key?(k))? block.call(k, self[k], other[k]): other[k]
    @@ -6012,23 +4951,23 @@ 

     
     
    -103
    -104
    -105
    -106
    -107
    -108
    -109
    -110
    -111
    -112
    -113
    +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 103
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 84
     
     def merge!(other, &block)
    -  raise TypeError, "can't convert argument into Hash" unless other.respond_to?(:to_hash)
    +  raise TypeError, "Hash required (#{other.class} given)" unless Hash === other
       if block
         other.each_key{|k|
           self[k] = (self.has_key?(k))? block.call(k, self[k], other[k]): other[k]
    @@ -6046,7 +4985,7 @@ 

    - #rehashObject + #rehashHash @@ -6054,26 +4993,47 @@

    -

    call-seq: - hsh.rehash -> hsh

    - -

    Rebuilds the hash based on the current hash values for each key. If - values of key objects have changed since they were inserted, this - method will reindex hsh.

    - -
    h = {"AAA" => "b"}
    -h.keys[0].chop!
    -h          #=> {"AA"=>"b"}
    -h["AA"]    #=> nil
    -h.rehash   #=> {"AA"=>"b"}
    -h["AA"]    #=> "b"
    -
    +

    Rebuilds the hash based on the current hash values for each key. If +values of key objects have changed since they were inserted, this +method will reindex hsh.

    + +

    h = => “b” + h.keys[0].chop! + h.rehash #=> “AA”=>”b” + h[“AA”] #=> “b”

    + + +
    +
    +
    + +
    +
    +
    +

    Returns:

    +
      + +
    • + + + (Hash) + + + +
    • + +
    + +
    + + +
    @@ -6083,24 +5043,22 @@

     
     
    -338
    -339
    -340
    -341
    -342
    -343
    -344
    +1389 +1390 +1391 +1392 +1393 +1394

    -
    # File 'mrblib/hash.rb', line 338
    +      
    # File 'src/hash.c', line 1389
     
    -def rehash
    -  h = {}
    -  self.each{|k,v|
    -    h[k] = v
    -  }
    -  self.replace(h)
    -end
    +static mrb_value +mrb_hash_rehash(mrb_state *mrb, mrb_value self) +{ + ht_compact(mrb, RHASH_TBL(self)); + return self; +}
    @@ -6146,6 +5104,7 @@

     
     
    +257
     258
     259
     260
    @@ -6155,11 +5114,10 @@ 

    264 265 266 -267 -268

    +267

    -
    # File 'mrblib/hash.rb', line 258
    +      
    # File 'mrblib/hash.rb', line 257
     
     def reject(&block)
       return to_enum :reject unless block
    @@ -6211,6 +5169,7 @@ 

     
     
    +226
     227
     228
     229
    @@ -6224,11 +5183,10 @@ 

    237 238 239 -240 -241

    +240

    -
    # File 'mrblib/hash.rb', line 227
    +      
    # File 'mrblib/hash.rb', line 226
     
     def reject!(&block)
       return to_enum :reject! unless block
    @@ -6296,6 +5254,11 @@ 

     
     
    +151
    +152
    +153
    +154
    +155
     156
     157
     158
    @@ -6303,21 +5266,14 @@ 

    160 161 162 -163 -164 -165 -166 -167 -168 -169

    +163

    -
    # File 'mrblib/hash.rb', line 156
    +      
    # File 'mrblib/hash.rb', line 151
     
     def replace(hash)
    -  raise TypeError, "can't convert argument into Hash" unless hash.respond_to?(:to_hash)
    +  raise TypeError, "Hash required (#{hash.class} given)" unless Hash === hash
       self.clear
    -  hash = hash.to_hash
       hash.each_key{|k|
         self[k] = hash[k]
       }
    @@ -6373,6 +5329,7 @@ 

     
     
    +310
     311
     312
     313
    @@ -6382,11 +5339,10 @@ 

    317 318 319 -320 -321

    +320

    -
    # File 'mrblib/hash.rb', line 311
    +      
    # File 'mrblib/hash.rb', line 310
     
     def select(&block)
       return to_enum :select unless block
    @@ -6438,6 +5394,7 @@ 

     
     
    +279
     280
     281
     282
    @@ -6451,11 +5408,10 @@ 

    290 291 292 -293 -294

    +293

    -
    # File 'mrblib/hash.rb', line 280
    +      
    # File 'mrblib/hash.rb', line 279
     
     def select!(&block)
       return to_enum :select! unless block
    @@ -6538,60 +5494,48 @@ 

     
     
    -596
    -597
    -598
    -599
    -600
    -601
    -602
    -603
    -604
    -605
    -606
    -607
    -608
    -609
    -610
    -611
    -612
    -613
    -614
    -615
    -616
    -617
    -618
    -619
    -620
    -621
    -622
    -623
    -624
    -625
    -626
    - - -
    # File 'src/hash.c', line 596
    +1057
    +1058
    +1059
    +1060
    +1061
    +1062
    +1063
    +1064
    +1065
    +1066
    +1067
    +1068
    +1069
    +1070
    +1071
    +1072
    +1073
    +1074
    +1075
    +1076
    +1077
    +1078
    +1079
    +1080
    +1081
    + + +
    # File 'src/hash.c', line 1057
     
     static mrb_value
     mrb_hash_shift(mrb_state *mrb, mrb_value hash)
     {
    -  khash_t(ht) *h = RHASH_TBL(hash);
    -  khiter_t k;
    -  mrb_value delKey, delVal;
    +  htable *t = RHASH_TBL(hash);
     
       mrb_hash_modify(mrb, hash);
    -  if (h && kh_size(h) > 0) {
    -    for (k = kh_begin(h); k != kh_end(h); k++) {
    -      if (!kh_exist(h, k)) continue;
    +  if (t && t->size > 0) {
    +    mrb_value del_key, del_val;
     
    -      delKey = kh_key(h, k);
    -      mrb_gc_protect(mrb, delKey);
    -      delVal = mrb_hash_delete_key(mrb, hash, delKey);
    -      mrb_gc_protect(mrb, delVal);
    -
    -      return mrb_assoc_new(mrb, delKey, delVal);
    -    }
    +    ht_shift(mrb, t, &del_key, &del_val);
    +    mrb_gc_protect(mrb, del_key);
    +    mrb_gc_protect(mrb, del_val);
    +    return mrb_assoc_new(mrb, del_key, del_val);
       }
     
       if (MRB_RHASH_DEFAULT_P(hash)) {
    @@ -6712,25 +5656,21 @@ 

     
     
    -693
    -694
    -695
    -696
    -697
    -698
    -699
    -700
    +1160 +1161 +1162 +1163 +1164 +1165

    -
    # File 'src/hash.c', line 693
    +      
    # File 'src/hash.c', line 1160
     
     static mrb_value
     mrb_hash_size_m(mrb_state *mrb, mrb_value self)
     {
    -  khash_t(ht) *h = RHASH_TBL(self);
    -
    -  if (!h) return mrb_fixnum_value(0);
    -  return mrb_fixnum_value(kh_size(h));
    +  mrb_int size = mrb_hash_size(mrb, self);
    +  return mrb_fixnum_value(size);
     }
    @@ -6795,63 +5735,51 @@

     
     
    -85
    -86
    -87
    -88
    -89
    -90
    -91
    -92
    -93
    -94
    -95
    -96
    -97
    -98
    -99
    -100
    -101
    -102
    -103
    -104
    -105
    -106
    -107
    -108
    -109
    -110
    -111
    -112
    +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70

    -
    # File 'mrbgems/mruby-hash-ext/src/hash-ext.c', line 85
    +      
    # File 'mrbgems/mruby-hash-ext/src/hash-ext.c', line 49
     
     static mrb_value
     hash_slice(mrb_state *mrb, mrb_value hash)
     {
    -  khash_t(ht) *h = RHASH_TBL(hash);
       mrb_value *argv, result;
       mrb_int argc, i;
    -  khiter_t k;
    -  int ai;
     
       mrb_get_args(mrb, "*", &argv, &argc);
    -  if (argc == 0 || h == NULL) {
    +  if (argc == 0) {
         return mrb_hash_new_capa(mrb, argc);
       }
       result = mrb_hash_new_capa(mrb, argc);
    -  ai = mrb_gc_arena_save(mrb);
       for (i = 0; i < argc; i++) {
         mrb_value key = argv[i];
    +    mrb_value val;
     
    -    k = kh_get(ht, mrb, h, key);
    -    if (k != kh_end(h)) {
    -      mrb_value val = kh_value(h, k).v;
    -
    +    val = mrb_hash_fetch(mrb, hash, key, mrb_undef_value());
    +    if (!mrb_undef_p(val)) {
           mrb_hash_set(mrb, result, key, val);
         }
    -    mrb_gc_arena_restore(mrb, ai);
       }
       return result;
     }
    @@ -6901,18 +5829,18 @@

     
     
    -669
    -670
    -671
    -672
    -673
    -674
    -675
    -676
    -677
    +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135

    -
    # File 'src/hash.c', line 669
    +      
    # File 'src/hash.c', line 1127
     
     static mrb_value
     mrb_hash_aset(mrb_state *mrb, mrb_value self)
    @@ -6959,12 +5887,12 @@ 

     
     
    -285
    -286
    -287
    +295 +296 +297

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 285
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 295
     
     def to_h
       self
    @@ -6972,79 +5900,6 @@ 

    - - -
    -

    - - #to_hashHash - - - - - -

    -
    -

    Returns +self+.

    - - -
    -
    -
    - -
    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Hash) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -729
    -730
    -731
    -732
    -733
    -
    -
    # File 'src/hash.c', line 729
    -
    -static mrb_value
    -mrb_hash_to_hash(mrb_state *mrb, mrb_value hash)
    -{
    -  return hash;
    -}
    -
    @@ -7062,12 +5917,12 @@

     
     
    -478
    -479
    -480
    +473 +474 +475

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 478
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 473
     
     def to_proc
       ->x{self[x]}
    @@ -7111,18 +5966,18 @@ 

     
     
    +406
    +407
    +408
    +409
    +410
    +411
     412
     413
    -414
    -415
    -416
    -417
    -418
    -419
    -420
    +414

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 412
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 406
     
     def transform_keys(&block)
       return to_enum :transform_keys unless block
    @@ -7172,27 +6027,27 @@ 

     
     
    +425
    +426
    +427
    +428
    +429
    +430
     431
     432
     433
    -434
    -435
    -436
    -437
    -438
    -439
    -440
    +434

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 431
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 425
     
     def transform_keys!(&block)
       return to_enum :transform_keys! unless block
       self.keys.each do |k|
         value = self[k]
    -    new_key = block.call(k)
         self.__delete(k)
    -    self[new_key] = value
    +    k = block.call(k) if block
    +    self[k] = value
       end
       self
     end
    @@ -7236,17 +6091,17 @@

     
     
    +446
    +447
    +448
    +449
    +450
    +451
     452
    -453
    -454
    -455
    -456
    -457
    -458
    -459
    +453

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 452
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 446
     
     def transform_values(&b)
       return to_enum :transform_values unless block_given?
    @@ -7295,16 +6150,16 @@ 

     
     
    +465
    +466
    +467
    +468
    +469
     470
    -471
    -472
    -473
    -474
    -475
    -476
    +471

    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 470
    +      
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 465
     
     def transform_values!(&b)
       return to_enum :transform_values! unless block_given?
    @@ -7412,19 +6267,6 @@ 

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -7434,51 +6276,33 @@

     
     
    -861
    -862
    -863
    -864
    -865
    -866
    -867
    -868
    -869
    -870
    -871
    -872
    -873
    -874
    -875
    -876
    -877
    -878
    -879
    -880
    -881
    +1334 +1335 +1336 +1337 +1338 +1339 +1340 +1341 +1342 +1343 +1344 +1345

    -
    # File 'src/hash.c', line 861
    +      
    # File 'src/hash.c', line 1334
     
     static mrb_value
     mrb_hash_has_value(mrb_state *mrb, mrb_value hash)
     {
       mrb_value val;
    -  khash_t(ht) *h;
    -  khiter_t k;
    -
    +  struct has_v_arg arg;
    +  
       mrb_get_args(mrb, "o", &val);
    -  h = RHASH_TBL(hash);
    -
    -  if (h) {
    -    for (k = kh_begin(h); k != kh_end(h); k++) {
    -      if (!kh_exist(h, k)) continue;
    -
    -      if (mrb_equal(mrb, kh_value(h, k).v, val)) {
    -        return mrb_true_value();
    -      }
    -    }
    -  }
    -  return mrb_false_value();
    +  arg.found = FALSE;
    +  arg.val = val;
    +  ht_foreach(mrb, RHASH_TBL(hash), hash_has_value_i, &arg);
    +  return mrb_bool_value(arg.found);
     }
    @@ -7543,44 +6367,34 @@

     
     
    -791
    -792
    -793
    -794
    -795
    -796
    -797
    -798
    -799
    -800
    -801
    -802
    -803
    -804
    -805
    -806
    -807
    -808
    +1246 +1247 +1248 +1249 +1250 +1251 +1252 +1253 +1254 +1255 +1256 +1257 +1258

    -
    # File 'src/hash.c', line 791
    +      
    # File 'src/hash.c', line 1246
     
     MRB_API mrb_value
     mrb_hash_values(mrb_state *mrb, mrb_value hash)
     {
    -  khash_t(ht) *h = RHASH_TBL(hash);
    -  khiter_t k;
    +  htable *t = RHASH_TBL(hash);
    +  mrb_int size;
       mrb_value ary;
     
    -  if (!h) return mrb_ary_new(mrb);
    -  ary = mrb_ary_new_capa(mrb, kh_size(h));
    -  for (k = kh_begin(h); k != kh_end(h); k++) {
    -    if (kh_exist(h, k)) {
    -      mrb_hash_value hv = kh_value(h, k);
    -
    -      mrb_ary_set(mrb, ary, hv.n, hv.v);
    -    }
    -  }
    +  if (!t || (size = t->size) == 0)
    +    return mrb_ary_new(mrb);
    +  ary = mrb_ary_new_capa(mrb, size);
    +  ht_foreach(mrb, t, hash_vals_i, (void*)&ary);
       return ary;
     }
    @@ -7692,9 +6506,9 @@

    diff --git a/docs/api/IO.html b/docs/api/IO.html index 3003983..2c281f1 100644 --- a/docs/api/IO.html +++ b/docs/api/IO.html @@ -6,7 +6,7 @@ Class: IO - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -110,30 +110,36 @@

    Direct Known Subclasses

    BasicSocket, File

    -

    Constant Summary

    -
    - -
    SEEK_SET = - -
    -
    0
    - -
    SEEK_CUR = - -
    -
    1
    - -
    SEEK_END = - -
    -
    2
    - -
    BUF_SIZE = - -
    -
    4096
    - -
    + +

    + Constant Summary + collapse +

    + +
    + +
    SEEK_SET = + +
    +
    0
    + +
    SEEK_CUR = + +
    +
    1
    + +
    SEEK_END = + +
    +
    2
    + +
    BUF_SIZE = + +
    +
    4096
    + +
    + @@ -1171,16 +1177,6 @@

     
     
    -603
    -604
    -605
    -606
    -607
    -608
    -609
    -610
    -611
    -612
     613
     614
     615
    @@ -1208,10 +1204,20 @@ 

    637 638 639 -640

    +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650

    -
    # File 'mrbgems/mruby-io/src/io.c', line 603
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 613
     
     mrb_value
     mrb_io_initialize(mrb_state *mrb, mrb_value io)
    @@ -1600,18 +1606,18 @@ 

     
     
    -705
    -706
    -707
    -708
    -709
    -710
    -711
    -712
    -713
    +715 +716 +717 +718 +719 +720 +721 +722 +723

    -
    # File 'mrbgems/mruby-io/src/io.c', line 705
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 715
     
     mrb_value
     mrb_io_check_readable(mrb_state *mrb, mrb_value self)
    @@ -1686,17 +1692,17 @@ 

     
     
    -924
    -925
    -926
    -927
    -928
    -929
    -930
    -931
    +934 +935 +936 +937 +938 +939 +940 +941

    -
    # File 'mrbgems/mruby-io/src/io.c', line 924
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 934
     
     mrb_value
     mrb_io_close(mrb_state *mrb, mrb_value self)
    @@ -1726,16 +1732,6 @@ 

     
     
    -1236
    -1237
    -1238
    -1239
    -1240
    -1241
    -1242
    -1243
    -1244
    -1245
     1246
     1247
     1248
    @@ -1760,10 +1756,20 @@ 

    1267 1268 1269 -1270

    +1270 +1271 +1272 +1273 +1274 +1275 +1276 +1277 +1278 +1279 +1280

    -
    # File 'mrbgems/mruby-io/src/io.c', line 1236
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 1246
     
     mrb_value
     mrb_io_set_close_on_exec(mrb_state *mrb, mrb_value self)
    @@ -1845,16 +1851,6 @@ 

     
     
    -1212
    -1213
    -1214
    -1215
    -1216
    -1217
    -1218
    -1219
    -1220
    -1221
     1222
     1223
     1224
    @@ -1867,10 +1863,20 @@ 

    1231 1232 1233 -1234

    +1234 +1235 +1236 +1237 +1238 +1239 +1240 +1241 +1242 +1243 +1244

    -
    # File 'mrbgems/mruby-io/src/io.c', line 1212
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 1222
     
     mrb_value
     mrb_io_close_on_exec_p(mrb_state *mrb, mrb_value self)
    @@ -1927,19 +1933,19 @@ 

     
     
    -933
    -934
    -935
    -936
    -937
    -938
    -939
    -940
    -941
    -942
    +943 +944 +945 +946 +947 +948 +949 +950 +951 +952

    -
    # File 'mrbgems/mruby-io/src/io.c', line 933
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 943
     
     mrb_value
     mrb_io_close_write(mrb_state *mrb, mrb_value self)
    @@ -1996,27 +2002,27 @@ 

     
     
    -944
    -945
    -946
    -947
    -948
    -949
    -950
    -951
    -952
    -953
    -954
    +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964

    -
    # File 'mrbgems/mruby-io/src/io.c', line 944
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 954
     
     mrb_value
     mrb_io_closed(mrb_state *mrb, mrb_value io)
     {
       struct mrb_io *fptr;
       fptr = (struct mrb_io *)mrb_get_datatype(mrb, io, &mrb_io_type);
    -  if (fptr->fd >= 0) {
    +  if (fptr == NULL || fptr->fd >= 0) {
         return mrb_false_value();
       }
     
    @@ -2233,22 +2239,22 @@ 

     
     
    -1204
    -1205
    -1206
    -1207
    -1208
    -1209
    -1210
    +1214 +1215 +1216 +1217 +1218 +1219 +1220

    -
    # File 'mrbgems/mruby-io/src/io.c', line 1204
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 1214
     
     mrb_value
     mrb_io_fileno(mrb_state *mrb, mrb_value io)
     {
       struct mrb_io *fptr;
    -  fptr = (struct mrb_io *)mrb_get_datatype(mrb, io, &mrb_io_type);
    +  fptr = io_get_open_fptr(mrb, io);
       return mrb_fixnum_value(fptr->fd);
     }
    @@ -2452,16 +2458,6 @@

     
     
    -554
    -555
    -556
    -557
    -558
    -559
    -560
    -561
    -562
    -563
     564
     565
     566
    @@ -2499,10 +2495,20 @@ 

    598 599 600 -601

    +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611

    -
    # File 'mrbgems/mruby-io/src/io.c', line 554
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 564
     
     mrb_value
     mrb_io_initialize_copy(mrb_state *mrb, mrb_value copy)
    @@ -2576,19 +2582,19 @@ 

     
     
    -715
    -716
    -717
    -718
    -719
    -720
    -721
    -722
    -723
    -724
    +725 +726 +727 +728 +729 +730 +731 +732 +733 +734

    -
    # File 'mrbgems/mruby-io/src/io.c', line 715
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 725
     
     mrb_value
     mrb_io_isatty(mrb_state *mrb, mrb_value self)
    @@ -2632,27 +2638,27 @@ 

     
     
    -956
    -957
    -958
    -959
    -960
    -961
    -962
    -963
    -964
    -965
     966
    -967
    +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977

    -
    # File 'mrbgems/mruby-io/src/io.c', line 956
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 966
     
     mrb_value
     mrb_io_pid(mrb_state *mrb, mrb_value io)
     {
       struct mrb_io *fptr;
    -  fptr = (struct mrb_io *)mrb_get_datatype(mrb, io, &mrb_io_type);
    +  fptr = io_get_open_fptr(mrb, io);
     
       if (fptr->pid > 0) {
         return mrb_fixnum_value(fptr->pid);
    @@ -3280,16 +3286,16 @@ 

     
     
    -1284
    -1285
    -1286
    -1287
    -1288
    -1289
    -1290
    +1294 +1295 +1296 +1297 +1298 +1299 +1300

    -
    # File 'mrbgems/mruby-io/src/io.c', line 1284
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 1294
     
     mrb_value
     mrb_io_sync(mrb_state *mrb, mrb_value self)
    @@ -3318,20 +3324,20 @@ 

     
     
    -1272
    -1273
    -1274
    -1275
    -1276
    -1277
    -1278
    -1279
    -1280
    -1281
    -1282
    +1282 +1283 +1284 +1285 +1286 +1287 +1288 +1289 +1290 +1291 +1292

    -
    # File 'mrbgems/mruby-io/src/io.c', line 1272
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 1282
     
     mrb_value
     mrb_io_set_sync(mrb_state *mrb, mrb_value self)
    @@ -3364,16 +3370,6 @@ 

     
     
    -812
    -813
    -814
    -815
    -816
    -817
    -818
    -819
    -820
    -821
     822
     823
     824
    @@ -3414,10 +3410,20 @@ 

    859 860 861 -862

    +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872

    -
    # File 'mrbgems/mruby-io/src/io.c', line 812
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 822
     
     mrb_value
     mrb_io_sysread(mrb_state *mrb, mrb_value io)
    @@ -3490,16 +3496,6 @@ 

     
     
    -864
    -865
    -866
    -867
    -868
    -869
    -870
    -871
    -872
    -873
     874
     875
     876
    @@ -3516,10 +3512,20 @@ 

    887 888 889 -890

    +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900

    -
    # File 'mrbgems/mruby-io/src/io.c', line 864
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 874
     
     mrb_value
     mrb_io_sysseek(mrb_state *mrb, mrb_value io)
    @@ -3533,7 +3539,7 @@ 

    whence = 0; } - fptr = (struct mrb_io *)mrb_get_datatype(mrb, io, &mrb_io_type); + fptr = io_get_open_fptr(mrb, io); pos = lseek(fptr->fd, (off_t)offset, (int)whence); if (pos == -1) { mrb_sys_fail(mrb, "sysseek"); @@ -3568,16 +3574,6 @@

     
     
    -892
    -893
    -894
    -895
    -896
    -897
    -898
    -899
    -900
    -901
     902
     903
     904
    @@ -3598,10 +3594,20 @@ 

    919 920 921 -922

    +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932

    -
    # File 'mrbgems/mruby-io/src/io.c', line 892
    +      
    # File 'mrbgems/mruby-io/src/io.c', line 902
     
     mrb_value
     mrb_io_syswrite(mrb_state *mrb, mrb_value io)
    @@ -3610,7 +3616,7 @@ 

    mrb_value str, buf; int fd, length; - fptr = (struct mrb_io *)mrb_get_datatype(mrb, io, &mrb_io_type); + fptr = io_get_open_fptr(mrb, io); if (! fptr->writable) { mrb_raise(mrb, E_IO_ERROR, "not opened for writing"); } @@ -3730,9 +3736,9 @@

    diff --git a/docs/api/IOError.html b/docs/api/IOError.html index 54b5bc0..a45f331 100644 --- a/docs/api/IOError.html +++ b/docs/api/IOError.html @@ -6,7 +6,7 @@ Exception: IOError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -158,9 +158,9 @@

    Constructor Details

    diff --git a/docs/api/IPSocket.html b/docs/api/IPSocket.html index c95090e..dc38e9b 100644 --- a/docs/api/IPSocket.html +++ b/docs/api/IPSocket.html @@ -6,7 +6,7 @@ Class: IPSocket - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -400,20 +400,6 @@

     
     
    -543
    -544
    -545
    -546
    -547
    -548
    -549
    -550
    -551
    -552
    -553
    -554
    -555
    -556
     557
     558
     559
    @@ -426,10 +412,24 @@ 

    566 567 568 -569

    +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583

    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 543
    +      
    # File 'mrbgems/mruby-socket/src/socket.c', line 557
     
     static mrb_value
     mrb_ipsocket_recvfrom(mrb_state *mrb, mrb_value self)
    @@ -468,9 +468,9 @@ 

    diff --git a/docs/api/IndexError.html b/docs/api/IndexError.html index be59661..d4d530a 100644 --- a/docs/api/IndexError.html +++ b/docs/api/IndexError.html @@ -6,7 +6,7 @@ Exception: IndexError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -158,9 +158,9 @@

    Constructor Details

    diff --git a/docs/api/Integer.html b/docs/api/Integer.html index 60fbce0..18c8309 100644 --- a/docs/api/Integer.html +++ b/docs/api/Integer.html @@ -6,7 +6,7 @@ Class: Integer - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -196,7 +196,7 @@

  • - #to_i ⇒ Object + #to_i ⇒ Integer @@ -219,7 +219,7 @@

  • - #to_int ⇒ Object + #to_i ⇒ Integer @@ -263,7 +263,7 @@

    Methods included from Methods inherited from Numeric

    -

    #**, #+@, #-@, #/, #<, #<=, #<=>, #>, #>=, #abs, #finite?, #infinite?, #quo

    +

    #**, #+@, #-@, #/, #<, #<=, #<=>, #>, #>=, #__coerce_step_counter, #abs, #finite?, #infinite?, #quo

    @@ -310,14 +310,14 @@

     
     
    -712
    -713
    -714
    -715
    -716
    +777 +778 +779 +780 +781

  • -
    # File 'src/numeric.c', line 712
    +      
    # File 'src/numeric.c', line 777
     
     static mrb_value
     int_to_i(mrb_state *mrb, mrb_value num)
    @@ -362,14 +362,14 @@ 

     
     
    -712
    -713
    -714
    -715
    -716
    +777 +778 +779 +780 +781

    -
    # File 'src/numeric.c', line 712
    +      
    # File 'src/numeric.c', line 777
     
     static mrb_value
     int_to_i(mrb_state *mrb, mrb_value num)
    @@ -384,11 +384,7 @@ 

    - - #to_iInteger - - #to_intInteger - + #to_iInteger @@ -404,13 +400,7 @@

    -

    Overloads:

    -
      - - -
    • - #to_iInteger -
      +
      @@ -436,40 +426,6 @@

      -
    • - - -
    • - #to_intInteger -
      -
      - - - -
      -
      -
      - -

      Returns:

      - - -
      - - -
    • - -
    @@ -480,14 +436,14 @@

     
     
    -712
    -713
    -714
    -715
    -716
    +777 +778 +779 +780 +781

    -
    # File 'src/numeric.c', line 712
    +      
    # File 'src/numeric.c', line 777
     
     static mrb_value
     int_to_i(mrb_state *mrb, mrb_value num)
    @@ -502,11 +458,7 @@ 

    - - #to_iInteger - - #to_intInteger - + #to_iInteger @@ -522,13 +474,7 @@

    -

    Overloads:

    -
      - - -
    • - #to_iInteger -
      +
      @@ -554,40 +500,6 @@

      -
    • - - -
    • - #to_intInteger -
      -
      - - - -
      -
      -
      - -

      Returns:

      - - -
      - - -
    • - -
    @@ -598,14 +510,14 @@

     
     
    -712
    -713
    -714
    -715
    -716
    +777 +778 +779 +780 +781

    -
    # File 'src/numeric.c', line 712
    +      
    # File 'src/numeric.c', line 777
     
     static mrb_value
     int_to_i(mrb_state *mrb, mrb_value num)
    @@ -622,9 +534,9 @@ 

    diff --git a/docs/api/Integral.html b/docs/api/Integral.html index e030faa..4685f92 100644 --- a/docs/api/Integral.html +++ b/docs/api/Integral.html @@ -6,7 +6,7 @@ Module: Integral - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -80,7 +80,7 @@
    Included in:
    -
    Float, Integer
    +
    Integer
    @@ -88,7 +88,7 @@
    Defined in:
    mrblib/numeric.rb,
    - mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb
    + src/numeric.c,
    mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb
    @@ -749,11 +749,11 @@

    raise ArgumentError, "step can't be 0" if step == 0 return to_enum(:step, num, step) unless block - i = if class_defined?("Float") && num.kind_of?(Float) then self.to_f else self end + i = __coerce_step_counter(num, step) if num == nil while true block.call(i) - i+=step + i += step end return self end @@ -952,9 +952,9 @@

    diff --git a/docs/api/Kernel.html b/docs/api/Kernel.html index aa22d33..bb0b872 100644 --- a/docs/api/Kernel.html +++ b/docs/api/Kernel.html @@ -6,7 +6,7 @@ Module: Kernel - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -135,7 +135,7 @@

    -

    Returns +arg+ as an Array.

    +

    Returns +arg+ as an Array using to_a method.

    @@ -227,7 +227,7 @@

    -

    Converts arg to a Hash by calling arg.to_hash.

    +

    Returns a Hash if arg is a Hash.

    @@ -429,7 +429,7 @@

  • - #_inspect ⇒ Object + #__to_int ⇒ Object @@ -443,7 +443,7 @@

    -

    internal method for inspect.

    +

    internal.

  • @@ -452,7 +452,7 @@

  • - #`(cmd) ⇒ Object + #__to_str ⇒ Object @@ -466,7 +466,7 @@

    -

    15.3.1.2.1 Kernel. provided by Kernel# 15.3.1.3.5.

    +

    internal.

  • @@ -475,7 +475,7 @@

  • - #block_given? ⇒ Boolean + #_inspect ⇒ Object @@ -489,7 +489,7 @@

    -

    Returns true if yield would execute a block in the current context.

    +

    internal method for inspect.

  • @@ -498,7 +498,7 @@

  • - #class ⇒ Class + #`(cmd) ⇒ Object @@ -512,7 +512,30 @@

    -

    Returns the class of obj.

    +

    15.3.1.2.1 Kernel. provided by Kernel# 15.3.1.3.3.

    +
    + +

  • + + +
  • + + + #block_given? ⇒ Object + + + + + + + + + + + + + +

    Returns true if yield would execute a block in the current context.

  • @@ -521,7 +544,7 @@

  • - #class_defined? ⇒ Boolean + #class ⇒ Class @@ -535,7 +558,7 @@

    -

    not reached.

    +

    Returns the class of obj.

  • @@ -613,7 +636,7 @@

  • - #eql? ⇒ Boolean + #eql? ⇒ Object @@ -636,7 +659,7 @@

  • - #equal? ⇒ Boolean + #equal? ⇒ Object @@ -797,7 +820,7 @@

  • - #global_variables ⇒ Object + #global_variables ⇒ Array @@ -811,7 +834,7 @@

    -

    15.3.1.3.14.

    +

    Returns an array of the names of global variables.

  • @@ -981,7 +1004,7 @@

  • - #instance_variables ⇒ Object + #instance_variables ⇒ Array @@ -995,7 +1018,7 @@

    -

    15.3.1.3.23.

    +

    Returns an array of instance variable names for the receiver.

  • @@ -1004,7 +1027,7 @@

  • - #is_a? ⇒ Boolean + #is_a? ⇒ Object @@ -1027,7 +1050,7 @@

  • - #iterator? ⇒ Boolean + #iterator? ⇒ Object @@ -1050,7 +1073,7 @@

  • - #kind_of? ⇒ Boolean + #kind_of? ⇒ Object @@ -1501,7 +1524,7 @@

    -

    15.3.1.2.12.

    +

    15.3.1.3.28.

  • @@ -1556,7 +1579,7 @@

  • - #sprintf(*args) ⇒ Object + #sprintf ⇒ Object @@ -1639,6 +1662,8 @@

    + (also: #then) + @@ -1653,7 +1678,8 @@

    call-seq: obj.yield_self _obj - … -> an_object. + … -> an_object obj.then _obj + … -> an_object. @@ -1699,21 +1725,21 @@

     
     
    -996
    -997
    -998
    -999
    -1000
    -1001
    -1002
    -1003
    -1004
    -1005
    -1006
    -1007
    +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731

  • -
    # File 'src/kernel.c', line 996
    +      
    # File 'src/kernel.c', line 720
     
     static mrb_value
     mrb_obj_missing(mrb_state *mrb, mrb_value mod)
    @@ -1750,9 +1776,7 @@ 

    -

    Returns +arg+ as an Array.

    - -

    First tries to call Array#to_ary on +arg+, then Array#to_a.

    +

    Returns +arg+ as an Array using to_a method.

    Array(1..5) #=> [1, 2, 3, 4, 5]

    @@ -1797,25 +1821,22 @@

     
     
    +169
    +170
    +171
    +172
    +173
    +174
    +175
     176
     177
     178
     179
     180
    -181
    -182
    -183
    -184
    -185
    -186
    -187
    -188
    -189
    -190
    -191
    +181

    -
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 176
    +      
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 169
     
     static mrb_value
     mrb_f_array(mrb_state *mrb, mrb_value self)
    @@ -1823,10 +1844,7 @@ 

    mrb_value arg, tmp; mrb_get_args(mrb, "o", &arg); - tmp = mrb_check_convert_type(mrb, arg, MRB_TT_ARRAY, "Array", "to_ary"); - if (mrb_nil_p(tmp)) { - tmp = mrb_check_convert_type(mrb, arg, MRB_TT_ARRAY, "Array", "to_a"); - } + tmp = mrb_check_convert_type(mrb, arg, MRB_TT_ARRAY, "Array", "to_a"); if (mrb_nil_p(tmp)) { return mrb_ary_new_from_values(mrb, 1, &arg); } @@ -2018,35 +2036,35 @@

     
     
    -882
    -883
    -884
    -885
    -886
    -887
    -888
    -889
    -890
    -891
    -892
    -893
    -894
    -895
    -896
    -897
    -898
    -899
    -900
    -901
    -902
    -903
    -904
    -905
    -906
    -907
    - - -
    # File 'src/kernel.c', line 882
    +616
    +617
    +618
    +619
    +620
    +621
    +622
    +623
    +624
    +625
    +626
    +627
    +628
    +629
    +630
    +631
    +632
    +633
    +634
    +635
    +636
    +637
    +638
    +639
    +640
    +641
    + + +
    # File 'src/kernel.c', line 616
     
     MRB_API mrb_value
     mrb_f_raise(mrb_state *mrb, mrb_value self)
    @@ -2139,17 +2157,17 @@ 

     
     
    +129
     130
     131
     132
     133
     134
     135
    -136
    -137
    +136

    -
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 130
    +      
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 129
     
     static mrb_value
     mrb_f_float(mrb_state *mrb, mrb_value self)
    @@ -2175,9 +2193,9 @@ 

    -

    Converts arg to a Hash by calling -arg.to_hash. Returns an empty Hash when -arg is nil or [].

    +

    Returns a Hash if arg is a Hash. +Returns an empty Hash when arg is nil +or [].

    Hash([])          #=> {}
     Hash(nil)         #=> {}
    @@ -2226,47 +2244,31 @@ 

     
     
    -207
    -208
    -209
    -210
    -211
    -212
    -213
    -214
    -215
    -216
    -217
    -218
    -219
    -220
    -221
    -222
    -223
    -224
    -225
    +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207

    -
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 207
    +      
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 197
     
     static mrb_value
     mrb_f_hash(mrb_state *mrb, mrb_value self)
     {
    -  mrb_value arg, tmp;
    +  mrb_value arg;
     
       mrb_get_args(mrb, "o", &arg);
    -  if (mrb_nil_p(arg)) {
    +  if (mrb_nil_p(arg) || (mrb_array_p(arg) && RARRAY_LEN(arg) == 0)) {
         return mrb_hash_new(mrb);
       }
    -  tmp = mrb_check_convert_type(mrb, arg, MRB_TT_HASH, "Hash", "to_hash");
    -  if (mrb_nil_p(tmp)) {
    -    if (mrb_array_p(arg) && RARRAY_LEN(arg) == 0) {
    -      return mrb_hash_new(mrb);
    -    }
    -    mrb_raisef(mrb, E_TYPE_ERROR, "can't convert %S into Hash",
    -      mrb_str_new_cstr(mrb, mrb_obj_classname(mrb, arg)));
    -  }
    -  return tmp;
    +  return mrb_ensure_hash_type(mrb, arg);
     }
    @@ -2292,9 +2294,8 @@

    (0, 0b, and 0x) are honored. In any case, strings should be strictly conformed to numeric representation. This behavior is different from that of -String#to_i. Non string values will be converted using -to_int, and to_i. Passing nil -raises a TypeError.

    +String#to_i. Non string values will be treated as integers. +Passing nil raises a TypeError.

    Integer(123.999) #=> 123 Integer(“0x1a”) #=> 26 @@ -2344,6 +2345,7 @@

     
     
    +106
     107
     108
     109
    @@ -2351,11 +2353,10 @@ 

    111 112 113 -114 -115

    +114

    -
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 107
    +      
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 106
     
     static mrb_value
     mrb_f_integer(mrb_state *mrb, mrb_value self)
    @@ -2429,14 +2430,14 @@ 

     
     
    -237
    -238
    -239
    -240
    -241
    +219 +220 +221 +222 +223

    -
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 237
    +      
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 219
     
     static mrb_value
     mrb_f_itself(mrb_state *mrb, mrb_value self)
    @@ -2459,9 +2460,8 @@ 

    -

    Returns arg as an String.

    - -

    First tries to call its to_str method, then its to_s method.

    +

    Returns arg as an String. +converted using to_s method.

    String(self) #=> “main” String(self.class) #=> “Object” @@ -2508,21 +2508,18 @@

     
     
    +150
    +151
     152
     153
     154
     155
     156
     157
    -158
    -159
    -160
    -161
    -162
    -163
    +158

    -
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 152
    +      
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 150
     
     static mrb_value
     mrb_f_string(mrb_state *mrb, mrb_value self)
    @@ -2530,10 +2527,7 @@ 

    mrb_value arg, tmp; mrb_get_args(mrb, "o", &arg); - tmp = mrb_check_convert_type(mrb, arg, MRB_TT_STRING, "String", "to_str"); - if (mrb_nil_p(tmp)) { - tmp = mrb_check_convert_type(mrb, arg, MRB_TT_STRING, "String", "to_s"); - } + tmp = mrb_convert_type(mrb, arg, MRB_TT_STRING, "String", "to_s"); return tmp; }

    @@ -2645,17 +2639,17 @@

     
     
    -84
    -85
    -86
    -87
    -88
    -89
    -90
    -91
    +71 +72 +73 +74 +75 +76 +77 +78

    -
    # File 'src/kernel.c', line 84
    +      
    # File 'src/kernel.c', line 71
     
     static mrb_value
     mrb_equal_m(mrb_state *mrb, mrb_value self)
    @@ -2697,25 +2691,25 @@ 

     
     
    -1142
    -1143
    -1144
    -1145
    -1146
    -1147
    -1148
    -1149
    -1150
    -1151
    -1152
    -1153
    -1154
    -1155
    -1156
    -1157
    +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792

    -
    # File 'src/kernel.c', line 1142
    +      
    # File 'src/kernel.c', line 777
     
     static mrb_value
     mrb_obj_ceqq(mrb_state *mrb, mrb_value self)
    @@ -2825,6 +2819,7 @@ 

     
     
    +41
     42
     43
     44
    @@ -2833,11 +2828,10 @@ 

    47 48 49 -50 -51

    +50

    -
    # File 'mrbgems/mruby-print/src/print.c', line 42
    +      
    # File 'mrbgems/mruby-print/src/print.c', line 41
     
     mrb_value
     mrb_printstr(mrb_state *mrb, mrb_value self)
    @@ -2852,6 +2846,54 @@ 

    +

    + +
    +

    + + #__to_intObject + + + + + +

    +
    +

    internal

    + + +
    +
    +
    + + +
    + + +
    + +
    +

    + + #__to_strObject + + + + + +

    +
    +

    internal

    + + +
    +
    +
    + + +
    + +
    @@ -2909,7 +2951,7 @@

    15.3.1.2.1 Kernel. provided by Kernel# -15.3.1.3.5

    +15.3.1.3.3

    @@ -3055,19 +3097,6 @@

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -

    @@ -3077,6 +3106,19 @@

     
     
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
     140
     141
     142
    @@ -3117,23 +3159,10 @@ 

    177 178 179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193

    - - -
    # File 'src/kernel.c', line 140
    +180
    + + +
    # File 'src/kernel.c', line 127
     
     static mrb_value
     mrb_f_block_given_p_m(mrb_state *mrb, mrb_value self)
    @@ -3253,14 +3282,14 @@ 

     
     
    -207
    -208
    -209
    -210
    -211
    +194 +195 +196 +197 +198

    -
    # File 'src/kernel.c', line 207
    +      
    # File 'src/kernel.c', line 194
     
     static mrb_value
     mrb_obj_class_m(mrb_state *mrb, mrb_value self)
    @@ -3270,71 +3299,6 @@ 

    -

    - -
    -

    - - #class_defined?Boolean - - - - - -

    -
    -

    not reached

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -909
    -910
    -911
    -912
    -913
    -914
    -915
    -916
    -
    -
    # File 'src/kernel.c', line 909
    -
    -static mrb_value
    -mrb_krn_class_defined(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value str;
    -
    -  mrb_get_args(mrb, "S", &str);
    -  return mrb_bool_value(mrb_class_defined(mrb, RSTRING_PTR(str)));
    -}
    -
    @@ -3410,6 +3374,14 @@

     
     
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
     329
     330
     331
    @@ -3422,17 +3394,10 @@ 

    338 339 340 -341 -342 -343 -344 -345 -346 -347 -348

    +341

    -
    # File 'src/kernel.c', line 329
    +      
    # File 'src/kernel.c', line 321
     
     MRB_API mrb_value
     mrb_obj_clone(mrb_state *mrb, mrb_value self)
    @@ -3451,6 +3416,7 @@ 

    mrb_field_write_barrier(mrb, (struct RBasic*)p, (struct RBasic*)p->c); clone = mrb_obj_value(p); init_copy(mrb, clone, self); + p->flags |= mrb_obj_ptr(self)->flags & MRB_FL_OBJ_IS_FROZEN; return clone; }

    @@ -3486,28 +3452,28 @@

     
     
    -1122
    -1123
    -1124
    -1125
    -1126
    -1127
    -1128
    -1129
    -1130
    -1131
    -1132
    -1133
    -1134
    -1135
    -1136
    -1137
    -1138
    -1139
    -1140
    - - -
    # File 'src/kernel.c', line 1122
    +383
    +384
    +385
    +386
    +387
    +388
    +389
    +390
    +391
    +392
    +393
    +394
    +395
    +396
    +397
    +398
    +399
    +400
    +401
    + + +
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 383
     
     static mrb_value
     mod_define_singleton_method(mrb_state *mrb, mrb_value self)
    @@ -3598,6 +3564,13 @@ 

     
     
    +362
    +363
    +364
    +365
    +366
    +367
    +368
     369
     370
     371
    @@ -3608,17 +3581,10 @@ 

    376 377 378 -379 -380 -381 -382 -383 -384 -385 -386

    +379

    -
    # File 'src/kernel.c', line 369
    +      
    # File 'src/kernel.c', line 362
     
     MRB_API mrb_value
     mrb_obj_dup(mrb_state *mrb, mrb_value obj)
    @@ -3785,19 +3751,6 @@ 

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -3807,17 +3760,17 @@

     
     
    -1705
    -1706
    -1707
    -1708
    -1709
    -1710
    -1711
    -1712
    +1636 +1637 +1638 +1639 +1640 +1641 +1642 +1643

    -
    # File 'src/class.c', line 1705
    +      
    # File 'src/class.c', line 1636
     
     mrb_value
     mrb_obj_equal_m(mrb_state *mrb, mrb_value self)
    @@ -3974,19 +3927,6 @@ 

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -3996,17 +3936,17 @@

     
     
    -1705
    -1706
    -1707
    -1708
    -1709
    -1710
    -1711
    -1712
    +1636 +1637 +1638 +1639 +1640 +1641 +1642 +1643

    -
    # File 'src/class.c', line 1705
    +      
    # File 'src/class.c', line 1636
     
     mrb_value
     mrb_obj_equal_m(mrb_state *mrb, mrb_value self)
    @@ -4093,18 +4033,18 @@ 

     
     
    +424
    +425
    +426
    +427
    +428
    +429
    +430
     431
    -432
    -433
    -434
    -435
    -436
    -437
    -438
    -439
    +432

    -
    # File 'src/kernel.c', line 431
    +      
    # File 'src/kernel.c', line 424
     
     static mrb_value
     mrb_obj_extend_m(mrb_state *mrb, mrb_value self)
    @@ -4185,6 +4125,13 @@ 

     
     
    +434
    +435
    +436
    +437
    +438
    +439
    +440
     441
     442
     443
    @@ -4201,17 +4148,10 @@ 

    454 455 456 -457 -458 -459 -460 -461 -462 -463 -464

    +457

    -
    # File 'src/kernel.c', line 441
    +      
    # File 'src/kernel.c', line 434
     
     static mrb_value
     mrb_obj_freeze(mrb_state *mrb, mrb_value self)
    @@ -4282,6 +4222,13 @@ 

     
     
    +459
    +460
    +461
    +462
    +463
    +464
    +465
     466
     467
     468
    @@ -4298,17 +4245,10 @@ 

    479 480 481 -482 -483 -484 -485 -486 -487 -488 -489

    +482

    -
    # File 'src/kernel.c', line 466
    +      
    # File 'src/kernel.c', line 459
     
     static mrb_value
     mrb_obj_frozen(mrb_state *mrb, mrb_value self)
    @@ -4402,7 +4342,7 @@ 

    - #global_variablesObject + #global_variablesArray @@ -4410,17 +4350,92 @@

    -

    15.3.1.3.14

    +

    Returns an array of the names of global variables.

    + +

    global_variables.grep /std/ #=> [:$stdin, :$stdout, :$stderr]

    + + +
    +
    +
    + +
    +
    +
    +

    Returns:

    +
      + +
    • + + + (Array) + + + +
    • + +
    + +
    + + +
    + + + + + +
    +
     
    +
    +960
    +961
    +962
    +963
    +964
    +965
    +966
    +967
    +968
    +969
    +970
    +971
    +972
    +973
    +974
    +975
    +976
    +
    +
    # File 'src/variable.c', line 960
    +
    +mrb_value
    +mrb_f_global_variables(mrb_state *mrb, mrb_value self)
    +{
    +  iv_tbl *t = mrb->globals;
    +  mrb_value ary = mrb_ary_new(mrb);
    +  size_t i;
    +  char buf[3];
    +
    +  iv_foreach(mrb, t, gv_i, &ary);
    +  buf[0] = '$';
    +  buf[2] = 0;
    +  for (i = 1; i <= 9; ++i) {
    +    buf[1] = (char)(i + '0');
    +    mrb_ary_push(mrb, ary, mrb_symbol_value(mrb_intern(mrb, buf, 2)));
    +  }
    +  return ary;
    +}
    +
    @@ -4481,16 +4496,16 @@

     
     
    -502
    -503
    -504
    -505
    -506
    +495 +496 +497 +498 +499

    -
    # File 'src/kernel.c', line 502
    +      
    # File 'src/kernel.c', line 495
     
    -MRB_API mrb_value
    +static mrb_value
     mrb_obj_hash(mrb_state *mrb, mrb_value self)
     {
       return mrb_fixnum_value(mrb_obj_id(self));
    @@ -4527,21 +4542,21 @@ 

     
     
    +502
    +503
    +504
    +505
    +506
    +507
    +508
     509
     510
     511
     512
    -513
    -514
    -515
    -516
    -517
    -518
    -519
    -520
    +513

    -
    # File 'src/kernel.c', line 509
    +      
    # File 'src/kernel.c', line 502
     
     static mrb_value
     mrb_obj_init_copy(mrb_state *mrb, mrb_value self)
    @@ -4621,17 +4636,17 @@ 

     
     
    -66
    -67
    -68
    -69
    -70
    -71
    -72
    -73
    +53 +54 +55 +56 +57 +58 +59 +60

    -
    # File 'src/kernel.c', line 66
    +      
    # File 'src/kernel.c', line 53
     
     MRB_API mrb_value
     mrb_obj_inspect(mrb_state *mrb, mrb_value obj)
    @@ -4692,19 +4707,6 @@ 

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -4714,18 +4716,18 @@

     
     
    +531
    +532
    +533
    +534
    +535
    +536
    +537
     538
    -539
    -540
    -541
    -542
    -543
    -544
    -545
    -546
    +539

    -
    # File 'src/kernel.c', line 538
    +      
    # File 'src/kernel.c', line 531
     
     static mrb_value
     obj_is_instance_of(mrb_state *mrb, mrb_value self)
    @@ -4797,19 +4799,6 @@ 

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -4819,18 +4808,18 @@

     
     
    -566
    -567
    -568
    -569
    -570
    -571
    -572
    -573
    -574
    +47 +48 +49 +50 +51 +52 +53 +54 +55

    -
    # File 'src/kernel.c', line 566
    +      
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 47
     
     static mrb_value
     mrb_obj_ivar_defined(mrb_state *mrb, mrb_value self)
    @@ -4838,7 +4827,7 @@ 

    mrb_sym sym; mrb_get_args(mrb, "n", &sym); - mrb_iv_check(mrb, sym); + mrb_iv_name_sym_check(mrb, sym); return mrb_bool_value(mrb_iv_defined(mrb, self, sym)); }

    @@ -4913,18 +4902,18 @@

     
     
    -596
    -597
    -598
    -599
    -600
    -601
    -602
    -603
    -604
    +77 +78 +79 +80 +81 +82 +83 +84 +85

    -
    # File 'src/kernel.c', line 596
    +      
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 77
     
     static mrb_value
     mrb_obj_ivar_get(mrb_state *mrb, mrb_value self)
    @@ -4932,7 +4921,7 @@ 

    mrb_sym iv_name; mrb_get_args(mrb, "n", &iv_name); - mrb_iv_check(mrb, iv_name); + mrb_iv_name_sym_check(mrb, iv_name); return mrb_iv_get(mrb, self, iv_name); }

    @@ -5007,20 +4996,20 @@

     
     
    -626
    -627
    -628
    -629
    -630
    -631
    -632
    -633
    -634
    -635
    -636
    +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117

    -
    # File 'src/kernel.c', line 626
    +      
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 107
     
     static mrb_value
     mrb_obj_ivar_set(mrb_state *mrb, mrb_value self)
    @@ -5029,7 +5018,7 @@ 

    mrb_value val; mrb_get_args(mrb, "no", &iv_name, &val); - mrb_iv_check(mrb, iv_name); + mrb_iv_name_sym_check(mrb, iv_name); mrb_iv_set(mrb, self, iv_name, val); return val; }

    @@ -5041,7 +5030,7 @@

    - #instance_variablesObject + #instance_variablesArray @@ -5049,17 +5038,88 @@

    -

    15.3.1.3.23

    +

    Returns an array of instance variable names for the receiver. Note +that simply defining an accessor does not create the corresponding +instance variable.

    + +

    class Fred + attr_accessor :a1 + def initialize + @iv = 3 + end + end + Fred.new.instance_variables #=> [:@iv]

    + + +
    +
    +
    + +
    +
    +
    +

    Returns:

    +
      + +
    • + + + (Array) + + + +
    • + +
    + + +
    + + + + + + +
    +
    +
    +
    +566
    +567
    +568
    +569
    +570
    +571
    +572
    +573
    +574
    +575
    +576
    +
    +
    # File 'src/variable.c', line 566
    +
    +mrb_value
    +mrb_obj_instance_variables(mrb_state *mrb, mrb_value self)
    +{
    +  mrb_value ary;
    +
    +  ary = mrb_ary_new(mrb);
    +  if (obj_iv_p(self)) {
    +    iv_foreach(mrb, mrb_obj_ptr(self)->iv, iv_i, &ary);
    +  }
    +  return ary;
    +}
    +
    @@ -5169,19 +5229,6 @@

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -

    @@ -5191,18 +5238,18 @@

     
     
    -665
    -666
    -667
    -668
    -669
    -670
    -671
    -672
    -673
    +568 +569 +570 +571 +572 +573 +574 +575 +576

    -
    # File 'src/kernel.c', line 665
    +      
    # File 'src/kernel.c', line 568
     
     static mrb_value
     mrb_obj_is_kind_of_m(mrb_state *mrb, mrb_value self)
    @@ -5320,19 +5367,6 @@ 

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -5342,6 +5376,19 @@

     
     
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
     140
     141
     142
    @@ -5382,23 +5429,10 @@ 

    177 178 179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193

    - - -
    # File 'src/kernel.c', line 140
    +180
    + + +
    # File 'src/kernel.c', line 127
     
     static mrb_value
     mrb_f_block_given_p_m(mrb_state *mrb, mrb_value self)
    @@ -5566,19 +5600,6 @@ 

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -5588,18 +5609,18 @@

     
     
    -665
    -666
    -667
    -668
    -669
    -670
    -671
    -672
    -673
    +568 +569 +570 +571 +572 +573 +574 +575 +576

    -
    # File 'src/kernel.c', line 665
    +      
    # File 'src/kernel.c', line 568
     
     static mrb_value
     mrb_obj_is_kind_of_m(mrb_state *mrb, mrb_value self)
    @@ -5674,40 +5695,48 @@ 

     
     
    -1171
    -1172
    -1173
    -1174
    -1175
    -1176
    -1177
    -1178
    -1179
    -1180
    -1181
    -1182
    -1183
    -1184
    -1185
    -1186
    -1187
    -1188
    -1189
    -1190
    -1191
    -1192
    -1193
    -1194
    -1195
    -1196
    -1197
    -1198
    -1199
    -1200
    -1201
    - - -
    # File 'src/kernel.c', line 1171
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    + + +
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 131
     
     static mrb_value
     mrb_local_variables(mrb_state *mrb, mrb_value self)
    @@ -5729,7 +5758,15 @@ 

    if (!irep->lv) break; for (i = 0; i + 1 < irep->nlocals; ++i) { if (irep->lv[i].name) { - mrb_hash_set(mrb, vars, mrb_symbol_value(irep->lv[i].name), mrb_true_value()); + mrb_sym sym = irep->lv[i].name; + const char *name = mrb_sym2name(mrb, sym); + switch (name[0]) { + case '*': case '&': + break; + default: + mrb_hash_set(mrb, vars, mrb_symbol_value(sym), mrb_true_value()); + break; + } } } if (!MRB_PROC_ENV_P(proc)) break; @@ -5867,16 +5904,16 @@

     
     
    -788
    -789
    -790
    -791
    -792
    -793
    -794
    +251 +252 +253 +254 +255 +256 +257

    -
    # File 'src/kernel.c', line 788
    +      
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 251
     
     static mrb_value
     mrb_obj_methods_m(mrb_state *mrb, mrb_value self)
    @@ -5935,15 +5972,37 @@ 

     
     
    -804
    -805
    -806
    -807
    -808
    +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593

    -
    # File 'src/kernel.c', line 804
    -
    +      
    # File 'src/kernel.c', line 578
    +
    +KHASH_DECLARE(st, mrb_sym, char, FALSE)
    +KHASH_DEFINE(st, mrb_sym, char, FALSE, kh_int_hash_func, kh_int_hash_equal)
    +
    +/* 15.3.1.3.32 */
    +/*
    + * call_seq:
    + *   nil.nil?               -> true
    + *   <anything_else>.nil?   -> false
    + *
    + * Only the object <i>nil</i> responds <code>true</code> to <code>nil?</code>.
    + */
     static mrb_value
     mrb_false(mrb_state *mrb, mrb_value self)
     {
    @@ -5990,14 +6049,14 @@ 

     
     
    -110
    -111
    -112
    -113
    -114
    +97 +98 +99 +100 +101

    -
    # File 'src/kernel.c', line 110
    +      
    # File 'src/kernel.c', line 97
     
     mrb_value
     mrb_obj_id_m(mrb_state *mrb, mrb_value self)
    @@ -6127,7 +6186,7 @@ 

    __printstr__ "\n" i += 1 end - args[0] + args.__svalue end

    @@ -6289,16 +6348,16 @@

     
     
    -819
    -820
    -821
    -822
    -823
    -824
    -825
    +268 +269 +270 +271 +272 +273 +274

    -
    # File 'src/kernel.c', line 819
    +      
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 268
     
     static mrb_value
     mrb_obj_private_methods(mrb_state *mrb, mrb_value self)
    @@ -6368,16 +6427,16 @@ 

     
     
    -836
    -837
    -838
    -839
    -840
    -841
    -842
    +285 +286 +287 +288 +289 +290 +291

    -
    # File 'src/kernel.c', line 836
    +      
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 285
     
     static mrb_value
     mrb_obj_protected_methods(mrb_state *mrb, mrb_value self)
    @@ -6447,16 +6506,16 @@ 

     
     
    -853
    -854
    -855
    -856
    -857
    -858
    -859
    +302 +303 +304 +305 +306 +307 +308

    -
    # File 'src/kernel.c', line 853
    +      
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 302
     
     static mrb_value
     mrb_obj_public_methods(mrb_state *mrb, mrb_value self)
    @@ -6558,35 +6617,35 @@ 

     
     
    -882
    -883
    -884
    -885
    -886
    -887
    -888
    -889
    -890
    -891
    -892
    -893
    -894
    -895
    -896
    -897
    -898
    -899
    -900
    -901
    -902
    -903
    -904
    -905
    -906
    -907
    - - -
    # File 'src/kernel.c', line 882
    +616
    +617
    +618
    +619
    +620
    +621
    +622
    +623
    +624
    +625
    +626
    +627
    +628
    +629
    +630
    +631
    +632
    +633
    +634
    +635
    +636
    +637
    +638
    +639
    +640
    +641
    + + +
    # File 'src/kernel.c', line 616
     
     MRB_API mrb_value
     mrb_f_raise(mrb_state *mrb, mrb_value self)
    @@ -6688,23 +6747,23 @@ 

     
     
    -941
    -942
    -943
    -944
    -945
    -946
    -947
    -948
    -949
    -950
    -951
    -952
    -953
    -954
    +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678

    -
    # File 'src/kernel.c', line 941
    +      
    # File 'src/kernel.c', line 665
     
     static mrb_value
     mrb_obj_remove_instance_variable(mrb_state *mrb, mrb_value self)
    @@ -6713,7 +6772,7 @@ 

    mrb_value val; mrb_get_args(mrb, "n", &sym); - mrb_iv_check(mrb, sym); + mrb_iv_name_sym_check(mrb, sym); val = mrb_iv_remove(mrb, self, sym); if (mrb_undef_p(val)) { mrb_name_error(mrb, sym, "instance variable %S not defined", mrb_sym2str(mrb, sym)); @@ -6779,19 +6838,6 @@

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -6801,101 +6847,43 @@

     
     
    -1031
    -1032
    -1033
    -1034
    -1035
    -1036
    -1037
    -1038
    -1039
    -1040
    -1041
    -1042
    -1043
    -1044
    -1045
    -1046
    -1047
    -1048
    -1049
    -1050
    -1051
    -1052
    -1053
    -1054
    -1055
    -1056
    -1057
    -1058
    -1059
    -1060
    -1061
    -1062
    -1063
    -1064
    -1065
    -1066
    -1067
    -1068
    -1069
    -1070
    -1071
    -1072
    -1073
    -1074
    -1075
    -1076
    -1077
    -1078
    -1079
    - - -
    # File 'src/kernel.c', line 1031
    +756
    +757
    +758
    +759
    +760
    +761
    +762
    +763
    +764
    +765
    +766
    +767
    +768
    +769
    +770
    +771
    +772
    +773
    +774
    +775
    + + +
    # File 'src/kernel.c', line 756
     
     static mrb_value
     obj_respond_to(mrb_state *mrb, mrb_value self)
     {
    -  mrb_value mid;
       mrb_sym id, rtm_id;
    -  mrb_bool priv = FALSE, respond_to_p = TRUE;
    -
    -  mrb_get_args(mrb, "o|b", &mid, &priv);
    -
    -  if (mrb_symbol_p(mid)) {
    -    id = mrb_symbol(mid);
    -  }
    -  else {
    -    mrb_value tmp;
    -    if (mrb_string_p(mid)) {
    -      tmp = mrb_check_intern_str(mrb, mid);
    -    }
    -    else {
    -      tmp = mrb_check_string_type(mrb, mid);
    -      if (mrb_nil_p(tmp)) {
    -        tmp = mrb_inspect(mrb, mid);
    -        mrb_raisef(mrb, E_TYPE_ERROR, "%S is not a symbol", tmp);
    -      }
    -      tmp = mrb_check_intern_str(mrb, tmp);
    -    }
    -    if (mrb_nil_p(tmp)) {
    -      respond_to_p = FALSE;
    -    }
    -    else {
    -      id = mrb_symbol(tmp);
    -    }
    -  }
    -
    -  if (respond_to_p) {
    -    respond_to_p = basic_obj_respond_to(mrb, self, id, !priv);
    -  }
    +  mrb_bool priv = FALSE, respond_to_p;
     
    +  mrb_get_args(mrb, "n|b", &id, &priv);
    +  respond_to_p = basic_obj_respond_to(mrb, self, id, !priv);
       if (!respond_to_p) {
         rtm_id = mrb_intern_lit(mrb, "respond_to_missing?");
         if (basic_obj_respond_to(mrb, self, rtm_id, !priv)) {
           mrb_value args[2], v;
    -      args[0] = mid;
    +      args[0] = mrb_symbol_value(id);
           args[1] = mrb_bool_value(priv);
           v = mrb_funcall_argv(mrb, self, rtm_id, 2, args);
           return mrb_bool_value(mrb_bool(v));
    @@ -7016,33 +7004,6 @@ 

     
     
    -569
    -570
    -571
    -572
    -573
    -574
    -575
    -576
    -577
    -578
    -579
    -580
    -581
    -582
    -583
    -584
    -585
    -586
    -587
    -588
    -589
    -590
    -591
    -592
    -593
    -594
    -595
     596
     597
     598
    @@ -7060,12 +7021,39 @@ 

    610 611 612 -613

    +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640

    -
    # File 'src/vm.c', line 569
    +      
    # File 'src/vm.c', line 596
     
    -MRB_API mrb_value
    +mrb_value
     mrb_f_send(mrb_state *mrb, mrb_value self)
     {
       mrb_sym name;
    @@ -7126,7 +7114,7 @@ 

    -

    15.3.1.2.12

    +

    15.3.1.3.28

    @@ -7142,37 +7130,37 @@

     
     
    -1301
    -1302
    -1303
    -1304
    -1305
    -1306
    -1307
    -1308
    -1309
    -1310
    -1311
    -1312
    -1313
    -1314
    -1315
    -1316
    -1317
    -1318
    -1319
    -1320
    -1321
    -1322
    -1323
    -1324
    -1325
    -1326
    -1327
    -1328
    - - -
    # File 'src/class.c', line 1301
    +1232
    +1233
    +1234
    +1235
    +1236
    +1237
    +1238
    +1239
    +1240
    +1241
    +1242
    +1243
    +1244
    +1245
    +1246
    +1247
    +1248
    +1249
    +1250
    +1251
    +1252
    +1253
    +1254
    +1255
    +1256
    +1257
    +1258
    +1259
    + + +
    # File 'src/class.c', line 1232
     
     MRB_API mrb_value
     mrb_singleton_class(mrb_state *mrb, mrb_value v)
    @@ -7228,15 +7216,17 @@ 

    5 6 7 -8

    +8 +9

    # File 'mrbgems/mruby-method/mrblib/kernel.rb', line 2
     
     def singleton_method(name)
       m = method(name)
    -  if m.owner != singleton_class
    -    raise NameError, "undefined method `#{name}' for class `#{singleton_class}'"
    +  sc = (class <<self; self; end)
    +  if m.owner != sc
    +    raise NameError, "undefined method '#{name}' for class '#{sc}'"
       end
       m
     end
    @@ -7325,16 +7315,16 @@

     
     
    -1114
    -1115
    -1116
    -1117
    -1118
    -1119
    -1120
    +375 +376 +377 +378 +379 +380 +381

    -
    # File 'src/kernel.c', line 1114
    +      
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 375
     
     static mrb_value
     mrb_obj_singleton_methods_m(mrb_state *mrb, mrb_value self)
    @@ -7351,7 +7341,7 @@ 

    - #sprintf(*args) ⇒ Object + #sprintfObject @@ -7366,19 +7356,6 @@

    -

    Raises:

    -
    @@ -7482,12 +7459,12 @@

     
     
    +615
     616
    -617
    -618
    +617

    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 616
    +      
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 615
     
     def to_enum(*a)
       raise NotImplementedError.new("fiber required for enumerator")
    @@ -7528,12 +7505,17 @@ 

    + Also known as: + then + +

    call-seq: - obj.yield_self {|_obj|…} -> an_object

    + obj.yield_self {|_obj|…} -> an_object + obj.then {|_obj|…} -> an_object

    Yields obj and returns the result.

    @@ -7560,13 +7542,13 @@

     
     
    -9
     10
     11
    -12
    +12 +13

    -
    # File 'mrbgems/mruby-kernel-ext/mrblib/kernel.rb', line 9
    +      
    # File 'mrbgems/mruby-kernel-ext/mrblib/kernel.rb', line 10
     
     def yield_self(&block)
       return to_enum :yield_self unless block
    @@ -7582,9 +7564,9 @@ 

    diff --git a/docs/api/KeyError.html b/docs/api/KeyError.html index dee1e99..2d4e0e7 100644 --- a/docs/api/KeyError.html +++ b/docs/api/KeyError.html @@ -6,7 +6,7 @@ Exception: KeyError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -150,9 +150,9 @@

    Constructor Details

    diff --git a/docs/api/LocalJumpError.html b/docs/api/LocalJumpError.html index 5db1b2d..7c9d790 100644 --- a/docs/api/LocalJumpError.html +++ b/docs/api/LocalJumpError.html @@ -6,7 +6,7 @@ Exception: LocalJumpError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -154,9 +154,9 @@

    Constructor Details

    diff --git a/docs/api/Math.html b/docs/api/Math.html index d046468..bfcb186 100644 --- a/docs/api/Math.html +++ b/docs/api/Math.html @@ -6,7 +6,7 @@ Module: Math - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -717,9 +717,6 @@

     
     
    -262
    -263
    -264
     265
     266
     267
    @@ -729,10 +726,13 @@ 

    271 272 273 -274

    +274 +275 +276 +277

    -
    # File 'mrbgems/mruby-math/src/math.c', line 262
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 265
     
     static mrb_value
     math_acos(mrb_state *mrb, mrb_value obj)
    @@ -806,9 +806,6 @@ 

     
     
    -410
    -411
    -412
     413
     414
     415
    @@ -818,10 +815,13 @@ 

    419 420 421 -422

    +422 +423 +424 +425

    -
    # File 'mrbgems/mruby-math/src/math.c', line 410
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 413
     
     static mrb_value
     math_acosh(mrb_state *mrb, mrb_value obj)
    @@ -912,9 +912,6 @@ 

     
     
    -242
    -243
    -244
     245
     246
     247
    @@ -924,10 +921,13 @@ 

    251 252 253 -254

    +254 +255 +256 +257

    -
    # File 'mrbgems/mruby-math/src/math.c', line 242
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 245
     
     static mrb_value
     math_asin(mrb_state *mrb, mrb_value obj)
    @@ -1001,9 +1001,6 @@ 

     
     
    -392
    -393
    -394
     395
     396
     397
    @@ -1011,10 +1008,13 @@ 

    399 400 401 -402

    +402 +403 +404 +405

    -
    # File 'mrbgems/mruby-math/src/math.c', line 392
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 395
     
     static mrb_value
     math_asinh(mrb_state *mrb, mrb_value obj)
    @@ -1086,19 +1086,19 @@ 

     
     
    -282
    -283
    -284
     285
     286
     287
     288
     289
     290
    -291
    +291 +292 +293 +294

    -
    # File 'mrbgems/mruby-math/src/math.c', line 282
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 285
     
     static mrb_value
     math_atan(mrb_state *mrb, mrb_value obj)
    @@ -1181,19 +1181,19 @@ 

     
     
    -312
    -313
    -314
     315
     316
     317
     318
     319
     320
    -321
    +321 +322 +323 +324

    -
    # File 'mrbgems/mruby-math/src/math.c', line 312
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 315
     
     static mrb_value
     math_atan2(mrb_state *mrb, mrb_value obj)
    @@ -1264,9 +1264,6 @@ 

     
     
    -430
    -431
    -432
     433
     434
     435
    @@ -1276,10 +1273,13 @@ 

    439 440 441 -442

    +442 +443 +444 +445

    -
    # File 'mrbgems/mruby-math/src/math.c', line 430
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 433
     
     static mrb_value
     math_atanh(mrb_state *mrb, mrb_value obj)
    @@ -1377,19 +1377,19 @@ 

     
     
    -609
    -610
    -611
     612
     613
     614
     615
     616
     617
    -618
    +618 +619 +620 +621

    -
    # File 'mrbgems/mruby-math/src/math.c', line 609
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 612
     
     static mrb_value
     math_cbrt(mrb_state *mrb, mrb_value obj)
    @@ -1461,19 +1461,19 @@ 

     
     
    -203
    -204
    -205
     206
     207
     208
     209
     210
     211
    -212
    +212 +213 +214 +215

    -
    # File 'mrbgems/mruby-math/src/math.c', line 203
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 206
     
     static mrb_value
     math_cos(mrb_state *mrb, mrb_value obj)
    @@ -1544,19 +1544,19 @@ 

     
     
    -352
    -353
    -354
     355
     356
     357
     358
     359
     360
    -361
    +361 +362 +363 +364

    -
    # File 'mrbgems/mruby-math/src/math.c', line 352
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 355
     
     static mrb_value
     math_cosh(mrb_state *mrb, mrb_value obj)
    @@ -1627,19 +1627,19 @@ 

     
     
    -691
    -692
    -693
     694
     695
     696
     697
     698
     699
    -700
    +700 +701 +702 +703

    -
    # File 'mrbgems/mruby-math/src/math.c', line 691
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 694
     
     static mrb_value
     math_erf(mrb_state *mrb, mrb_value obj)
    @@ -1710,19 +1710,19 @@ 

     
     
    -709
    -710
    -711
     712
     713
     714
     715
     716
     717
    -718
    +718 +719 +720 +721

    -
    # File 'mrbgems/mruby-math/src/math.c', line 709
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 712
     
     static mrb_value
     math_erfc(mrb_state *mrb, mrb_value obj)
    @@ -1797,19 +1797,19 @@ 

     
     
    -459
    -460
    -461
     462
     463
     464
     465
     466
     467
    -468
    +468 +469 +470 +471

    -
    # File 'mrbgems/mruby-math/src/math.c', line 459
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 462
     
     static mrb_value
     math_exp(mrb_state *mrb, mrb_value obj)
    @@ -1885,9 +1885,6 @@ 

     
     
    -632
    -633
    -634
     635
     636
     637
    @@ -1895,10 +1892,13 @@ 

    639 640 641 -642

    +642 +643 +644 +645

    -
    # File 'mrbgems/mruby-math/src/math.c', line 632
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 635
     
     static mrb_value
     math_frexp(mrb_state *mrb, mrb_value obj)
    @@ -1973,19 +1973,19 @@ 

     
     
    -674
    -675
    -676
     677
     678
     679
     680
     681
     682
    -683
    +683 +684 +685 +686

    -
    # File 'mrbgems/mruby-math/src/math.c', line 674
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 677
     
     static mrb_value
     math_hypot(mrb_state *mrb, mrb_value obj)
    @@ -2059,9 +2059,6 @@ 

     
     
    -653
    -654
    -655
     656
     657
     658
    @@ -2069,10 +2066,13 @@ 

    660 661 662 -663

    +663 +664 +665 +666

    -
    # File 'mrbgems/mruby-math/src/math.c', line 653
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 656
     
     static mrb_value
     math_ldexp(mrb_state *mrb, mrb_value obj)
    @@ -2195,9 +2195,6 @@ 

     
     
    -485
    -486
    -487
     488
     489
     490
    @@ -2213,10 +2210,13 @@ 

    500 501 502 -503

    +503 +504 +505 +506

    -
    # File 'mrbgems/mruby-math/src/math.c', line 485
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 488
     
     static mrb_value
     math_log(mrb_state *mrb, mrb_value obj)
    @@ -2300,9 +2300,6 @@ 

     
     
    -542
    -543
    -544
     545
     546
     547
    @@ -2312,10 +2309,13 @@ 

    551 552 553 -554

    +554 +555 +556 +557

    -
    # File 'mrbgems/mruby-math/src/math.c', line 542
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 545
     
     static mrb_value
     math_log10(mrb_state *mrb, mrb_value obj)
    @@ -2394,9 +2394,6 @@ 

     
     
    -517
    -518
    -519
     520
     521
     522
    @@ -2406,10 +2403,13 @@ 

    526 527 528 -529

    +529 +530 +531 +532

    -
    # File 'mrbgems/mruby-math/src/math.c', line 517
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 520
     
     static mrb_value
     math_log2(mrb_state *mrb, mrb_value obj)
    @@ -2484,19 +2484,19 @@ 

     
     
    -185
    -186
    -187
     188
     189
     190
     191
     192
     193
    -194
    +194 +195 +196 +197

    -
    # File 'mrbgems/mruby-math/src/math.c', line 185
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 188
     
     static mrb_value
     math_sin(mrb_state *mrb, mrb_value obj)
    @@ -2568,19 +2568,19 @@ 

     
     
    -335
    -336
    -337
     338
     339
     340
     341
     342
     343
    -344
    +344 +345 +346 +347

    -
    # File 'mrbgems/mruby-math/src/math.c', line 335
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 338
     
     static mrb_value
     math_sinh(mrb_state *mrb, mrb_value obj)
    @@ -2651,9 +2651,6 @@ 

     
     
    -563
    -564
    -565
     566
     567
     568
    @@ -2663,10 +2660,13 @@ 

    572 573 574 -575

    +575 +576 +577 +578

    -
    # File 'mrbgems/mruby-math/src/math.c', line 563
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 566
     
     static mrb_value
     math_sqrt(mrb_state *mrb, mrb_value obj)
    @@ -2740,19 +2740,19 @@ 

     
     
    -220
    -221
    -222
     223
     224
     225
     226
     227
     228
    -229
    +229 +230 +231 +232

    -
    # File 'mrbgems/mruby-math/src/math.c', line 220
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 223
     
     static mrb_value
     math_tan(mrb_state *mrb, mrb_value obj)
    @@ -2824,19 +2824,19 @@ 

     
     
    -370
    -371
    -372
     373
     374
     375
     376
     377
     378
    -379
    +379 +380 +381 +382

    -
    # File 'mrbgems/mruby-math/src/math.c', line 370
    +      
    # File 'mrbgems/mruby-math/src/math.c', line 373
     
     static mrb_value
     math_tanh(mrb_state *mrb, mrb_value obj)
    @@ -2858,9 +2858,9 @@ 

    diff --git a/docs/api/Method.html b/docs/api/Method.html index a939993..934e3b9 100644 --- a/docs/api/Method.html +++ b/docs/api/Method.html @@ -6,7 +6,7 @@ Class: Method - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -123,6 +123,29 @@

  • + #<<(other) ⇒ Object + + + + + + + + + + + + + +
    +
    + +
  • + + +
  • + + #== ⇒ Object @@ -137,6 +160,29 @@

    +
    +
    + +

  • + + +
  • + + + #>>(other) ⇒ Object + + + + + + + + + + + + +
    @@ -429,7 +475,37 @@

    Instance Method Details

    -

    +

    + + #<<(other) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +21
    +22
    +23
    +
    +
    # File 'mrbgems/mruby-method/mrblib/method.rb', line 21
    +
    +def <<(other)
    +  ->(*args, &block) { call(other.call(*args, &block)) }
    +end
    +
    +
    + +
    +

    #==Object @@ -564,6 +640,36 @@

    +

    + +
    +

    + + #>>(other) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +25
    +26
    +27
    +
    +
    # File 'mrbgems/mruby-method/mrblib/method.rb', line 25
    +
    +def >>(other)
    +  ->(*args, &block) { other.call(call(*args, &block)) }
    +end
    +
    @@ -1291,9 +1397,9 @@

    diff --git a/docs/api/Module.html b/docs/api/Module.html index e627659..893f97a 100644 --- a/docs/api/Module.html +++ b/docs/api/Module.html @@ -6,7 +6,7 @@ Class: Module - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -98,7 +98,9 @@
    Defined in:
    -
    mrblib/00class.rb
    +
    mrblib/00class.rb,
    + mrbgems/mruby-class-ext/mrblib/module.rb
    +
    @@ -121,6 +123,121 @@

  • + #<(other) ⇒ Object + + + + + + + + + + + + + +

    call-seq: mod < other -> true, false, or nil.

    +
    + +
  • + + +
  • + + + #<=(other) ⇒ Object + + + + + + + + + + + + + +

    call-seq: mod <= other -> true, false, or nil.

    +
    + +
  • + + +
  • + + + #<=>(other) ⇒ Object + + + + + + + + + + + + + +

    call-seq: module <=> other_module -> -1, 0, +1, or nil.

    +
    + +
  • + + +
  • + + + #>(other) ⇒ Object + + + + + + + + + + + + + +

    call-seq: mod > other -> true, false, or nil.

    +
    + +
  • + + +
  • + + + #>=(other) ⇒ Object + + + + + + + + + + + + + +

    call-seq: mod >= other -> true, false, or nil.

    +
    + +
  • + + +
  • + + #attr_accessor(*names) ⇒ Object @@ -197,7 +314,315 @@

    Instance Method Details

    -

    +

    + + #<(other) ⇒ Object + + + + + +

    +
    +

    call-seq: + mod < other -> true, false, or nil

    + +

    Returns true if mod is a subclass of other. Returns +nil if there’s no relationship between the two. +(Think of the relationship in terms of the class definition: +“class A < B” implies “A < B”.)

    + + +
    +
    +
    + + +
    + + + + + + +
    +
    +
    +
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +
    +
    # File 'mrbgems/mruby-class-ext/mrblib/module.rb', line 12
    +
    +def <(other)
    +  if self.equal?(other)
    +    false
    +  else
    +    self <= other
    +  end
    +end
    +
    +
    + +
    +

    + + #<=(other) ⇒ Object + + + + + +

    +
    +

    call-seq: + mod <= other -> true, false, or nil

    + +

    Returns true if mod is a subclass of other or +is the same as other. Returns +nil if there’s no relationship between the two. +(Think of the relationship in terms of the class definition: +“class A < B” implies “A < B”.)

    + + +
    +
    +
    + +

    Raises:

    + + +
    + + + + + + +
    +
    +
    +
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +
    +
    # File 'mrbgems/mruby-class-ext/mrblib/module.rb', line 29
    +
    +def <=(other)
    +  raise TypeError, 'compared with non class/module' unless other.is_a?(Module)
    +  if self.ancestors.include?(other)
    +    return true
    +  elsif other.ancestors.include?(self)
    +    return false
    +  end
    +end
    +
    +
    + +
    +

    + + #<=>(other) ⇒ Object + + + + + +

    +
    +

    call-seq: + module <=> other_module -> -1, 0, +1, or nil

    + +

    Comparison—Returns -1, 0, +1 or nil depending on whether module +includes other_module, they are the same, or if module is included by +other_module.

    + +

    Returns nil if module has no relationship with other_module, if +other_module is not a module, or if the two values are incomparable.

    + + +
    +
    +
    + + +
    + + + + + + +
    +
    +
    +
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +
    +
    # File 'mrbgems/mruby-class-ext/mrblib/module.rb', line 81
    +
    +def <=>(other)
    +  return 0 if self.equal?(other)
    +  return nil unless other.is_a?(Module)
    +  cmp = self < other
    +  return -1 if cmp
    +  return 1 unless cmp.nil?
    +  return nil
    +end
    +
    +
    + +
    +

    + + #>(other) ⇒ Object + + + + + +

    +
    +

    call-seq: + mod > other -> true, false, or nil

    + +

    Returns true if mod is an ancestor of other. Returns +nil if there’s no relationship between the two. +(Think of the relationship in terms of the class definition: +“class A < B” implies “B > A”.)

    + + +
    +
    +
    + + +
    + + + + + + +
    +
    +
    +
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +
    +
    # File 'mrbgems/mruby-class-ext/mrblib/module.rb', line 47
    +
    +def >(other)
    +  if self.equal?(other)
    +    false
    +  else
    +    self >= other
    +  end
    +end
    +
    +
    + +
    +

    + + #>=(other) ⇒ Object + + + + + +

    +
    +

    call-seq: + mod >= other -> true, false, or nil

    + +

    Returns true if mod is an ancestor of other, or the +two modules are the same. Returns +nil if there’s no relationship between the two. +(Think of the relationship in terms of the class definition: +“class A < B” implies “B > A”.)

    + + +
    +
    +
    + +

    Raises:

    + + +
    + + + + + + +
    +
    +
    +
    +65
    +66
    +67
    +68
    +
    +
    # File 'mrbgems/mruby-class-ext/mrblib/module.rb', line 65
    +
    +def >=(other)
    +  raise TypeError, 'compared with non class/module' unless other.is_a?(Module)
    +  return other < self
    +end
    +
    +
    + +
    +

    #attr_accessor(*names) ⇒ Object @@ -333,9 +758,9 @@

    diff --git a/docs/api/NameError.html b/docs/api/NameError.html index 52c6728..e7e310a 100644 --- a/docs/api/NameError.html +++ b/docs/api/NameError.html @@ -6,7 +6,7 @@ Exception: NameError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -316,9 +316,9 @@

    diff --git a/docs/api/NilClass.html b/docs/api/NilClass.html index 26fc938..6d1bb59 100644 --- a/docs/api/NilClass.html +++ b/docs/api/NilClass.html @@ -6,7 +6,7 @@ Class: NilClass - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -1082,9 +1082,9 @@

    diff --git a/docs/api/NoMemoryError.html b/docs/api/NoMemoryError.html index 58f2c43..1467638 100644 --- a/docs/api/NoMemoryError.html +++ b/docs/api/NoMemoryError.html @@ -6,7 +6,7 @@ Exception: NoMemoryError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -134,9 +134,9 @@

    Constructor Details

    diff --git a/docs/api/NoMethodError.html b/docs/api/NoMethodError.html index 449d611..50529e7 100644 --- a/docs/api/NoMethodError.html +++ b/docs/api/NoMethodError.html @@ -6,7 +6,7 @@ Exception: NoMethodError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -327,9 +327,9 @@

    diff --git a/docs/api/NotImplementedError.html b/docs/api/NotImplementedError.html index 3bb8637..7a81919 100644 --- a/docs/api/NotImplementedError.html +++ b/docs/api/NotImplementedError.html @@ -6,7 +6,7 @@ Exception: NotImplementedError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -142,9 +142,9 @@

    Constructor Details

    diff --git a/docs/api/Numeric.html b/docs/api/Numeric.html index 4aa6919..1a7691e 100644 --- a/docs/api/Numeric.html +++ b/docs/api/Numeric.html @@ -6,7 +6,7 @@ Class: Numeric - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -346,6 +346,29 @@

    +
    +
    + +

  • + + +
  • + + + #__coerce_step_counter ⇒ Object + + + + + + + + + + + + +
    @@ -520,7 +543,6 @@

     
     
    -57
     58
     59
     60
    @@ -566,10 +588,11 @@ 

    100 101 102 -103

    +103 +104

  • -
    # File 'src/numeric.c', line 57
    +      
    # File 'src/numeric.c', line 58
     
     static mrb_value
     num_pow(mrb_state *mrb, mrb_value x)
    @@ -740,7 +763,6 @@ 

     
     
    -137
     138
     139
     140
    @@ -757,10 +779,11 @@ 

    151 152 153 -154

    +154 +155

    -
    # File 'src/numeric.c', line 137
    +      
    # File 'src/numeric.c', line 138
     
     static mrb_value
     num_div(mrb_state *mrb, mrb_value x)
    @@ -812,21 +835,21 @@ 

     
     
    -1392
    -1393
    -1394
    -1395
    -1396
    -1397
    -1398
    -1399
    -1400
    -1401
    -1402
    -1403
    +1452 +1453 +1454 +1455 +1456 +1457 +1458 +1459 +1460 +1461 +1462 +1463

    -
    # File 'src/numeric.c', line 1392
    +      
    # File 'src/numeric.c', line 1452
     
     static mrb_value
     num_lt(mrb_state *mrb, mrb_value self)
    @@ -860,21 +883,21 @@ 

     
     
    -1405
    -1406
    -1407
    -1408
    -1409
    -1410
    -1411
    -1412
    -1413
    -1414
    -1415
    -1416
    +1465 +1466 +1467 +1468 +1469 +1470 +1471 +1472 +1473 +1474 +1475 +1476

    -
    # File 'src/numeric.c', line 1405
    +      
    # File 'src/numeric.c', line 1465
     
     static mrb_value
     num_le(mrb_state *mrb, mrb_value self)
    @@ -996,20 +1019,20 @@ 

     
     
    -1372
    -1373
    -1374
    -1375
    -1376
    -1377
    -1378
    -1379
    -1380
    -1381
    -1382
    +1432 +1433 +1434 +1435 +1436 +1437 +1438 +1439 +1440 +1441 +1442

    -
    # File 'src/numeric.c', line 1372
    +      
    # File 'src/numeric.c', line 1432
     
     static mrb_value
     num_cmp(mrb_state *mrb, mrb_value self)
    @@ -1042,21 +1065,21 @@ 

     
     
    -1418
    -1419
    -1420
    -1421
    -1422
    -1423
    -1424
    -1425
    -1426
    -1427
    -1428
    -1429
    +1478 +1479 +1480 +1481 +1482 +1483 +1484 +1485 +1486 +1487 +1488 +1489

    -
    # File 'src/numeric.c', line 1418
    +      
    # File 'src/numeric.c', line 1478
     
     static mrb_value
     num_gt(mrb_state *mrb, mrb_value self)
    @@ -1090,21 +1113,21 @@ 

     
     
    -1431
    -1432
    -1433
    -1434
    -1435
    -1436
    -1437
    -1438
    -1439
    -1440
    -1441
    -1442
    +1491 +1492 +1493 +1494 +1495 +1496 +1497 +1498 +1499 +1500 +1501 +1502

    -
    # File 'src/numeric.c', line 1431
    +      
    # File 'src/numeric.c', line 1491
     
     static mrb_value
     num_ge(mrb_state *mrb, mrb_value self)
    @@ -1121,6 +1144,60 @@ 

    + + +
    +

    + + #__coerce_step_counterObject + + + + + +

    + + + + +
    +
    +
    +
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +
    +
    # File 'src/numeric.c', line 157
    +
    +static mrb_value
    +num_coerce_step_counter(mrb_state *mrb, mrb_value self)
    +{
    +  mrb_value counter = self, num, step;
    +
    +  mrb_get_args(mrb, "oo", &num, &step);
    +
    +#ifndef MRB_WITHOUT_FLOAT
    +  if (mrb_float_p(self) || mrb_float_p(num) || mrb_float_p(step)) {
    +    counter = mrb_funcall(mrb, counter, "to_f", 0);
    +  }
    +#endif
    +
    +  return counter;
    +}
    +
    @@ -1215,15 +1292,15 @@

     
     
    -1444
    -1445
    -1446
    -1447
    -1448
    -1449
    +1504 +1505 +1506 +1507 +1508 +1509

    -
    # File 'src/numeric.c', line 1444
    +      
    # File 'src/numeric.c', line 1504
     
     static mrb_value
     num_finite_p(mrb_state *mrb, mrb_value self)
    @@ -1276,15 +1353,15 @@ 

     
     
    -1451
    -1452
    -1453
    -1454
    -1455
    -1456
    +1511 +1512 +1513 +1514 +1515 +1516

    -
    # File 'src/numeric.c', line 1451
    +      
    # File 'src/numeric.c', line 1511
     
     static mrb_value
     num_infinite_p(mrb_state *mrb, mrb_value self)
    @@ -1326,7 +1403,6 @@ 

     
     
    -137
     138
     139
     140
    @@ -1343,10 +1419,11 @@ 

    151 152 153 -154

    +154 +155

    -
    # File 'src/numeric.c', line 137
    +      
    # File 'src/numeric.c', line 138
     
     static mrb_value
     num_div(mrb_state *mrb, mrb_value x)
    @@ -1376,9 +1453,9 @@ 

    diff --git a/docs/api/Object.html b/docs/api/Object.html index ad5c279..b775126 100644 --- a/docs/api/Object.html +++ b/docs/api/Object.html @@ -6,7 +6,7 @@ Class: Object - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -263,9 +263,9 @@

    diff --git a/docs/api/ObjectSpace.html b/docs/api/ObjectSpace.html index 127a25f..4ac1009 100644 --- a/docs/api/ObjectSpace.html +++ b/docs/api/ObjectSpace.html @@ -6,7 +6,7 @@ Module: ObjectSpace - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -99,9 +99,9 @@ diff --git a/docs/api/Proc.html b/docs/api/Proc.html index cf30078..f020410 100644 --- a/docs/api/Proc.html +++ b/docs/api/Proc.html @@ -6,7 +6,7 @@ Class: Proc - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -135,6 +135,29 @@

  • + #<<(other) ⇒ Object + + + + + + + + + + + + + +
    +
    + +
  • + + +
  • + + #===(*args) ⇒ Object @@ -149,6 +172,29 @@

    +
    +
    + +

  • + + +
  • + + + #>>(other) ⇒ Object + + + + + + + + + + + + +
    @@ -234,7 +280,37 @@

    Instance Method Details

    -

    +

    + + #<<(other) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +42
    +43
    +44
    +
    +
    # File 'mrbgems/mruby-proc-ext/mrblib/proc.rb', line 42
    +
    +def <<(other)
    +  ->(*args, &block) { call(other.call(*args, &block)) }
    +end
    +
    +
    + +
    +

    #===(*args) ⇒ Object @@ -261,6 +337,36 @@

    +

    + +
    +

    + + #>>(other) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +46
    +47
    +48
    +
    +
    # File 'mrbgems/mruby-proc-ext/mrblib/proc.rb', line 46
    +
    +def >>(other)
    +  ->(*args, &block) { other.call(call(*args, &block)) }
    +end
    +
    @@ -323,7 +429,7 @@

    pproc = self make_curry = proc do |given_args=[]| - send(type) do |*args| + __send__(type) do |*args| new_args = given_args + args if new_args.size >= arity pproc[*new_args] @@ -404,9 +510,9 @@

    diff --git a/docs/api/Random.html b/docs/api/Random.html index ffe8e66..76ba1b7 100644 --- a/docs/api/Random.html +++ b/docs/api/Random.html @@ -6,7 +6,7 @@ Class: Random - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -405,9 +405,9 @@

    diff --git a/docs/api/Range.html b/docs/api/Range.html index d384f61..eecbb0a 100644 --- a/docs/api/Range.html +++ b/docs/api/Range.html @@ -6,7 +6,7 @@ Class: Range - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -227,7 +227,7 @@

    Methods included from Enumerable

    -

    #all?, #any?, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #find_all, #find_index, #flat_map, #grep, #group_by, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #sort, #sort_by, #take, #take_while, #to_h, to_h, #uniq, #zip

    +

    #+, __update_hash, #all?, #any?, #chain, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #find_all, #find_index, #flat_map, #grep, #group_by, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #sort, #sort_by, #take, #take_while, #to_h, to_h, #uniq, #zip

    @@ -428,10 +428,7 @@

    24 25 26 -27 -28 -29 -30

  • +27
    # File 'mrbgems/mruby-range-ext/mrblib/range.rb', line 13
    @@ -441,10 +438,7 @@ 

    raise ArgumentError, "wrong number of arguments (given #{args.length}, expected 1)" unless args.length == 1 nv = args[0] - raise TypeError, "no implicit conversion from nil to integer" if nv.nil? - raise TypeError, "no implicit conversion of #{nv.class} into Integer" unless nv.respond_to?(:to_int) - n = nv.to_int - raise TypeError, "no implicit conversion of #{nv.class} into Integer" unless n.kind_of?(Integer) + n = nv.__to_int raise ArgumentError, "negative array size (or size too big)" unless 0 <= n ary = [] each do |i| @@ -510,9 +504,9 @@

    diff --git a/docs/api/RangeError.html b/docs/api/RangeError.html index a390a8a..874c5e4 100644 --- a/docs/api/RangeError.html +++ b/docs/api/RangeError.html @@ -6,7 +6,7 @@ Exception: RangeError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -158,9 +158,9 @@

    Constructor Details

    diff --git a/docs/api/RegexpError.html b/docs/api/RegexpError.html index 9c6d174..cca5394 100644 --- a/docs/api/RegexpError.html +++ b/docs/api/RegexpError.html @@ -6,7 +6,7 @@ Exception: RegexpError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -154,9 +154,9 @@

    Constructor Details

    diff --git a/docs/api/ScriptError.html b/docs/api/ScriptError.html index 84299aa..5b0dacd 100644 --- a/docs/api/ScriptError.html +++ b/docs/api/ScriptError.html @@ -6,7 +6,7 @@ Exception: ScriptError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -150,9 +150,9 @@

    Constructor Details

    diff --git a/docs/api/Socket.html b/docs/api/Socket.html index a8a6277..1e96081 100644 --- a/docs/api/Socket.html +++ b/docs/api/Socket.html @@ -6,7 +6,7 @@ Class: Socket - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -1160,9 +1160,9 @@

    diff --git a/docs/api/Socket/Constants.html b/docs/api/Socket/Constants.html index b77efac..1483a05 100644 --- a/docs/api/Socket/Constants.html +++ b/docs/api/Socket/Constants.html @@ -6,7 +6,7 @@ Module: Socket::Constants - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -104,9 +104,9 @@ diff --git a/docs/api/Socket/Option.html b/docs/api/Socket/Option.html index 503f5ad..2170060 100644 --- a/docs/api/Socket/Option.html +++ b/docs/api/Socket/Option.html @@ -6,7 +6,7 @@ Class: Socket::Option - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -947,9 +947,9 @@

    diff --git a/docs/api/SocketError.html b/docs/api/SocketError.html index 842e433..d6ca9cb 100644 --- a/docs/api/SocketError.html +++ b/docs/api/SocketError.html @@ -6,7 +6,7 @@ Exception: SocketError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -142,9 +142,9 @@

    Constructor Details

    diff --git a/docs/api/StandardError.html b/docs/api/StandardError.html index cee9715..d73d9e2 100644 --- a/docs/api/StandardError.html +++ b/docs/api/StandardError.html @@ -6,7 +6,7 @@ Exception: StandardError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -150,9 +150,9 @@

    Constructor Details

    diff --git a/docs/api/StopIteration.html b/docs/api/StopIteration.html index 63a35d4..e8fad85 100644 --- a/docs/api/StopIteration.html +++ b/docs/api/StopIteration.html @@ -6,7 +6,7 @@ Exception: StopIteration - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -230,9 +230,9 @@

    diff --git a/docs/api/String.html b/docs/api/String.html index 7903c29..eac360f 100644 --- a/docs/api/String.html +++ b/docs/api/String.html @@ -6,7 +6,7 @@ Class: String - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -133,7 +133,7 @@

    Overview

    - Class Method Summary + Instance Method Summary collapse

    @@ -142,7 +142,7 @@

  • - .try_convert(obj) ⇒ Object + #%(args) ⇒ Object @@ -156,25 +156,16 @@

    -

    call-seq: String.try_convert(obj) -> string or nil.

    +

  • - - -

    - Instance Method Summary - collapse -

    - -
      -
    • - #%(args) ⇒ Object + #*(integer) ⇒ String @@ -188,7 +179,7 @@

      -
      +

      Copy—Returns a new String containing integer copies of the receiver.

    • @@ -197,7 +188,7 @@

    • - #*(integer) ⇒ String + #+(other_str) ⇒ String @@ -211,7 +202,7 @@

      -

      Copy—Returns a new String containing integer copies of the receiver.

      +

      Concatenation—Returns a new String containing other_str concatenated to str.

    • @@ -220,7 +211,7 @@

    • - #+ ⇒ Object + #<< ⇒ Object @@ -234,7 +225,7 @@

      -

      String(“abcdefg”) = String(“abcd”) + String(“efg”).

      +

      Append—Concatenates the given object to str.

    • @@ -243,7 +234,7 @@

    • - #<< ⇒ Object + #<=>(other_str) ⇒ -1, ... @@ -257,7 +248,7 @@

      -

      Append—Concatenates the given object to str.

      +

      Comparison—Returns -1 if other_str is less than, 0 if other_str is equal to, and +1 if other_str is greater than str.

    • @@ -266,7 +257,7 @@

    • - #<=>(other_str) ⇒ -1, ... + #==(obj) ⇒ Boolean @@ -280,7 +271,7 @@

      -

      Comparison—Returns -1 if other_str is less than, 0 if other_str is equal to, and +1 if other_str is greater than str.

      +

      Equality— If obj is not a String, returns false.

    • @@ -289,7 +280,7 @@

    • - #==(obj) ⇒ Boolean + #=~(re) ⇒ Object @@ -303,7 +294,7 @@

      -

      Equality— If obj is not a String, returns false.

      +

      ISO 15.2.10.5.3.

    • @@ -312,7 +303,7 @@

    • - #=~(re) ⇒ Object + #[] ⇒ Object @@ -326,7 +317,7 @@

      -

      ISO 15.2.10.5.3.

      +

      Element Reference—If passed a single Fixnum, returns the code of the character at that position.

    • @@ -335,7 +326,7 @@

    • - #[] ⇒ Object + #[]=(*args) ⇒ Object @@ -349,7 +340,7 @@

      -

      Element Reference—If passed a single Fixnum, returns the code of the character at that position.

      +

      Modify +self+ by replacing the content of +self+.

    • @@ -358,7 +349,7 @@

    • - #[]=(*args) ⇒ Object + #__lines ⇒ Object @@ -372,7 +363,7 @@

      -

      Modify +self+ by replacing the content of +self+.

      +

    • @@ -768,6 +759,29 @@

      Append—Concatenates the given object to str.

      + + + +
    • + + + #count ⇒ Object + + + + + + + + + + + + + +

      call_seq: str.count([other_str]) -> integer.

      +
      +
    • @@ -791,6 +805,52 @@

      Returns true if +obj+ is between the begin and end of the range.

      + + + +
    • + + + #delete ⇒ Object + + + + + + + + + + + + + +
      +
      + +
    • + + +
    • + + + #delete! ⇒ Object + + + + + + + + + + + + + +
      +
      +
    • @@ -1211,7 +1271,7 @@

    • - #include? ⇒ Boolean + #include? ⇒ Object @@ -1420,7 +1480,7 @@

    • - #lines ⇒ Object + #lines(&blk) ⇒ Object @@ -1434,7 +1494,14 @@

      -

      Returns strings per line;.

      +
      + + + + + + +
      call-seq: string.lines -> array of string string.lines sblock -> array of string.

    • @@ -1943,6 +2010,52 @@

      Divides str into substrings based on a delimiter, returning an array of these substrings.

      +

    • + + +
    • + + + #squeeze([other_str]) ⇒ String + + + + + + + + + + + + + +

      Builds a set of characters from the other_str parameter(s) using the procedure described for String#count.

      +
      + +
    • + + +
    • + + + #squeeze!([other_str]) ⇒ String? + + + + + + + + + + + + + +

      Squeezes str in place, returning either str, or nil if no changes were made.

      +
      +
    • @@ -2202,7 +2315,7 @@

    • - #to_s ⇒ Object + #to_s ⇒ String @@ -2225,7 +2338,7 @@

    • - #to_str ⇒ Object + #to_s ⇒ String @@ -2265,6 +2378,98 @@

      Returns the Symbol corresponding to str, creating the symbol if it did not previously exist.

      +

    • + + +
    • + + + #tr(from_str, to_str) ⇒ String + + + + + + + + + + + + + +

      Returns a copy of str with the characters in from_str replaced by the corresponding characters in to_str.

      +
      + +
    • + + +
    • + + + #tr!(from_str, to_str) ⇒ String? + + + + + + + + + + + + + +

      Translates str in place, using the same rules as String#tr.

      +
      + +
    • + + +
    • + + + #tr_s(from_str, to_str) ⇒ String + + + + + + + + + + + + + +

      Processes a copy of str as described under String#tr, then removes duplicate characters in regions that were affected by the translation.

      +
      + +
    • + + +
    • + + + #tr_s!(from_str, to_str) ⇒ String? + + + + + + + + + + + + + +

      Performs String#tr_s processing on str in place, returning str, or nil if no changes were made.

      +
      +
    • @@ -2317,7 +2522,7 @@

    • - #upto ⇒ Object + #upto(max, exclusive = false, &block) ⇒ Object @@ -2331,7 +2536,15 @@

      -

      Iterates through successive values, starting at str and ending at other_str inclusive, passing each value in turn to the block.

      +
      + + + + + + + +
      call-seq: str.upto(other_str, exclusive=false) {sblock } -> str str.upto(other_str, exclusive=false) -> an_enumerator.

    • @@ -2395,21 +2608,21 @@

       
       
      -1630
      -1631
      -1632
      -1633
      -1634
      -1635
      -1636
      -1637
      -1638
      -1639
      -1640
      -1641
      +1618 +1619 +1620 +1621 +1622 +1623 +1624 +1625 +1626 +1627 +1628 +1629

    -
    # File 'src/string.c', line 1630
    +      
    # File 'src/string.c', line 1618
     
     static mrb_value
     mrb_str_init(mrb_state *mrb, mrb_value self)
    @@ -2431,88 +2644,23 @@ 

    -
    -

    Class Method Details

    +
    +

    Instance Method Details

    -

    +

    - .try_convert(obj) ⇒ Object + #%(args) ⇒ Object -

    -
    -

    call-seq: - String.try_convert(obj) -> string or nil

    - -

    Try to convert obj into a String, using to_str method. -Returns converted string or nil if obj cannot be converted -for any reason.

    - -
    String.try_convert("str")     #=> "str"
    -String.try_convert(/re/)      #=> nil
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 14
    -
    -def self.try_convert(obj)
    -  if obj.respond_to?(:to_str)
    -    obj.to_str
    -  else
    -    nil
    -  end
    -end
    -
    -
    - -
    - -
    -

    Instance Method Details

    - - -
    -

    - - #%(args) ⇒ Object - - - - - -

    - -
    -
    +
    +  
    +    
    @@ -3593,6 +3754,16 @@ 

     
     
    +1120
    +1121
    +1122
    +1123
    +1124
    +1125
    +1126
    +1127
    +1128
    +1129
     1130
     1131
     1132
    @@ -3601,20 +3772,10 @@ 

    1135 1136 1137 -1138 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148

    +1138

    +
     
     
     2
    @@ -2595,6 +2743,11 @@ 

     
     
    +818
    +819
    +820
    +821
    +822
     823
     824
     825
    @@ -2621,15 +2774,10 @@ 

    846 847 848 -849 -850 -851 -852 -853 -854

    +849

    -
    # File 'src/string.c', line 823
    +      
    # File 'src/string.c', line 818
     
     static mrb_value
     mrb_str_times(mrb_state *mrb, mrb_value self)
    @@ -2671,7 +2819,7 @@ 

    - #+Object + #+(other_str) ⇒ String @@ -2679,15 +2827,43 @@

    -

    String(“abcdefg”) = String(“abcd”) + String(“efg”)

    +

    Concatenation—Returns a new String containing +other_str concatenated to str.

    + +

    “Hello from “ + self.to_s #=> “Hello from main”

    -

    Returns a new string object containing a copy of str.

    + +
    +
    +
    + +
    +
    +
    +

    Returns:

    +
      + +
    • + + + (String) + + + +
    • + +
    + +
    + + +
    @@ -2697,17 +2873,17 @@

     
     
    +777
    +778
    +779
    +780
    +781
     782
     783
    -784
    -785
    -786
    -787
    -788
    -789
    +784

    -
    # File 'src/string.c', line 782
    +      
    # File 'src/string.c', line 777
     
     static mrb_value
     mrb_str_plus_m(mrb_state *mrb, mrb_value self)
    @@ -2918,7 +3094,7 @@ 

    if (mrb_fixnum_p(str)) str = mrb_fixnum_chr(mrb, str); else - str = mrb_string_type(mrb, str); + str = mrb_ensure_string_type(mrb, str); mrb_str_concat(mrb, self, str); return self; }

    @@ -2999,6 +3175,11 @@

     
     
    +907
    +908
    +909
    +910
    +911
     912
     913
     914
    @@ -3022,15 +3203,10 @@ 

    932 933 934 -935 -936 -937 -938 -939 -940

    +935

    -
    # File 'src/string.c', line 912
    +      
    # File 'src/string.c', line 907
     
     static mrb_value
     mrb_str_cmp_m(mrb_state *mrb, mrb_value str1)
    @@ -3124,18 +3300,18 @@ 

     
     
    -979
    -980
    -981
    -982
    -983
    -984
    -985
    -986
    -987
    +966 +967 +968 +969 +970 +971 +972 +973 +974

    -
    # File 'src/string.c', line 979
    +      
    # File 'src/string.c', line 966
     
     static mrb_value
     mrb_str_equal_m(mrb_state *mrb, mrb_value str1)
    @@ -3169,19 +3345,6 @@ 

    -

    Raises:

    -
    @@ -3193,14 +3356,12 @@

    247 248 -249 -250

    +249
    # File 'mrblib/string.rb', line 247
     
     def =~(re)
    -  raise TypeError, "type mismatch: String given" if re.respond_to? :to_str
       re =~ self
     end
    -
    # File 'src/string.c', line 1130
    +      
    # File 'src/string.c', line 1120
     
     static mrb_value
     mrb_str_aref_m(mrb_state *mrb, mrb_value str)
    @@ -3773,6 +3934,78 @@ 

    + + +
    +

    + + #__linesObject + + + + + +

    + + + + +
    +
    +
    +
    +1171
    +1172
    +1173
    +1174
    +1175
    +1176
    +1177
    +1178
    +1179
    +1180
    +1181
    +1182
    +1183
    +1184
    +1185
    +1186
    +1187
    +1188
    +1189
    +1190
    +1191
    +1192
    +1193
    +1194
    +
    +
    # File 'mrbgems/mruby-string-ext/src/string.c', line 1171
    +
    +static mrb_value
    +mrb_str_lines(mrb_state *mrb, mrb_value self)
    +{
    +  mrb_value result;
    +  int ai;
    +  mrb_int len;
    +  char *b = RSTRING_PTR(self);
    +  char *p = b, *t;
    +  char *e = b + RSTRING_LEN(self);
    +
    +  mrb_get_args(mrb, "");
    +
    +  result = mrb_ary_new(mrb);
    +  ai = mrb_gc_arena_save(mrb);
    +  while (p < e) {
    +    t = p;
    +    while (p < e && *p != '\n') p++;
    +    if (*p == '\n') p++;
    +    len = (mrb_int) (p - t);
    +    mrb_ary_push(mrb, result, mrb_str_new(mrb, t, len));
    +    mrb_gc_arena_restore(mrb, ai);
    +  }
    +  return result;
    +}
    +
    @@ -3891,22 +4124,22 @@

     
     
    -2714
    -2715
    -2716
    -2717
    -2718
    -2719
    -2720
    -2721
    -2722
    -2723
    -2724
    -2725
    -2726
    +2695 +2696 +2697 +2698 +2699 +2700 +2701 +2702 +2703 +2704 +2705 +2706 +2707

    -
    # File 'src/string.c', line 2714
    +      
    # File 'src/string.c', line 2695
     
     static mrb_value
     mrb_str_bytes(mrb_state *mrb, mrb_value str)
    @@ -3941,15 +4174,15 @@ 

     
     
    -806
    -807
    -808
    -809
    -810
    -811
    +801 +802 +803 +804 +805 +806

    -
    # File 'src/string.c', line 806
    +      
    # File 'src/string.c', line 801
     
     static mrb_value
     mrb_str_bytesize(mrb_state *mrb, mrb_value self)
    @@ -4129,18 +4362,18 @@ 

     
     
    -1199
    -1200
    -1201
    -1202
    -1203
    -1204
    -1205
    -1206
    -1207
    +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197

    -
    # File 'src/string.c', line 1199
    +      
    # File 'src/string.c', line 1189
     
     static mrb_value
     mrb_str_capitalize(mrb_state *mrb, mrb_value self)
    @@ -4216,6 +4449,16 @@ 

     
     
    +1153
    +1154
    +1155
    +1156
    +1157
    +1158
    +1159
    +1160
    +1161
    +1162
     1163
     1164
     1165
    @@ -4228,20 +4471,10 @@ 

    1172 1173 1174 -1175 -1176 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185

    +1175

    -
    # File 'src/string.c', line 1163
    +      
    # File 'src/string.c', line 1153
     
     static mrb_value
     mrb_str_capitalize_bang(mrb_state *mrb, mrb_value str)
    @@ -4306,17 +4539,17 @@ 

     
     
    -144
    -145
    -146
    -147
    -148
    +125 +126 +127 +128 +129

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 144
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 125
     
     def casecmp(str)
    -  self.downcase <=> str.to_str.downcase
    +  self.downcase <=> str.__to_str.downcase
     rescue NoMethodError
       nil
     end
    @@ -4369,14 +4602,14 @@

     
     
    -157
    -158
    -159
    -160
    -161
    +138 +139 +140 +141 +142

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 157
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 138
     
     def casecmp?(str)
       c = self.casecmp(str)
    @@ -4403,19 +4636,19 @@ 

     
     
    -321
    -322
    -323
    -324
    -325
    -326
    -327
    -328
    -329
    -330
    +302 +303 +304 +305 +306 +307 +308 +309 +310 +311

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 321
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 302
     
     def chars(&block)
       if block_given?
    @@ -4498,18 +4731,18 @@ 

     
     
    -1304
    -1305
    -1306
    -1307
    -1308
    -1309
    -1310
    -1311
    -1312
    +1294 +1295 +1296 +1297 +1298 +1299 +1300 +1301 +1302

    -
    # File 'src/string.c', line 1304
    +      
    # File 'src/string.c', line 1294
     
     static mrb_value
     mrb_str_chomp(mrb_state *mrb, mrb_value self)
    @@ -4580,6 +4813,16 @@ 

     
     
    +1207
    +1208
    +1209
    +1210
    +1211
    +1212
    +1213
    +1214
    +1215
    +1216
     1217
     1218
     1219
    @@ -4636,20 +4879,10 @@ 

    1270 1271 1272 -1273 -1274 -1275 -1276 -1277 -1278 -1279 -1280 -1281 -1282 -1283

    +1273

    -
    # File 'src/string.c', line 1217
    +      
    # File 'src/string.c', line 1207
     
     static mrb_value
     mrb_str_chomp_bang(mrb_state *mrb, mrb_value str)
    @@ -4787,17 +5020,17 @@ 

     
     
    -1373
    -1374
    -1375
    -1376
    -1377
    -1378
    -1379
    -1380
    +1363 +1364 +1365 +1366 +1367 +1368 +1369 +1370

    -
    # File 'src/string.c', line 1373
    +      
    # File 'src/string.c', line 1363
     
     static mrb_value
     mrb_str_chop(mrb_state *mrb, mrb_value self)
    @@ -4868,6 +5101,16 @@ 

     
     
    +1313
    +1314
    +1315
    +1316
    +1317
    +1318
    +1319
    +1320
    +1321
    +1322
     1323
     1324
     1325
    @@ -4889,20 +5132,10 @@ 

    1341 1342 1343 -1344 -1345 -1346 -1347 -1348 -1349 -1350 -1351 -1352 -1353 -1354

    +1344

    -
    # File 'src/string.c', line 1323
    +      
    # File 'src/string.c', line 1313
     
     static mrb_value
     mrb_str_chop_bang(mrb_state *mrb, mrb_value str)
    @@ -4998,14 +5231,14 @@ 

     
     
    -259
    -260
    -261
    -262
    -263
    +845 +846 +847 +848 +849

    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 259
    +      
    # File 'mrbgems/mruby-string-ext/src/string.c', line 845
     
     static mrb_value
     mrb_str_chr(mrb_state *mrb, mrb_value self)
    @@ -5050,12 +5283,12 @@ 

     
     
    -31
    -32
    -33
    +12 +13 +14

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 31
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 12
     
     def clear
       self.replace("")
    @@ -5084,21 +5317,21 @@ 

     
     
    -341
    -342
    -343
    -344
    -345
    -346
    -347
    -348
    -349
    -350
    -351
    -352
    +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 341
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 322
     
     def codepoints(&block)
       len = self.size
    @@ -5313,7 +5546,7 @@ 

    if (mrb_fixnum_p(str)) str = mrb_fixnum_chr(mrb, str); else - str = mrb_string_type(mrb, str); + str = mrb_ensure_string_type(mrb, str); mrb_str_concat(mrb, self, str); return self; }

    @@ -5323,9 +5556,9 @@

    -

    +

    - #cover?(obj) ⇒ Boolean + #countObject @@ -5333,22 +5566,112 @@

    -

    Returns true if +obj+ is between the begin and end of -the range.

    - -

    This tests begin <= obj <= end when #exclude_end? is +false+ -and begin <= obj < end when #exclude_end? is +true+.

    +

    call_seq: + str.count([other_str]) -> integer

    -

    (“a”..”z”).cover?(“c”) #=> true - (“a”..”z”).cover?(“5”) #=> false - (“a”..”z”).cover?(“cc”) #=> true

    +

    Each other_str parameter defines a set of characters to count. The +intersection of these sets defines the characters to count in str. Any +other_str that starts with a caret ^ is negated. The sequence c1-c2 +means all characters between c1 and c2. The backslash character \ can +be used to escape ^ or - and is otherwise ignored unless it appears at +the end of a sequence or the end of a other_str.

    -
    + +
    + + + + + + +
    +
    +
    +
    +800
    +801
    +802
    +803
    +804
    +805
    +806
    +807
    +808
    +809
    +810
    +811
    +812
    +813
    +814
    +815
    +816
    +817
    +818
    +819
    +820
    +821
    +822
    +
    +
    # File 'mrbgems/mruby-string-ext/src/string.c', line 800
    +
    +static mrb_value
    +mrb_str_count(mrb_state *mrb, mrb_value str)
    +{
    +  mrb_value v_pat = mrb_nil_value();
    +  mrb_int i;
    +  char *s;
    +  mrb_int len;
    +  mrb_int count = 0;
    +  struct tr_pattern pat = STATIC_TR_PATTERN;
    +  uint8_t bitmap[32];
    +
    +  mrb_get_args(mrb, "S", &v_pat);
    +  tr_parse_pattern(mrb, &pat, v_pat, TRUE);
    +  tr_compile_pattern(&pat, v_pat, bitmap);
    +  tr_free_pattern(mrb, &pat);
    +  
    +  s = RSTRING_PTR(str);
    +  len = RSTRING_LEN(str);
    +  for (i = 0; i < len; i++) {
    +    if (tr_bitmap_detect(bitmap, s[i])) count++;
    +  }
    +  return mrb_fixnum_value(count);
    +}
    +
    +
    + +
    +

    + + #cover?(obj) ⇒ Boolean + + + + + +

    +
    +

    Returns true if +obj+ is between the begin and end of +the range.

    + +

    This tests begin <= obj <= end when #exclude_end? is +false+ +and begin <= obj < end when #exclude_end? is +true+.

    + +

    (“a”..”z”).cover?(“c”) #=> true + (“a”..”z”).cover?(“5”) #=> false + (“a”..”z”).cover?(“cc”) #=> true

    + + +
    +
    +
    + +
    @@ -5375,19 +5698,6 @@

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -

    @@ -5427,7 +5737,7 @@

    # File 'mrbgems/mruby-range-ext/src/range.c', line 42
     
     static mrb_value
    -mrb_range_cover(mrb_state *mrb, mrb_value range)
    +range_cover(mrb_state *mrb, mrb_value range)
     {
       mrb_value val;
       struct RRange *r = mrb_range_ptr(mrb, range);
    @@ -5435,11 +5745,11 @@ 

    mrb_get_args(mrb, "o", &val); - beg = r->edges->beg; - end = r->edges->end; + beg = RANGE_BEG(r); + end = RANGE_END(r); if (r_le(mrb, beg, val)) { - if (r->excl) { + if (RANGE_EXCL(r)) { if (r_lt(mrb, val, end)) return mrb_true_value(); } @@ -5454,6 +5764,98 @@

    +
    + +
    +

    + + #deleteObject + + + + + +

    + + + + +
    +
    +
    +
    +765
    +766
    +767
    +768
    +769
    +770
    +771
    +772
    +773
    +774
    +775
    +
    +
    # File 'mrbgems/mruby-string-ext/src/string.c', line 765
    +
    +static mrb_value
    +mrb_str_delete(mrb_state *mrb, mrb_value str)
    +{
    +  mrb_value pat;
    +  mrb_value dup;
    +
    +  mrb_get_args(mrb, "S", &pat);
    +  dup = mrb_str_dup(mrb, str);
    +  str_delete(mrb, dup, pat);
    +  return dup;
    +}
    +
    +
    + +
    +

    + + #delete!Object + + + + + +

    + + + + +
    +
    +
    +
    +777
    +778
    +779
    +780
    +781
    +782
    +783
    +784
    +785
    +786
    +787
    +
    +
    # File 'mrbgems/mruby-string-ext/src/string.c', line 777
    +
    +static mrb_value
    +mrb_str_delete_bang(mrb_state *mrb, mrb_value str)
    +{
    +  mrb_value pat;
    +
    +  mrb_get_args(mrb, "S", &pat);
    +  if (str_delete(mrb, str, pat)) {
    +    return str;
    +  }
    +  return mrb_nil_value();
    +}
    +
    @@ -5513,22 +5915,22 @@

     
     
    -699
    -700
    -701
    -702
    -703
    -704
    -705
    -706
    -707
    -708
    -709
    -710
    -711
    +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114

    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 699
    +      
    # File 'mrbgems/mruby-string-ext/src/string.c', line 1102
     
     static mrb_value
     mrb_str_del_prefix(mrb_state *mrb, mrb_value self)
    @@ -5606,32 +6008,32 @@ 

     
     
    -666
    -667
    -668
    -669
    -670
    -671
    -672
    -673
    -674
    -675
    -676
    -677
    -678
    -679
    -680
    -681
    -682
    -683
    -684
    -685
    -686
    -687
    -688
    - - -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 666
    +1069
    +1070
    +1071
    +1072
    +1073
    +1074
    +1075
    +1076
    +1077
    +1078
    +1079
    +1080
    +1081
    +1082
    +1083
    +1084
    +1085
    +1086
    +1087
    +1088
    +1089
    +1090
    +1091
    + + +
    # File 'mrbgems/mruby-string-ext/src/string.c', line 1069
     
     static mrb_value
     mrb_str_del_prefix_bang(mrb_state *mrb, mrb_value self)
    @@ -5718,22 +6120,22 @@ 

     
     
    -754
    -755
    -756
    -757
    -758
    -759
    -760
    -761
    -762
    -763
    -764
    -765
    -766
    +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169

    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 754
    +      
    # File 'mrbgems/mruby-string-ext/src/string.c', line 1157
     
     static mrb_value
     mrb_str_del_suffix(mrb_state *mrb, mrb_value self)
    @@ -5811,30 +6213,30 @@ 

     
     
    -723
    -724
    -725
    -726
    -727
    -728
    -729
    -730
    -731
    -732
    -733
    -734
    -735
    -736
    -737
    -738
    -739
    -740
    -741
    -742
    -743
    - - -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 723
    +1126
    +1127
    +1128
    +1129
    +1130
    +1131
    +1132
    +1133
    +1134
    +1135
    +1136
    +1137
    +1138
    +1139
    +1140
    +1141
    +1142
    +1143
    +1144
    +1145
    +1146
    + + +
    # File 'mrbgems/mruby-string-ext/src/string.c', line 1126
     
     static mrb_value
     mrb_str_del_suffix_bang(mrb_state *mrb, mrb_value self)
    @@ -5920,18 +6322,18 @@ 

     
     
    -1423
    -1424
    -1425
    -1426
    -1427
    -1428
    -1429
    -1430
    -1431
    +1413 +1414 +1415 +1416 +1417 +1418 +1419 +1420 +1421

    -
    # File 'src/string.c', line 1423
    +      
    # File 'src/string.c', line 1413
     
     static mrb_value
     mrb_str_downcase(mrb_state *mrb, mrb_value self)
    @@ -6002,6 +6404,16 @@ 

     
     
    +1380
    +1381
    +1382
    +1383
    +1384
    +1385
    +1386
    +1387
    +1388
    +1389
     1390
     1391
     1392
    @@ -6012,20 +6424,10 @@ 

    1397 1398 1399 -1400 -1401 -1402 -1403 -1404 -1405 -1406 -1407 -1408 -1409 -1410

    +1400

    -
    # File 'src/string.c', line 1390
    +      
    # File 'src/string.c', line 1380
     
     static mrb_value
     mrb_str_downcase_bang(mrb_state *mrb, mrb_value str)
    @@ -6108,6 +6510,28 @@ 

     
     
    +2427
    +2428
    +2429
    +2430
    +2431
    +2432
    +2433
    +2434
    +2435
    +2436
    +2437
    +2438
    +2439
    +2440
    +2441
    +2442
    +2443
    +2444
    +2445
    +2446
    +2447
    +2448
     2449
     2450
     2451
    @@ -6196,32 +6620,10 @@ 

    2534 2535 2536 -2537 -2538 -2539 -2540 -2541 -2542 -2543 -2544 -2545 -2546 -2547 -2548 -2549 -2550 -2551 -2552 -2553 -2554 -2555 -2556 -2557 -2558 -2559

    - - -
    # File 'src/string.c', line 2449
    +2537
    + + +
    # File 'src/string.c', line 2427
     
     mrb_value
     mrb_str_dump(mrb_state *mrb, mrb_value str)
    @@ -6497,7 +6899,7 @@ 

    def each_line(rs = "\n", &block) return to_enum(:each_line, rs, &block) unless block return block.call(self) if rs.nil? - rs = rs.to_str + rs.__to_str offset = 0 rs_len = rs.length this = dup @@ -6561,19 +6963,6 @@

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -6583,16 +6972,16 @@

     
     
    -1443
    -1444
    -1445
    -1446
    -1447
    -1448
    -1449
    +1433 +1434 +1435 +1436 +1437 +1438 +1439

    -
    # File 'src/string.c', line 1443
    +      
    # File 'src/string.c', line 1433
     
     static mrb_value
     mrb_str_empty_p(mrb_state *mrb, mrb_value self)
    @@ -6651,19 +7040,6 @@ 

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -6711,7 +7087,7 @@

    for (i = 0; i < argc; i++) { size_t len_l, len_r; int ai = mrb_gc_arena_save(mrb); - sub = mrb_string_type(mrb, argv[i]); + sub = mrb_ensure_string_type(mrb, argv[i]); mrb_gc_arena_restore(mrb, ai); len_l = RSTRING_LEN(self); len_r = RSTRING_LEN(sub); @@ -6775,19 +7151,6 @@

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -6797,20 +7160,20 @@

     
     
    -1458
    -1459
    -1460
    -1461
    -1462
    -1463
    -1464
    -1465
    -1466
    -1467
    -1468
    +1448 +1449 +1450 +1451 +1452 +1453 +1454 +1455 +1456 +1457 +1458

    -
    # File 'src/string.c', line 1458
    +      
    # File 'src/string.c', line 1448
     
     static mrb_value
     mrb_str_eql(mrb_state *mrb, mrb_value self)
    @@ -6967,7 +7330,7 @@ 

    block = nil end if !replace.nil? || !block - replace = replace.to_str + replace.__to_str end offset = 0 result = [] @@ -7052,7 +7415,7 @@

    raise FrozenError, "can't modify frozen String" if frozen? return to_enum(:gsub!, *args) if args.length == 1 && !block str = self.gsub(*args, &block) - return nil if str == self + return nil unless self.index(args[0]) self.replace(str) end

    @@ -7114,15 +7477,15 @@

     
     
    -1499
    -1500
    -1501
    -1502
    -1503
    -1504
    +1489 +1490 +1491 +1492 +1493 +1494

    -
    # File 'src/string.c', line 1499
    +      
    # File 'src/string.c', line 1489
     
     static mrb_value
     mrb_str_hash_m(mrb_state *mrb, mrb_value self)
    @@ -7150,14 +7513,14 @@ 

     
     
    -238
    -239
    -240
    -241
    -242
    +824 +825 +826 +827 +828

    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 238
    +      
    # File 'mrbgems/mruby-string-ext/src/string.c', line 824
     
     static mrb_value
     mrb_str_hex(mrb_state *mrb, mrb_value self)
    @@ -7263,19 +7626,6 @@ 

    -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    @@ -7285,19 +7635,19 @@

     
     
    -1519
    -1520
    -1521
    -1522
    -1523
    -1524
    -1525
    -1526
    -1527
    -1528
    +1509 +1510 +1511 +1512 +1513 +1514 +1515 +1516 +1517 +1518

    -
    # File 'src/string.c', line 1519
    +      
    # File 'src/string.c', line 1509
     
     static mrb_value
     mrb_str_include(mrb_state *mrb, mrb_value self)
    @@ -7457,6 +7807,16 @@ 

     
     
    +1541
    +1542
    +1543
    +1544
    +1545
    +1546
    +1547
    +1548
    +1549
    +1550
     1551
     1552
     1553
    @@ -7497,20 +7857,10 @@ 

    1588 1589 1590 -1591 -1592 -1593 -1594 -1595 -1596 -1597 -1598 -1599 -1600 -1601

    +1591

    -
    # File 'src/string.c', line 1551
    +      
    # File 'src/string.c', line 1541
     
     static mrb_value
     mrb_str_index_m(mrb_state *mrb, mrb_value str)
    @@ -7623,17 +7973,17 @@ 

     
     
    -1614
    -1615
    -1616
    -1617
    -1618
    -1619
    -1620
    -1621
    +1602 +1603 +1604 +1605 +1606 +1607 +1608 +1609

    -
    # File 'src/string.c', line 1614
    +      
    # File 'src/string.c', line 1602
     
     static mrb_value
     mrb_str_replace(mrb_state *mrb, mrb_value str)
    @@ -7689,18 +8039,18 @@ 

     
     
    -273
    -274
    -275
    -276
    -277
    -278
    -279
    -280
    -281
    - +254 +255 +256 +257 +258 +259 +260 +261 +262

    + -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 273
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 254
     
     def insert(idx, str)
       if idx == -1
    @@ -7775,6 +8125,25 @@ 

     
     
    +2619
    +2620
    +2621
    +2622
    +2623
    +2624
    +2625
    +2626
    +2627
    +2628
    +2629
    +2630
    +2631
    +2632
    +2633
    +2634
    +2635
    +2636
    +2637
     2638
     2639
     2640
    @@ -7821,29 +8190,10 @@ 

    2681 2682 2683 -2684 -2685 -2686 -2687 -2688 -2689 -2690 -2691 -2692 -2693 -2694 -2695 -2696 -2697 -2698 -2699 -2700 -2701 -2702 -2703

    +2684

    -
    # File 'src/string.c', line 2638
    +      
    # File 'src/string.c', line 2619
     
     mrb_value
     mrb_str_inspect(mrb_state *mrb, mrb_value str)
    @@ -7959,14 +8309,14 @@ 

     
     
    -1664
    -1665
    -1666
    -1667
    -1668
    +1652 +1653 +1654 +1655 +1656

    -
    # File 'src/string.c', line 1664
    +      
    # File 'src/string.c', line 1652
     
     MRB_API mrb_value
     mrb_str_intern(mrb_state *mrb, mrb_value self)
    @@ -8097,21 +8447,19 @@ 

    93 94 95 -96 -97

    +96
    # File 'mrbgems/mruby-range-ext/src/range.c', line 84
     
     static mrb_value
    -mrb_range_last(mrb_state *mrb, mrb_value range)
    +range_last(mrb_state *mrb, mrb_value range)
     {
       mrb_value num;
       mrb_value array;
    -  struct RRange *r = mrb_range_ptr(mrb, range);
     
       if (mrb_get_args(mrb, "|o", &num) == 0) {
    -    return r->edges->end;
    +    return mrb_range_end(mrb, range);
       }
     
       array = mrb_funcall(mrb, range, "to_a", 0);
    @@ -8176,15 +8524,15 @@ 

     
     
    -799
    -800
    -801
    -802
    -803
    -804
    +794 +795 +796 +797 +798 +799

    -
    # File 'src/string.c', line 799
    +      
    # File 'src/string.c', line 794
     
     static mrb_value
     mrb_str_size(mrb_state *mrb, mrb_value self)
    @@ -8200,7 +8548,7 @@ 

    - #linesObject + #lines(&blk) ⇒ Object @@ -8208,18 +8556,22 @@

    -

    Returns strings per line;

    +

    call-seq: + string.lines -> array of string + string.lines {|s| block} -> array of string

    + +

    Returns strings per line;

    a = “abc\ndef” a.lines #=> [“abc\n”, “def”]

    +

    If a block is given, it works the same as each_line.

    +
    - -
    @@ -8229,98 +8581,28 @@

     
     
    -319
    -320
    -321
    -322
    -323
    -324
    -325
    -326
    -327
    -328
    -329
    -330
    -331
    -332
    -333
    -334
    -335
    -336
    -337
    -338
    -339
    -340
    -341
    -342
    -343
    -344
    -345
    -346
    -347
    -348
    -349
    -350
    -351
    -352
    -353
    -354
    -355
    -356
    -357
    -358
    -359
    -360
     361
    -362
    +362 +363 +364 +365 +366 +367 +368 +369

    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 319
    -
    -static mrb_value
    -mrb_str_lines(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value result;
    -  mrb_value blk;
    -  int ai;
    -  mrb_int len;
    -  mrb_value arg;
    -  char *b = RSTRING_PTR(self);
    -  char *p = b, *t;
    -  char *e = b + RSTRING_LEN(self);
    -
    -  mrb_get_args(mrb, "&", &blk);
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 361
     
    -  result = mrb_ary_new(mrb);
    -  ai = mrb_gc_arena_save(mrb);
    -  if (!mrb_nil_p(blk)) {
    -    while (p < e) {
    -      t = p;
    -      while (p < e && *p != '\n') p++;
    -      if (*p == '\n') p++;
    -      len = (mrb_int) (p - t);
    -      arg = mrb_str_new(mrb, t, len);
    -      mrb_yield_argv(mrb, blk, 1, &arg);
    -      mrb_gc_arena_restore(mrb, ai);
    -      if (b != RSTRING_PTR(self)) {
    -        ptrdiff_t diff = p - b;
    -        b = RSTRING_PTR(self);
    -        p = b + diff;
    -      }
    -      e = b + RSTRING_LEN(self);
    -    }
    -    return self;
    -  }
    -  while (p < e) {
    -    t = p;
    -    while (p < e && *p != '\n') p++;
    -    if (*p == '\n') p++;
    -    len = (mrb_int) (p - t);
    -    mrb_ary_push(mrb, result, mrb_str_new(mrb, t, len));
    -    mrb_gc_arena_restore(mrb, ai);
    -  }
    -  return result;
    -}
    +def lines(&blk) + lines = self.__lines + if blk + lines.each do |line| + blk.call(line) + end + end + lines +end
    @@ -8376,16 +8658,16 @@

     
     
    -294
    -295
    -296
    -297
    -298
    -299
    -300
    +275 +276 +277 +278 +279 +280 +281

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 294
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 275
     
     def ljust(idx, padstr = ' ')
       raise ArgumentError, 'zero width padding' if padstr == ''
    @@ -8433,15 +8715,15 @@ 

     
     
    -45
    -46
    -47
    -48
    -49
    -50
    +26 +27 +28 +29 +30 +31

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 45
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 26
     
     def lstrip
       a = 0
    @@ -8502,14 +8784,14 @@ 

     
     
    -97
    -98
    -99
    -100
    -101
    +78 +79 +80 +81 +82

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 97
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 78
     
     def lstrip!
       raise FrozenError, "can't modify frozen String" if frozen?
    @@ -8548,6 +8830,7 @@ 

     
     
    +253
     254
     255
     256
    @@ -8558,14 +8841,13 @@ 

    261 262 263 -264 -265

    +264

    -
    # File 'mrblib/string.rb', line 254
    +      
    # File 'mrblib/string.rb', line 253
     
     def match(re, &block)
    -  if re.respond_to? :to_str
    +  if String === re
         if Object.const_defined?(:Regexp)
           r = Regexp.new(re)
           r.match(self, &block)
    @@ -8596,14 +8878,14 @@ 

     
     
    -244
    -245
    -246
    -247
    -248
    +830 +831 +832 +833 +834

    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 244
    +      
    # File 'mrbgems/mruby-string-ext/src/string.c', line 830
     
     static mrb_value
     mrb_str_oct(mrb_state *mrb, mrb_value self)
    @@ -8630,16 +8912,16 @@ 

     
     
    -518
    -519
    -520
    -521
    -522
    -523
    -524
    +1050 +1051 +1052 +1053 +1054 +1055 +1056

    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 518
    +      
    # File 'mrbgems/mruby-string-ext/src/string.c', line 1050
     
     static mrb_value
     mrb_str_ord(mrb_state* mrb, mrb_value str)
    @@ -8693,19 +8975,19 @@ 

     
     
    -163
    -164
    -165
    -166
    -167
    -168
    -169
    -170
    -171
    -172
    +144 +145 +146 +147 +148 +149 +150 +151 +152 +153

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 163
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 144
     
     def partition(sep)
       raise TypeError, "type mismatch: #{sep.class} given" unless sep.is_a? String
    @@ -8756,13 +9038,13 @@ 

     
     
    -364
    -365
    -366
    -367
    +345 +346 +347 +348

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 364
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 345
     
     def prepend(arg)
       self[0, 0] = arg
    @@ -8828,17 +9110,17 @@ 

     
     
    -1614
    -1615
    -1616
    -1617
    -1618
    -1619
    -1620
    -1621
    +1602 +1603 +1604 +1605 +1606 +1607 +1608 +1609

    -
    # File 'src/string.c', line 1614
    +      
    # File 'src/string.c', line 1602
     
     static mrb_value
     mrb_str_replace(mrb_state *mrb, mrb_value str)
    @@ -8909,16 +9191,16 @@ 

     
     
    -1795
    -1796
    -1797
    -1798
    -1799
    -1800
    -1801
    +1771 +1772 +1773 +1774 +1775 +1776 +1777

    -
    # File 'src/string.c', line 1795
    +      
    # File 'src/string.c', line 1771
     
     static mrb_value
     mrb_str_reverse(mrb_state *mrb, mrb_value str)
    @@ -8986,6 +9268,30 @@ 

     
     
    +1709
    +1710
    +1711
    +1712
    +1713
    +1714
    +1715
    +1716
    +1717
    +1718
    +1719
    +1720
    +1721
    +1722
    +1723
    +1724
    +1725
    +1726
    +1727
    +1728
    +1729
    +1730
    +1731
    +1732
     1733
     1734
     1735
    @@ -9012,34 +9318,10 @@ 

    1756 1757 1758 -1759 -1760 -1761 -1762 -1763 -1764 -1765 -1766 -1767 -1768 -1769 -1770 -1771 -1772 -1773 -1774 -1775 -1776 -1777 -1778 -1779 -1780 -1781 -1782 -1783

    +1759

    -
    # File 'src/string.c', line 1733
    +      
    # File 'src/string.c', line 1709
     
     static mrb_value
     mrb_str_reverse_bang(mrb_state *mrb, mrb_value str)
    @@ -9238,6 +9520,30 @@ 

     
     
    +1798
    +1799
    +1800
    +1801
    +1802
    +1803
    +1804
    +1805
    +1806
    +1807
    +1808
    +1809
    +1810
    +1811
    +1812
    +1813
    +1814
    +1815
    +1816
    +1817
    +1818
    +1819
    +1820
    +1821
     1822
     1823
     1824
    @@ -9266,34 +9572,10 @@ 

    1847 1848 1849 -1850 -1851 -1852 -1853 -1854 -1855 -1856 -1857 -1858 -1859 -1860 -1861 -1862 -1863 -1864 -1865 -1866 -1867 -1868 -1869 -1870 -1871 -1872 -1873 -1874

    - - -
    # File 'src/string.c', line 1822
    +1850
    + + +
    # File 'src/string.c', line 1798
     
     static mrb_value
     mrb_str_rindex(mrb_state *mrb, mrb_value str)
    @@ -9403,16 +9685,16 @@ 

     
     
    -313
    -314
    -315
    -316
    -317
    -318
    -319
    +294 +295 +296 +297 +298 +299 +300

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 313
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 294
     
     def rjust(idx, padstr = ' ')
       raise ArgumentError, 'zero width padding' if padstr == ''
    @@ -9466,19 +9748,19 @@ 

     
     
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    -181
    -182
    -183
    +155 +156 +157 +158 +159 +160 +161 +162 +163 +164

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 174
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 155
     
     def rpartition(sep)
       raise TypeError, "type mismatch: #{sep.class} given" unless sep.is_a? String
    @@ -9529,15 +9811,15 @@ 

     
     
    -62
    -63
    -64
    -65
    -66
    -67
    +43 +44 +45 +46 +47 +48

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 62
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 43
     
     def rstrip
       a = 0
    @@ -9582,7 +9864,7 @@ 

  • - (RuntimeError) + (FrozenError) @@ -9598,17 +9880,17 @@

     
     
    -114
    -115
    -116
    -117
    -118
    +95 +96 +97 +98 +99

  • -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 114
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 95
     
     def rstrip!
    -  raise RuntimeError, "can't modify frozen String" if frozen?
    +  raise FrozenError, "can't modify frozen String" if frozen?
       s = self.rstrip
       (s == self) ? nil : self.replace(s)
     end
    @@ -9785,15 +10067,15 @@

     
     
    -799
    -800
    -801
    -802
    -803
    -804
    +794 +795 +796 +797 +798 +799

    -
    # File 'src/string.c', line 799
    +      
    # File 'src/string.c', line 794
     
     static mrb_value
     mrb_str_size(mrb_state *mrb, mrb_value self)
    @@ -10191,6 +10473,16 @@ 

     
     
    +1120
    +1121
    +1122
    +1123
    +1124
    +1125
    +1126
    +1127
    +1128
    +1129
     1130
     1131
     1132
    @@ -10199,20 +10491,10 @@ 

    1135 1136 1137 -1138 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148

    +1138

    -
    # File 'src/string.c', line 1130
    +      
    # File 'src/string.c', line 1120
     
     static mrb_value
     mrb_str_aref_m(mrb_state *mrb, mrb_value str)
    @@ -10291,6 +10573,25 @@ 

     
     
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
     201
     202
     203
    @@ -10326,29 +10627,10 @@ 

    233 234 235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255

    +236

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 201
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 182
     
     def slice!(arg1, arg2=nil)
       raise FrozenError, "can't modify frozen String" if frozen?
    @@ -10496,6 +10778,30 @@ 

     
     
    +1893
    +1894
    +1895
    +1896
    +1897
    +1898
    +1899
    +1900
    +1901
    +1902
    +1903
    +1904
    +1905
    +1906
    +1907
    +1908
    +1909
    +1910
    +1911
    +1912
    +1913
    +1914
    +1915
    +1916
     1917
     1918
     1919
    @@ -10586,34 +10892,10 @@ 

    2004 2005 2006 -2007 -2008 -2009 -2010 -2011 -2012 -2013 -2014 -2015 -2016 -2017 -2018 -2019 -2020 -2021 -2022 -2023 -2024 -2025 -2026 -2027 -2028 -2029 -2030 -2031

    - - -
    # File 'src/string.c', line 1917
    +2007
    + + +
    # File 'src/string.c', line 1893
     
     static mrb_value
     mrb_str_split_m(mrb_state *mrb, mrb_value str)
    @@ -10736,9 +11018,9 @@ 

    -

    +

    - #start_with?([prefixes]) ⇒ Boolean + #squeeze([other_str]) ⇒ String @@ -10746,14 +11028,15 @@

    -

    Returns true if +str+ starts with one of the +prefixes+ given.

    +

    Builds a set of characters from the other_str +parameter(s) using the procedure described for String#count. Returns a +new string where runs of the same character that occur in this set are +replaced by a single character. If no arguments are given, all runs of +identical characters are replaced by a single character.

    -

    “hello”.start_with?(“hell”) #=> true

    - -

    # returns true if one of the prefixes matches. - “hello”.start_with?(“heaven”, “hell”) #=> true - “hello”.start_with?(“heaven”, “paradise”) #=> false - “h”.start_with?(“heaven”, “hell”) #=> false

    +

    “yellow moon”.squeeze #=> “yelow mon” + “ now is the”.squeeze(“ “) #=> “ now is the” + “putters shoot balls”.squeeze(“m-z”) #=> “puters shot balls”

    @@ -10775,7 +11058,7 @@

  • - (Boolean) + (String) @@ -10787,6 +11070,166 @@

    + +

  • + + + + + + +
    +
    +
    +
    +702
    +703
    +704
    +705
    +706
    +707
    +708
    +709
    +710
    +711
    +712
    +
    +
    # File 'mrbgems/mruby-string-ext/src/string.c', line 702
    +
    +static mrb_value
    +mrb_str_squeeze(mrb_state *mrb, mrb_value str)
    +{
    +  mrb_value pat = mrb_nil_value();
    +  mrb_value dup;
    +
    +  mrb_get_args(mrb, "|S", &pat);
    +  dup = mrb_str_dup(mrb, str);
    +  str_squeeze(mrb, dup, pat);
    +  return dup;
    +}
    +
    +
    + +
    +

    + + #squeeze!([other_str]) ⇒ String? + + + + + +

    +
    +

    Squeezes str in place, returning either str, or nil if no +changes were made.

    + + +
    +
    +
    + +
    +
    + + + +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (String, nil) + + + +
    • + +
    + +
    + + + + +
    + + + + + + +
    +
    +
    +
    +721
    +722
    +723
    +724
    +725
    +726
    +727
    +728
    +729
    +730
    +731
    +
    +
    # File 'mrbgems/mruby-string-ext/src/string.c', line 721
    +
    +static mrb_value
    +mrb_str_squeeze_bang(mrb_state *mrb, mrb_value str)
    +{
    +  mrb_value pat = mrb_nil_value();
    +
    +  mrb_get_args(mrb, "|S", &pat);
    +  if (str_squeeze(mrb, str, pat)) {
    +    return str;
    +  }
    +  return mrb_nil_value();
    +}
    +
    +
    + +
    +

    + + #start_with?([prefixes]) ⇒ Boolean + + + + + +

    +
    +

    Returns true if +str+ starts with one of the +prefixes+ given.

    + +

    “hello”.start_with?(“hell”) #=> true

    + +

    # returns true if one of the prefixes matches. + “hello”.start_with?(“heaven”, “hell”) #=> true + “hello”.start_with?(“heaven”, “paradise”) #=> false + “h”.start_with?(“heaven”, “hell”) #=> false

    + + +
    +
    +
    + +
    +
    + + + +
    +
    +
    +

    Returns:

      @@ -10801,6 +11244,11 @@

    +
    + + + +
    @@ -10845,7 +11293,7 @@

    for (i = 0; i < argc; i++) { size_t len_l, len_r; int ai = mrb_gc_arena_save(mrb); - sub = mrb_string_type(mrb, argv[i]); + sub = mrb_ensure_string_type(mrb, argv[i]); mrb_gc_arena_restore(mrb, ai); len_l = RSTRING_LEN(self); len_r = RSTRING_LEN(sub); @@ -10895,16 +11343,16 @@

     
     
    -78
    -79
    -80
    -81
    -82
    -83
    -84
    +59 +60 +61 +62 +63 +64 +65

    @@ -11157,18 +11605,18 @@

     
     
    -451
    -452
    -453
    -454
    -455
    -456
    -457
    -458
    -459
    +983 +984 +985 +986 +987 +988 +989 +990 +991

    @@ -12178,9 +12568,9 @@

    -

    +

    - #upcase!String? + #tr!(from_str, to_str) ⇒ String? @@ -12188,8 +12578,8 @@

    -

    Upcases the contents of str, returning nil if no changes -were made.

    +

    Translates str in place, using the same rules as String#tr. +Returns str, or nil if no changes were made.

    @@ -12232,50 +12622,30 @@

     
     
    -2397
    -2398
    -2399
    -2400
    -2401
    -2402
    -2403
    -2404
    -2405
    -2406
    -2407
    -2408
    -2409
    -2410
    -2411
    -2412
    -2413
    -2414
    -2415
    -2416
    -2417
    +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595

    @@ -12284,13 +12654,9 @@

    -

    +

    - - #upto(other_str, exclusive = false) {|s| ... } ⇒ String - - #upto(other_str, exclusive = false) ⇒ Object - + #tr_s(from_str, to_str) ⇒ String @@ -12298,44 +12664,19 @@

    -

    Iterates through successive values, starting at str and -ending at other_str inclusive, passing each value in turn to -the block. The String#succ method is used to generate -each value. If optional second argument exclusive is omitted or is false, -the last value will be included; otherwise it will be excluded.

    +

    Processes a copy of str as described under String#tr, then removes +duplicate characters in regions that were affected by the translation.

    -

    If no block is given, an enumerator is returned instead.

    - -

    “a8”.upto(“b6”) {|s| print s, ‘ ‘ } - for s in “a8”..”b6” - print s, ‘ ‘ - end

    - -

    produces:

    - -

    a8 a9 b0 b1 b2 b3 b4 b5 b6 - a8 a9 b0 b1 b2 b3 b4 b5 b6

    - -

    If str and other_str contains only ascii numeric characters, -both are recognized as decimal numbers. In addition, the width of -string (e.g. leading zeros) is handled appropriately.

    - -

    “9”.upto(“11”).to_a #=> [“9”, “10”, “11”] - “25”.upto(“5”).to_a #=> [] - “07”.upto(“11”).to_a #=> [“07”, “08”, “09”, “10”, “11”]

    +

    “hello”.tr_s(‘l’, ‘r’) #=> “hero” + “hello”.tr_s(‘el’, ‘’) #=> “ho” + “hello”.tr_s(‘el’, ‘hx’) #=> “hhxo”

    -

    Overloads:

    -
      - - -
    • - #upto(other_str, exclusive = false) {|s| ... } ⇒ String -
      +
      @@ -12344,19 +12685,6 @@

      -

      Yields:

      -
        - -
      • - - - (s) - - - -
      • - -

      Returns:

        @@ -12374,10 +12702,6 @@

      -
    • - - -
    @@ -12388,46 +12712,6 @@

     
     
    -568
    -569
    -570
    -571
    -572
    -573
    -574
    -575
    -576
    -577
    -578
    -579
    -580
    -581
    -582
    -583
    -584
    -585
    -586
    -587
    -588
    -589
    -590
    -591
    -592
    -593
    -594
    -595
    -596
    -597
    -598
    -599
    -600
    -601
    -602
    -603
    -604
    -605
    -606
    -607
     608
     609
     610
    @@ -12438,137 +12722,466 @@ 

    615 616 617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654

    - -

    + + +
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 78
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 59
     
     def strip
       a = 0
    @@ -10962,14 +11410,14 @@ 

     
     
    -127
    -128
    -129
    -130
    -131
    +108 +109 +110 +111 +112

    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 127
    +      
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 108
     
     def strip!
       raise FrozenError, "can't modify frozen String" if frozen?
    @@ -11050,12 +11498,12 @@ 

    end pattern, replace = *args - pattern = pattern.to_str + pattern.__to_str if args.length == 2 && block block = nil end unless block - replace = replace.to_str + replace.__to_str end result = [] this = dup @@ -11134,7 +11582,7 @@

    def sub!(*args, &block) raise FrozenError, "can't modify frozen String" if frozen? str = self.sub(*args, &block) - return nil if str == self + return nil unless self.index(args[0]) self.replace(str) end

    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 451
    +      
    # File 'mrbgems/mruby-string-ext/src/string.c', line 983
     
     static mrb_value
     mrb_str_succ(mrb_state *mrb, mrb_value self)
    @@ -11241,86 +11689,86 @@ 

     
     
    -373
    -374
    -375
    -376
    -377
    -378
    -379
    -380
    -381
    -382
    -383
    -384
    -385
    -386
    -387
    -388
    -389
    -390
    -391
    -392
    -393
    -394
    -395
    -396
    -397
    -398
    -399
    -400
    -401
    -402
    -403
    -404
    -405
    -406
    -407
    -408
    -409
    -410
    -411
    -412
    -413
    -414
    -415
    -416
    -417
    -418
    -419
    -420
    -421
    -422
    -423
    -424
    -425
    -426
    -427
    -428
    -429
    -430
    -431
    -432
    -433
    -434
    -435
    -436
    -437
    -438
    -439
    -440
    -441
    -442
    -443
    -444
    -445
    -446
    -447
    -448
    -449
    +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 +980 +981

    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 373
    +      
    # File 'mrbgems/mruby-string-ext/src/string.c', line 905
     
     static mrb_value
     mrb_str_succ_bang(mrb_state *mrb, mrb_value self)
    @@ -11666,14 +12114,14 @@ 

     
     
    -2365
    -2366
    -2367
    -2368
    -2369
    +2344 +2345 +2346 +2347 +2348

    -
    # File 'src/string.c', line 2365
    +      
    # File 'src/string.c', line 2344
     
     static mrb_value
     mrb_str_to_f(mrb_state *mrb, mrb_value self)
    @@ -11753,20 +12201,20 @@ 

     
     
    -2254
    -2255
    -2256
    -2257
    -2258
    -2259
    -2260
    -2261
    -2262
    -2263
    -2264
    +2233 +2234 +2235 +2236 +2237 +2238 +2239 +2240 +2241 +2242 +2243

    -
    # File 'src/string.c', line 2254
    +      
    # File 'src/string.c', line 2233
     
     static mrb_value
     mrb_str_to_i(mrb_state *mrb, mrb_value self)
    @@ -11787,11 +12235,7 @@ 

    - - #to_sString - - #to_strString - + #to_sString @@ -11806,13 +12250,7 @@

    -

    Overloads:

    -
      - - -
    • - #to_sString -
      +
      @@ -11838,40 +12276,6 @@

      -
    • - - -
    • - #to_strString -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String) - - - -
      • - -
      - -
      - - -
    • - -
    @@ -11882,17 +12286,17 @@

     
     
    -2380
    -2381
    -2382
    -2383
    -2384
    -2385
    -2386
    -2387
    +2358 +2359 +2360 +2361 +2362 +2363 +2364 +2365

    -
    # File 'src/string.c', line 2380
    +      
    # File 'src/string.c', line 2358
     
     static mrb_value
     mrb_str_to_s(mrb_state *mrb, mrb_value self)
    @@ -11910,11 +12314,7 @@ 

    - - #to_sString - - #to_strString - + #to_sString @@ -11929,44 +12329,7 @@

    -

    Overloads:

    -
      - - -
    • - #to_sString -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #to_strString -
      +
      @@ -11992,9 +12355,6 @@

      -
    • - -
    @@ -12005,17 +12365,17 @@

     
     
    -2380
    -2381
    -2382
    -2383
    -2384
    -2385
    -2386
    -2387
    +2358 +2359 +2360 +2361 +2362 +2363 +2364 +2365

    -
    # File 'src/string.c', line 2380
    +      
    # File 'src/string.c', line 2358
     
     static mrb_value
     mrb_str_to_s(mrb_state *mrb, mrb_value self)
    @@ -12073,14 +12433,14 @@ 

     
     
    -1664
    -1665
    -1666
    -1667
    -1668
    +1652 +1653 +1654 +1655 +1656

    -
    # File 'src/string.c', line 1664
    +      
    # File 'src/string.c', line 1652
     
     MRB_API mrb_value
     mrb_str_intern(mrb_state *mrb, mrb_value self)
    @@ -12093,9 +12453,9 @@ 

    -

    +

    - #upcaseString + #tr(from_str, to_str) ⇒ String @@ -12103,11 +12463,37 @@

    -

    Returns a copy of str with all lowercase letters replaced with their -uppercase counterparts. The operation is locale insensitive—only -characters ‘a’ to ‘z’ are affected.

    +

    Returns a copy of str with the characters in from_str replaced by the +corresponding characters in to_str. If to_str is shorter than from_str, +it is padded with its last character in order to maintain the +correspondence.

    -

    “hEllO”.upcase #=> “HELLO”

    +

    “hello”.tr(‘el’, ‘ip’) #=> “hippo” + “hello”.tr(‘aeiou’, ‘’) #=> “hll” + “hello”.tr(‘aeiou’, ‘AA’) #=> “hAll*”

    + +

    Both strings may use the c1-c2 notation to denote ranges of characters, +and from_str may start with a ^, which denotes all characters except +those listed.

    + +

    “hello”.tr(‘a-y’, ‘b-z’) #=> “ifmmp” + “hello”.tr(‘^aeiou’, ‘’) #=> “e**o”

    + +

    The backslash character \ can be used to escape ^ or - and is otherwise +ignored unless it appears at the end of a range or the end of the +from_str or to_str:

    + +

    “hello^world”.tr(“\^aeiou”, “”) #=> “hll*wrld” + “hello-world”.tr(“a\-eo”, “”) #=> “hll*wrld”

    + +

    “hello\r\nworld”.tr(“\r”, “”) #=> “hello\nworld” + “hello\r\nworld”.tr(“\r”, “”) #=> “hello\r\nwold” + “hello\r\nworld”.tr(“\\r”, “”) #=> “hello\nworld”

    + +

    “X[’\b’]”.tr(“X\”, “”) #=> “[‘b’]” + “X[’\b’]”.tr(“X-\]”, “”) #=> “‘b’”

    + +

    Note: conversion is effective only in ASCII region.

    @@ -12150,27 +12536,31 @@

     
     
    -2430
    -2431
    -2432
    -2433
    -2434
    -2435
    -2436
    -2437
    -2438
    +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576

    -
    # File 'src/string.c', line 2430
    +      
    # File 'mrbgems/mruby-string-ext/src/string.c', line 566
     
     static mrb_value
    -mrb_str_upcase(mrb_state *mrb, mrb_value self)
    +mrb_str_tr(mrb_state *mrb, mrb_value str)
     {
    -  mrb_value str;
    +  mrb_value dup;
    +  mrb_value p1, p2;
     
    -  str = mrb_str_dup(mrb, self);
    -  mrb_str_upcase_bang(mrb, str);
    -  return str;
    +  mrb_get_args(mrb, "SS", &p1, &p2);
    +  dup = mrb_str_dup(mrb, str);
    +  str_tr(mrb, dup, p1, p2, FALSE);
    +  return dup;
     }
    -
    # File 'src/string.c', line 2397
    +      
    # File 'mrbgems/mruby-string-ext/src/string.c', line 585
     
     static mrb_value
    -mrb_str_upcase_bang(mrb_state *mrb, mrb_value str)
    +mrb_str_tr_bang(mrb_state *mrb, mrb_value str)
     {
    -  struct RString *s = mrb_str_ptr(str);
    -  char *p, *pend;
    -  mrb_bool modify = FALSE;
    +  mrb_value p1, p2;
     
    -  mrb_str_modify(mrb, s);
    -  p = RSTRING_PTR(str);
    -  pend = RSTRING_END(str);
    -  while (p < pend) {
    -    if (ISLOWER(*p)) {
    -      *p = TOUPPER(*p);
    -      modify = TRUE;
    -    }
    -    p++;
    +  mrb_get_args(mrb, "SS", &p1, &p2);
    +  if (str_tr(mrb, str, p1, p2, FALSE)) {
    +    return str;
       }
    -
    -  if (modify) return str;
       return mrb_nil_value();
     }
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 568
    +618
    +
    +
    # File 'mrbgems/mruby-string-ext/src/string.c', line 608
     
     static mrb_value
    -mrb_str_upto(mrb_state *mrb, mrb_value beg)
    +mrb_str_tr_s(mrb_state *mrb, mrb_value str)
     {
    -  mrb_value end;
    -  mrb_value exclusive = mrb_false_value();
    -  mrb_value block = mrb_nil_value();
    -  mrb_value current, after_end;
    -  mrb_int n;
    -  mrb_bool excl;
    -
    -  mrb_get_args(mrb, "o|o&", &end, &exclusive, &block);
    +  mrb_value dup;
    +  mrb_value p1, p2;
     
    -  if (mrb_nil_p(block)) {
    -    return mrb_funcall(mrb, beg, "to_enum", 3, mrb_symbol_value(mrb_intern_lit(mrb, "upto")), end, exclusive);
    -  }
    -  end = mrb_string_type(mrb, end);
    -  excl = mrb_test(exclusive);
    -
    -  /* single character */
    -  if (RSTRING_LEN(beg) == 1 && RSTRING_LEN(end) == 1 &&
    -  ISASCII(RSTRING_PTR(beg)[0]) && ISASCII(RSTRING_PTR(end)[0])) {
    -    char c = RSTRING_PTR(beg)[0];
    -    char e = RSTRING_PTR(end)[0];
    -    int ai = mrb_gc_arena_save(mrb);
    +  mrb_get_args(mrb, "SS", &p1, &p2);
    +  dup = mrb_str_dup(mrb, str);
    +  str_tr(mrb, dup, p1, p2, TRUE);
    +  return dup;
    +}
    +
    +
    + +
    +

    + + #tr_s!(from_str, to_str) ⇒ String? + - if (c > e || (excl && c == e)) return beg; - for (;;) { - mrb_yield(mrb, block, mrb_str_new(mrb, &c, 1)); - mrb_gc_arena_restore(mrb, ai); - if (!excl && c == e) break; - c++; - if (excl && c == e) break; - } - return beg; - } - /* both edges are all digits */ - if (ISDIGIT(RSTRING_PTR(beg)[0]) && ISDIGIT(RSTRING_PTR(end)[0]) && - all_digits_p(RSTRING_PTR(beg), RSTRING_LEN(beg)) && - all_digits_p(RSTRING_PTR(end), RSTRING_LEN(end))) { - mrb_int min_width = RSTRING_LEN(beg); - mrb_int bi = mrb_int(mrb, mrb_str_to_inum(mrb, beg, 10, FALSE)); - mrb_int ei = mrb_int(mrb, mrb_str_to_inum(mrb, end, 10, FALSE)); - int ai = mrb_gc_arena_save(mrb); + - while (bi <= ei) { - mrb_value ns, str; + +

    +
    +

    Performs String#tr_s processing on str in place, returning +str, or nil if no changes were made.

    - if (excl && bi == ei) break; - ns = mrb_format(mrb, "%S", mrb_fixnum_value(bi)); - if (min_width > RSTRING_LEN(ns)) { - str = mrb_str_new(mrb, NULL, min_width); - memset(RSTRING_PTR(str), '0', min_width-RSTRING_LEN(ns)); - memcpy(RSTRING_PTR(str)+min_width-RSTRING_LEN(ns), - RSTRING_PTR(ns), RSTRING_LEN(ns)); - } - else { - str = ns; - } - mrb_yield(mrb, block, str); - mrb_gc_arena_restore(mrb, ai); - bi++; - } - return beg; - } - /* normal case */ - n = mrb_int(mrb, mrb_funcall(mrb, beg, "<=>", 1, end)); - if (n > 0 || (excl && n == 0)) return beg; +
    +
    +
    + +
    +
    + - after_end = mrb_funcall(mrb, end, "succ", 0); - current = mrb_str_dup(mrb, beg); - while (!mrb_str_equal(mrb, current, after_end)) { - int ai = mrb_gc_arena_save(mrb); - mrb_value next = mrb_nil_value(); - if (excl || !mrb_str_equal(mrb, current, end)) - next = mrb_funcall(mrb, current, "succ", 0); - mrb_yield(mrb, block, current); - if (mrb_nil_p(next)) break; - current = mrb_str_to_str(mrb, next); - if (excl && mrb_str_equal(mrb, current, end)) break; - if (RSTRING_LEN(current) > RSTRING_LEN(end) || RSTRING_LEN(current) == 0) - break; - mrb_gc_arena_restore(mrb, ai); - } - return beg; +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (String, nil) + + + +
    • + +
    + +
    + + + + +
    + + + + +
    +
    +
    +
    +627
    +628
    +629
    +630
    +631
    +632
    +633
    +634
    +635
    +636
    +637
    +
    +
    # File 'mrbgems/mruby-string-ext/src/string.c', line 627
    +
    +static mrb_value
    +mrb_str_tr_s_bang(mrb_state *mrb, mrb_value str)
    +{
    +  mrb_value p1, p2;
    +
    +  mrb_get_args(mrb, "SS", &p1, &p2);
    +  if (str_tr(mrb, str, p1, p2, TRUE)) {
    +    return str;
    +  }
    +  return mrb_nil_value();
     }
    +
    + +
    +

    + + #upcaseString + + + + + +

    +
    +

    Returns a copy of str with all lowercase letters replaced with their +uppercase counterparts. The operation is locale insensitive—only +characters ‘a’ to ‘z’ are affected.

    + +

    “hEllO”.upcase #=> “HELLO”

    + + +
    +
    +
    + +
    +
    + + + +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (String) + + + +
    • + +
    + +
    + + + + +
    + + + + + + +
    +
    +
    +
    +2408
    +2409
    +2410
    +2411
    +2412
    +2413
    +2414
    +2415
    +2416
    +
    +
    # File 'src/string.c', line 2408
    +
    +static mrb_value
    +mrb_str_upcase(mrb_state *mrb, mrb_value self)
    +{
    +  mrb_value str;
    +
    +  str = mrb_str_dup(mrb, self);
    +  mrb_str_upcase_bang(mrb, str);
    +  return str;
    +}
    +
    +
    + +
    +

    + + #upcase!String? + + + + + +

    +
    +

    Upcases the contents of str, returning nil if no changes +were made.

    + + +
    +
    +
    + +
    +
    + + + +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (String, nil) + + + +
    • + +
    + +
    + + + + +
    + + + + + + +
    +
    +
    +
    +2375
    +2376
    +2377
    +2378
    +2379
    +2380
    +2381
    +2382
    +2383
    +2384
    +2385
    +2386
    +2387
    +2388
    +2389
    +2390
    +2391
    +2392
    +2393
    +2394
    +2395
    +
    +
    # File 'src/string.c', line 2375
    +
    +static mrb_value
    +mrb_str_upcase_bang(mrb_state *mrb, mrb_value str)
    +{
    +  struct RString *s = mrb_str_ptr(str);
    +  char *p, *pend;
    +  mrb_bool modify = FALSE;
    +
    +  mrb_str_modify(mrb, s);
    +  p = RSTRING_PTR(str);
    +  pend = RSTRING_END(str);
    +  while (p < pend) {
    +    if (ISLOWER(*p)) {
    +      *p = TOUPPER(*p);
    +      modify = TRUE;
    +    }
    +    p++;
    +  }
    +
    +  if (modify) return str;
    +  return mrb_nil_value();
    +}
    +
    +
    + +
    +

    + + #upto(max, exclusive = false, &block) ⇒ Object + + + + + +

    +
    +

    call-seq: + str.upto(other_str, exclusive=false) {|s| block } -> str + str.upto(other_str, exclusive=false) -> an_enumerator

    + +

    Iterates through successive values, starting at str and + ending at other_str inclusive, passing each value in turn to + the block. The String#succ method is used to generate + each value. If optional second argument exclusive is omitted or is false, + the last value will be included; otherwise it will be excluded.

    + +

    If no block is given, an enumerator is returned instead.

    + +
    "a8".upto("b6") {|s| print s, ' ' }
    +for s in "a8".."b6"
    +  print s, ' '
    +end
    +
    + +

    produces:

    + +
    a8 a9 b0 b1 b2 b3 b4 b5 b6
    +a8 a9 b0 b1 b2 b3 b4 b5 b6
    +
    + +

    If str and other_str contains only ascii numeric characters, + both are recognized as decimal numbers. In addition, the width of + string (e.g. leading zeros) is handled appropriately.

    + +
    "9".upto("11").to_a   #=> ["9", "10", "11"]
    +"25".upto("5").to_a   #=> []
    +"07".upto("11").to_a  #=> ["07", "08", "09", "10", "11"]
    +
    + + +
    +
    +
    + +

    Raises:

    + + +
    + + + + + + +
    +
    +
    +
    +401
    +402
    +403
    +404
    +405
    +406
    +407
    +408
    +409
    +410
    +411
    +412
    +413
    +414
    +415
    +416
    +417
    +418
    +419
    +420
    +421
    +422
    +423
    +424
    +425
    +426
    +427
    +428
    +429
    +430
    +431
    +432
    +433
    +434
    +435
    +436
    +437
    +438
    +439
    +440
    +441
    +442
    +
    +
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 401
    +
    +def upto(max, exclusive=false, &block)
    +  return to_enum(:upto, max, exclusive) unless block
    +  raise TypeError, "no implicit conversion of #{max.class} into String" unless max.kind_of? String
    +
    +  len = self.length
    +  maxlen = max.length
    +  # single character
    +  if len == 1 and maxlen == 1
    +    c = self.ord
    +    e = max.ord
    +    while c <= e
    +      break if exclusive and c == e
    +      yield c.chr
    +      c += 1
    +    end
    +    return self
    +  end
    +  # both edges are all digits
    +  bi = self.to_i(10)
    +  ei = max.to_i(10)
    +  len = self.length
    +  if (bi > 0 or bi == "0"*len) and (ei > 0 or ei == "0"*maxlen)
    +    while bi <= ei
    +      break if exclusive and bi == ei
    +      s = bi.to_s
    +      s = s.rjust(len, "0") if s.length < len
    +      yield s
    +      bi += 1
    +    end
    +    return self
    +  end
    +  bs = self
    +  while true
    +    n = (bs <=> max)
    +    break if n > 0
    +    break if exclusive and n == 0
    +    yield bs
    +    break if n == 0
    +    bs = bs.succ
    +  end
    +  self
    +end
    +
    @@ -12576,9 +13189,9 @@

    diff --git a/docs/api/Struct.html b/docs/api/Struct.html index 2b4b611..ba3d0e5 100644 --- a/docs/api/Struct.html +++ b/docs/api/Struct.html @@ -6,7 +6,7 @@ Class: Struct - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -209,6 +209,29 @@

    + + + +
  • + + + #dig(idx, *args) ⇒ Object + + + + + + + + + + + + + +

    call-seq: hsh.dig(key,…) -> object.

    +
    +
  • @@ -571,7 +594,6 @@

     
     
    -354
     355
     356
     357
    @@ -579,10 +601,11 @@ 

    359 360 361 -362

    +362 +363

    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 354
    +      
    # File 'mrbgems/mruby-struct/src/struct.c', line 355
     
     static mrb_value
     mrb_struct_initialize(mrb_state *mrb, mrb_value self)
    @@ -669,7 +692,6 @@ 

     
     
    -558
     559
     560
     561
    @@ -696,10 +718,11 @@ 

    582 583 584 -585

    +585 +586

    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 558
    +      
    # File 'mrbgems/mruby-struct/src/struct.c', line 559
     
     static mrb_value
     mrb_struct_equal(mrb_state *mrb, mrb_value s)
    @@ -843,7 +866,6 @@ 

     
     
    -439
     440
     441
     442
    @@ -861,10 +883,11 @@ 

    454 455 456 -457

    +457 +458

    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 439
    +      
    # File 'mrbgems/mruby-struct/src/struct.c', line 440
     
     static mrb_value
     mrb_struct_aref(mrb_state *mrb, mrb_value s)
    @@ -1001,7 +1024,6 @@ 

     
     
    -503
     504
     505
     506
    @@ -1036,10 +1058,11 @@ 

    535 536 537 -538

    +538 +539

    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 503
    +      
    # File 'mrbgems/mruby-struct/src/struct.c', line 504
     
     static mrb_value
     mrb_struct_aset(mrb_state *mrb, mrb_value s)
    @@ -1130,6 +1153,63 @@ 

    + + +
    +

    + + #dig(idx, *args) ⇒ Object + + + + + +

    +
    +

    call-seq: + hsh.dig(key,…) -> object

    + +

    Extracts the nested value specified by the sequence of key +objects by calling +dig+ at each step, returning +nil+ if any +intermediate step is +nil+.

    + + +
    +
    +
    + + +
    + + + + + + +
    +
    +
    +
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +
    +
    # File 'mrbgems/mruby-struct/mrblib/struct.rb', line 93
    +
    +def dig(idx,*args)
    +  n = self[idx]
    +  if args.size > 0
    +    n&.dig(*args)
    +  else
    +    n
    +  end
    +end
    +
    @@ -1279,7 +1359,6 @@

     
     
    -595
     596
     597
     598
    @@ -1306,10 +1385,11 @@ 

    619 620 621 -622

    +622 +623

    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 595
    +      
    # File 'mrbgems/mruby-struct/src/struct.c', line 596
     
     static mrb_value
     mrb_struct_eql(mrb_state *mrb, mrb_value s)
    @@ -1371,7 +1451,6 @@ 

     
     
    -366
     367
     368
     369
    @@ -1387,10 +1466,11 @@ 

    379 380 381 -382

    +382 +383

    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 366
    +      
    # File 'mrbgems/mruby-struct/src/struct.c', line 367
     
     static mrb_value
     mrb_struct_init_copy(mrb_state *mrb, mrb_value copy)
    @@ -1572,14 +1652,14 @@ 

     
     
    -631
     632
     633
     634
    -635
    +635 +636

    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 631
    +      
    # File 'mrbgems/mruby-struct/src/struct.c', line 632
     
     static mrb_value
     mrb_struct_len(mrb_state *mrb, mrb_value self)
    @@ -1650,14 +1730,14 @@ 

     
     
    +110
     111
     112
     113
    -114
    -115
    +114

    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 111
    +      
    # File 'mrbgems/mruby-struct/src/struct.c', line 110
     
     static mrb_value
     mrb_struct_members(mrb_state *mrb, mrb_value obj)
    @@ -1823,14 +1903,14 @@ 

     
     
    -631
     632
     633
     634
    -635
    +635 +636

    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 631
    +      
    # File 'mrbgems/mruby-struct/src/struct.c', line 632
     
     static mrb_value
     mrb_struct_len(mrb_state *mrb, mrb_value self)
    @@ -1940,14 +2020,14 @@ 

     
     
    -644
     645
     646
     647
    -648
    +648 +649

    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 644
    +      
    # File 'mrbgems/mruby-struct/src/struct.c', line 645
     
     static mrb_value
     mrb_struct_to_a(mrb_state *mrb, mrb_value self)
    @@ -2013,7 +2093,6 @@ 

     
     
    -656
     657
     658
     659
    @@ -2027,10 +2106,11 @@ 

    667 668 669 -670

    +670 +671

    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 656
    +      
    # File 'mrbgems/mruby-struct/src/struct.c', line 657
     
     static mrb_value
     mrb_struct_to_h(mrb_state *mrb, mrb_value self)
    @@ -2150,14 +2230,14 @@ 

     
     
    -644
     645
     646
     647
    -648
    +648 +649

    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 644
    +      
    # File 'mrbgems/mruby-struct/src/struct.c', line 645
     
     static mrb_value
     mrb_struct_to_a(mrb_state *mrb, mrb_value self)
    @@ -2184,7 +2264,6 @@ 

     
     
    -672
     673
     674
     675
    @@ -2193,10 +2272,11 @@ 

    678 679 680 -681

    +681 +682

    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 672
    +      
    # File 'mrbgems/mruby-struct/src/struct.c', line 673
     
     static mrb_value
     mrb_struct_values_at(mrb_state *mrb, mrb_value self)
    @@ -2218,9 +2298,9 @@ 

    diff --git a/docs/api/Symbol.html b/docs/api/Symbol.html index 461d625..d933073 100644 --- a/docs/api/Symbol.html +++ b/docs/api/Symbol.html @@ -6,7 +6,7 @@ Class: Symbol - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -104,7 +104,7 @@
    Defined in:
    src/symbol.c,
    - mrbgems/mruby-symbol-ext/mrblib/symbol.rb
    + mrblib/symbol.rb,
    mrbgems/mruby-symbol-ext/mrblib/symbol.rb
    @@ -157,29 +157,6 @@

    15.2.11.3.5(x).

    - - - -
  • - - - #==(obj) ⇒ Boolean - - - - - - - - - - - - - -

    Equality—If sym and obj are exactly the same symbol, returns true.

    -
    -
  • @@ -485,38 +462,39 @@

     
     
    -449
    -450
    -451
    -452
    -453
    -454
    -455
    -456
    -457
    -458
    -459
    -460
    -461
    -462
    -463
    -464
    -465
    -466
    -467
    -468
    -469
    -470
    -471
    -472
    -473
    -474
    -475
    -476
    -477
    +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566

    -
    # File 'src/symbol.c', line 449
    +      
    # File 'src/symbol.c', line 537
     
     static mrb_value
     sym_cmp(mrb_state *mrb, mrb_value s1)
    @@ -533,9 +511,10 @@ 

    const char *p1, *p2; int retval; mrb_int len, len1, len2; + char buf1[8], buf2[8]; - p1 = mrb_sym2name_len(mrb, sym1, &len1); - p2 = mrb_sym2name_len(mrb, sym2, &len2); + p1 = sym2name_len(mrb, sym1, buf1, &len1); + p2 = sym2name_len(mrb, sym2, buf2, &len2); len = lesser(len1, len2); retval = memcmp(p1, p2, len); if (retval == 0) { @@ -550,88 +529,6 @@

    - - -
    -

    - - #==(obj) ⇒ Boolean - - - - - -

    -
    -

    Equality—If sym and obj are exactly the same -symbol, returns true.

    - - -
    -
    -
    - -
    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -222
    -223
    -224
    -225
    -226
    -227
    -228
    -229
    -230
    -
    -
    # File 'src/symbol.c', line 222
    -
    -static mrb_value
    -sym_equal(mrb_state *mrb, mrb_value sym1)
    -{
    -  mrb_value sym2;
    -
    -  mrb_get_args(mrb, "o", &sym2);
    -
    -  return mrb_bool_value(mrb_obj_equal(mrb, sym1, sym2));
    -}
    -
    @@ -664,12 +561,12 @@

     
     
    -18
    -19
    -20
    +12 +13 +14

    -
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 18
    +      
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 12
     
     def capitalize
       (self.to_s.capitalize! || self).to_sym
    @@ -709,15 +606,15 @@ 

     
     
    -48
    -49
    -50
    -51
    -52
    -53
    +42 +43 +44 +45 +46 +47

    -
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 48
    +      
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 42
     
     def casecmp(other)
       return nil unless other.kind_of?(Symbol)
    @@ -774,14 +671,14 @@ 

     
     
    -62
    -63
    -64
    -65
    -66
    +56 +57 +58 +59 +60

    -
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 62
    +      
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 56
     
     def casecmp?(sym)
       c = self.casecmp(sym)
    @@ -823,12 +720,12 @@ 

     
     
    -28
    -29
    -30
    +22 +23 +24

    -
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 28
    +      
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 22
     
     def downcase
       (self.to_s.downcase! || self).to_sym
    @@ -881,12 +778,12 @@ 

     
     
    -74
    -75
    -76
    +68 +69 +70

    -
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 74
    +      
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 68
     
     def empty?
       self.length == 0
    @@ -996,29 +893,19 @@ 

     
     
    -243
    -244
    -245
    -246
    -247
    -248
    -249
    -250
    -251
    -252
    +326 +327 +328 +329 +330

    -
    # File 'src/symbol.c', line 243
    +      
    # File 'src/symbol.c', line 326
     
     static mrb_value
    -mrb_sym_to_s(mrb_state *mrb, mrb_value sym)
    +sym_to_s(mrb_state *mrb, mrb_value sym)
     {
    -  mrb_sym id = mrb_symbol(sym);
    -  const char *p;
    -  mrb_int len;
    -
    -  p = mrb_sym2name_len(mrb, id, &len);
    -  return mrb_str_new_static(mrb, p, len);
    +  return mrb_sym2str(mrb, mrb_symbol(sym));
     }
    @@ -1052,32 +939,32 @@

     
     
    -397
    -398
    -399
    -400
    -401
    -402
    -403
    -404
    -405
    -406
    -407
    -408
    -409
    -410
    -411
    -412
    -413
    -414
    -415
    -416
    -417
    -418
    -419
    +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497

    -
    # File 'src/symbol.c', line 397
    +      
    # File 'src/symbol.c', line 475
     
     static mrb_value
     sym_inspect(mrb_state *mrb, mrb_value sym)
    @@ -1122,14 +1009,14 @@ 

     
     
    -6
    -7
    -8
    -9
    -10
    +2 +3 +4 +5 +6

    -
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 6
    +      
    # File 'mrblib/symbol.rb', line 2
     
     def to_proc
       ->(obj,*args,&block) do
    @@ -1241,29 +1128,19 @@ 

     
     
    -243
    -244
    -245
    -246
    -247
    -248
    -249
    -250
    -251
    -252
    +326 +327 +328 +329 +330

    -
    # File 'src/symbol.c', line 243
    +      
    # File 'src/symbol.c', line 326
     
     static mrb_value
    -mrb_sym_to_s(mrb_state *mrb, mrb_value sym)
    +sym_to_s(mrb_state *mrb, mrb_value sym)
     {
    -  mrb_sym id = mrb_symbol(sym);
    -  const char *p;
    -  mrb_int len;
    -
    -  p = mrb_sym2name_len(mrb, id, &len);
    -  return mrb_str_new_static(mrb, p, len);
    +  return mrb_sym2str(mrb, mrb_symbol(sym));
     }
    @@ -1307,14 +1184,14 @@

     
     
    -265
    -266
    -267
    -268
    -269
    +343 +344 +345 +346 +347

    -
    # File 'src/symbol.c', line 265
    +      
    # File 'src/symbol.c', line 343
     
     static mrb_value
     sym_to_sym(mrb_state *mrb, mrb_value sym)
    @@ -1356,12 +1233,12 @@ 

     
     
    -38
    -39
    -40
    +32 +33 +34

    -
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 38
    +      
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 32
     
     def upcase
       (self.to_s.upcase! || self).to_sym
    @@ -1376,9 +1253,9 @@ 

    diff --git a/docs/api/SystemStackError.html b/docs/api/SystemStackError.html index 6cb3269..26fd358 100644 --- a/docs/api/SystemStackError.html +++ b/docs/api/SystemStackError.html @@ -6,7 +6,7 @@ Exception: SystemStackError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -146,9 +146,9 @@

    Constructor Details

    diff --git a/docs/api/TCPServer.html b/docs/api/TCPServer.html index e958263..5de9369 100644 --- a/docs/api/TCPServer.html +++ b/docs/api/TCPServer.html @@ -6,7 +6,7 @@ Class: TCPServer - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -518,9 +518,9 @@

    diff --git a/docs/api/TCPSocket.html b/docs/api/TCPSocket.html index 1b6b3a7..759429a 100644 --- a/docs/api/TCPSocket.html +++ b/docs/api/TCPSocket.html @@ -6,7 +6,7 @@ Class: TCPSocket - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -371,9 +371,9 @@

    diff --git a/docs/api/Time.html b/docs/api/Time.html index 7eac660..33a252e 100644 --- a/docs/api/Time.html +++ b/docs/api/Time.html @@ -6,7 +6,7 @@ Class: Time - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -1087,10 +1087,6 @@

     
     
    -651
    -652
    -653
    -654
     655
     656
     657
    @@ -1111,10 +1107,14 @@ 

    672 673 674 -675

    +675 +676 +677 +678 +679

    -
    # File 'mrbgems/mruby-time/src/time.c', line 651
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 655
     
     static mrb_value
     mrb_time_initialize(mrb_state *mrb, mrb_value self)
    @@ -1180,19 +1180,19 @@ 

     
     
    -474
    -475
    -476
    -477
     478
     479
     480
     481
     482
    -483
    +483 +484 +485 +486 +487

    -
    # File 'mrbgems/mruby-time/src/time.c', line 474
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 478
     
     static mrb_value
     mrb_time_plus(mrb_state *mrb, mrb_value self)
    @@ -1236,10 +1236,6 @@ 

     
     
    -485
    -486
    -487
    -488
     489
     490
     491
    @@ -1255,10 +1251,14 @@ 

    501 502 503 -504

    +504 +505 +506 +507 +508

    -
    # File 'mrbgems/mruby-time/src/time.c', line 485
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 489
     
     static mrb_value
     mrb_time_minus(mrb_state *mrb, mrb_value self)
    @@ -1312,10 +1312,6 @@ 

     
     
    -448
    -449
    -450
    -451
     452
     453
     454
    @@ -1336,10 +1332,14 @@ 

    469 470 471 -472

    +472 +473 +474 +475 +476

    -
    # File 'mrbgems/mruby-time/src/time.c', line 448
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 452
     
     static mrb_value
     mrb_time_cmp(mrb_state *mrb, mrb_value self)
    @@ -1398,10 +1398,6 @@ 

     
     
    -433
    -434
    -435
    -436
     437
     438
     439
    @@ -1411,10 +1407,14 @@ 

    443 444 445 -446

    +446 +447 +448 +449 +450

    -
    # File 'mrbgems/mruby-time/src/time.c', line 433
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 437
     
     static mrb_value
     mrb_time_eq(mrb_state *mrb, mrb_value self)
    @@ -1462,10 +1462,6 @@ 

     
     
    -556
    -557
    -558
    -559
     560
     561
     562
    @@ -1488,10 +1484,14 @@ 

    579 580 581 -582

    +582 +583 +584 +585 +586

    -
    # File 'mrbgems/mruby-time/src/time.c', line 556
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 560
     
     static mrb_value
     mrb_time_asctime(mrb_state *mrb, mrb_value self)
    @@ -1552,10 +1552,6 @@ 

     
     
    -556
    -557
    -558
    -559
     560
     561
     562
    @@ -1578,10 +1574,14 @@ 

    579 580 581 -582

    +582 +583 +584 +585 +586

    -
    # File 'mrbgems/mruby-time/src/time.c', line 556
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 560
     
     static mrb_value
     mrb_time_asctime(mrb_state *mrb, mrb_value self)
    @@ -1642,17 +1642,17 @@ 

     
     
    -586
    -587
    -588
    -589
     590
     591
     592
    -593
    +593 +594 +595 +596 +597

    -
    # File 'mrbgems/mruby-time/src/time.c', line 586
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 590
     
     static mrb_value
     mrb_time_day(mrb_state *mrb, mrb_value self)
    @@ -1707,17 +1707,17 @@ 

     
     
    -598
    -599
    -600
    -601
     602
     603
     604
    -605
    +605 +606 +607 +608 +609

    -
    # File 'mrbgems/mruby-time/src/time.c', line 598
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 602
     
     static mrb_value
     mrb_time_dst_p(mrb_state *mrb, mrb_value self)
    @@ -1810,10 +1810,6 @@ 

     
     
    -610
    -611
    -612
    -613
     614
     615
     616
    @@ -1821,10 +1817,14 @@ 

    618 619 620 -621

    +621 +622 +623 +624 +625

    -
    # File 'mrbgems/mruby-time/src/time.c', line 610
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 614
     
     static mrb_value
     mrb_time_getutc(mrb_state *mrb, mrb_value self)
    @@ -1835,7 +1835,7 @@ 

    tm2 = (struct mrb_time *)mrb_malloc(mrb, sizeof(*tm)); *tm2 = *tm; tm2->timezone = MRB_TIMEZONE_UTC; - time_update_datetime(mrb, tm2); + time_update_datetime(mrb, tm2, TRUE); return mrb_time_wrap(mrb, mrb_obj_class(mrb, self), tm2); }

    @@ -1870,10 +1870,6 @@

     
     
    -625
    -626
    -627
    -628
     629
     630
     631
    @@ -1881,10 +1877,14 @@ 

    633 634 635 -636

    +636 +637 +638 +639 +640

    -
    # File 'mrbgems/mruby-time/src/time.c', line 625
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 629
     
     static mrb_value
     mrb_time_getlocal(mrb_state *mrb, mrb_value self)
    @@ -1895,7 +1895,7 @@ 

    tm2 = (struct mrb_time *)mrb_malloc(mrb, sizeof(*tm)); *tm2 = *tm; tm2->timezone = MRB_TIMEZONE_LOCAL; - time_update_datetime(mrb, tm2); + time_update_datetime(mrb, tm2, TRUE); return mrb_time_wrap(mrb, mrb_obj_class(mrb, self), tm2); }

    @@ -1930,10 +1930,6 @@

     
     
    -610
    -611
    -612
    -613
     614
     615
     616
    @@ -1941,10 +1937,14 @@ 

    618 619 620 -621

    +621 +622 +623 +624 +625

    -
    # File 'mrbgems/mruby-time/src/time.c', line 610
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 614
     
     static mrb_value
     mrb_time_getutc(mrb_state *mrb, mrb_value self)
    @@ -1955,7 +1955,7 @@ 

    tm2 = (struct mrb_time *)mrb_malloc(mrb, sizeof(*tm)); *tm2 = *tm; tm2->timezone = MRB_TIMEZONE_UTC; - time_update_datetime(mrb, tm2); + time_update_datetime(mrb, tm2, TRUE); return mrb_time_wrap(mrb, mrb_obj_class(mrb, self), tm2); }

    @@ -2003,17 +2003,17 @@

     
     
    -815
    -816
    -817
    -818
     819
     820
     821
    -822
    +822 +823 +824 +825 +826

    -
    # File 'mrbgems/mruby-time/src/time.c', line 815
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 819
     
     static mrb_value
     mrb_time_utc_p(mrb_state *mrb, mrb_value self)
    @@ -2055,19 +2055,19 @@ 

     
     
    -802
    -803
    -804
    -805
     806
     807
     808
     809
     810
    -811
    +811 +812 +813 +814 +815

    -
    # File 'mrbgems/mruby-time/src/time.c', line 802
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 806
     
     static mrb_value
     mrb_time_utc(mrb_state *mrb, mrb_value self)
    @@ -2076,7 +2076,7 @@ 

    tm = time_get_ptr(mrb, self); tm->timezone = MRB_TIMEZONE_UTC; - time_update_datetime(mrb, tm); + time_update_datetime(mrb, tm, FALSE); return self; }

    @@ -2111,17 +2111,17 @@

     
     
    -640
    -641
    -642
    -643
     644
     645
     646
    -647
    +647 +648 +649 +650 +651

    -
    # File 'mrbgems/mruby-time/src/time.c', line 640
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 644
     
     static mrb_value
     mrb_time_hour(mrb_state *mrb, mrb_value self)
    @@ -2163,10 +2163,6 @@ 

     
     
    -679
    -680
    -681
    -682
     683
     684
     685
    @@ -2185,10 +2181,14 @@ 

    698 699 700 -701

    +701 +702 +703 +704 +705

    -
    # File 'mrbgems/mruby-time/src/time.c', line 679
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 683
     
     static mrb_value
     mrb_time_initialize_copy(mrb_state *mrb, mrb_value copy)
    @@ -2245,10 +2245,6 @@ 

     
     
    -556
    -557
    -558
    -559
     560
     561
     562
    @@ -2271,10 +2267,14 @@ 

    579 580 581 -582

    +582 +583 +584 +585 +586

    -
    # File 'mrbgems/mruby-time/src/time.c', line 556
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 560
     
     static mrb_value
     mrb_time_asctime(mrb_state *mrb, mrb_value self)
    @@ -2335,19 +2335,19 @@ 

     
     
    -705
    -706
    -707
    -708
     709
     710
     711
     712
     713
    -714
    +714 +715 +716 +717 +718

    -
    # File 'mrbgems/mruby-time/src/time.c', line 705
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 709
     
     static mrb_value
     mrb_time_localtime(mrb_state *mrb, mrb_value self)
    @@ -2356,7 +2356,7 @@ 

    tm = time_get_ptr(mrb, self); tm->timezone = MRB_TIMEZONE_LOCAL; - time_update_datetime(mrb, tm); + time_update_datetime(mrb, tm, FALSE); return self; }

    @@ -2391,17 +2391,17 @@

     
     
    -718
    -719
    -720
    -721
     722
     723
     724
    -725
    +725 +726 +727 +728 +729

    -
    # File 'mrbgems/mruby-time/src/time.c', line 718
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 722
     
     static mrb_value
     mrb_time_mday(mrb_state *mrb, mrb_value self)
    @@ -2443,17 +2443,17 @@ 

     
     
    -729
    -730
    -731
    -732
     733
     734
     735
    -736
    +736 +737 +738 +739 +740

    -
    # File 'mrbgems/mruby-time/src/time.c', line 729
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 733
     
     static mrb_value
     mrb_time_min(mrb_state *mrb, mrb_value self)
    @@ -2495,17 +2495,17 @@ 

     
     
    -740
    -741
    -742
    -743
     744
     745
     746
    -747
    +747 +748 +749 +750 +751

    -
    # File 'mrbgems/mruby-time/src/time.c', line 740
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 744
     
     static mrb_value
     mrb_time_mon(mrb_state *mrb, mrb_value self)
    @@ -2598,17 +2598,17 @@ 

     
     
    -740
    -741
    -742
    -743
     744
     745
     746
    -747
    +747 +748 +749 +750 +751

    -
    # File 'mrbgems/mruby-time/src/time.c', line 740
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 744
     
     static mrb_value
     mrb_time_mon(mrb_state *mrb, mrb_value self)
    @@ -2701,17 +2701,17 @@ 

     
     
    -751
    -752
    -753
    -754
     755
     756
     757
    -758
    +758 +759 +760 +761 +762

    -
    # File 'mrbgems/mruby-time/src/time.c', line 751
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 755
     
     static mrb_value
     mrb_time_sec(mrb_state *mrb, mrb_value self)
    @@ -2855,17 +2855,17 @@ 

     
     
    -763
    -764
    -765
    -766
     767
     768
     769
    -770
    +770 +771 +772 +773 +774

    -
    # File 'mrbgems/mruby-time/src/time.c', line 763
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 767
     
     static mrb_value
     mrb_time_to_f(mrb_state *mrb, mrb_value self)
    @@ -2907,20 +2907,20 @@ 

     
     
    -774
    -775
    -776
    -777
     778
     779
     780
     781
     782
     783
    -784
    +784 +785 +786 +787 +788

    -
    # File 'mrbgems/mruby-time/src/time.c', line 774
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 778
     
     static mrb_value
     mrb_time_to_i(mrb_state *mrb, mrb_value self)
    @@ -2965,10 +2965,6 @@ 

     
     
    -556
    -557
    -558
    -559
     560
     561
     562
    @@ -2991,10 +2987,14 @@ 

    579 580 581 -582

    +582 +583 +584 +585 +586

    -
    # File 'mrbgems/mruby-time/src/time.c', line 556
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 560
     
     static mrb_value
     mrb_time_asctime(mrb_state *mrb, mrb_value self)
    @@ -3106,20 +3106,20 @@ 

     
     
    -788
    -789
    -790
    -791
     792
     793
     794
     795
     796
     797
    -798
    +798 +799 +800 +801 +802

    -
    # File 'mrbgems/mruby-time/src/time.c', line 788
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 792
     
     static mrb_value
     mrb_time_usec(mrb_state *mrb, mrb_value self)
    @@ -3164,19 +3164,19 @@ 

     
     
    -802
    -803
    -804
    -805
     806
     807
     808
     809
     810
    -811
    +811 +812 +813 +814 +815

    -
    # File 'mrbgems/mruby-time/src/time.c', line 802
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 806
     
     static mrb_value
     mrb_time_utc(mrb_state *mrb, mrb_value self)
    @@ -3185,7 +3185,7 @@ 

    tm = time_get_ptr(mrb, self); tm->timezone = MRB_TIMEZONE_UTC; - time_update_datetime(mrb, tm); + time_update_datetime(mrb, tm, FALSE); return self; }

    @@ -3233,17 +3233,17 @@

     
     
    -815
    -816
    -817
    -818
     819
     820
     821
    -822
    +822 +823 +824 +825 +826

    -
    # File 'mrbgems/mruby-time/src/time.c', line 815
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 819
     
     static mrb_value
     mrb_time_utc_p(mrb_state *mrb, mrb_value self)
    @@ -3285,17 +3285,17 @@ 

     
     
    -508
    -509
    -510
    -511
     512
     513
     514
    -515
    +515 +516 +517 +518 +519

    -
    # File 'mrbgems/mruby-time/src/time.c', line 508
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 512
     
     static mrb_value
     mrb_time_wday(mrb_state *mrb, mrb_value self)
    @@ -3388,17 +3388,17 @@ 

     
     
    -519
    -520
    -521
    -522
     523
     524
     525
    -526
    +526 +527 +528 +529 +530

    -
    # File 'mrbgems/mruby-time/src/time.c', line 519
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 523
     
     static mrb_value
     mrb_time_yday(mrb_state *mrb, mrb_value self)
    @@ -3440,17 +3440,17 @@ 

     
     
    -530
    -531
    -532
    -533
     534
     535
     536
    -537
    +537 +538 +539 +540 +541

    -
    # File 'mrbgems/mruby-time/src/time.c', line 530
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 534
     
     static mrb_value
     mrb_time_year(mrb_state *mrb, mrb_value self)
    @@ -3492,10 +3492,6 @@ 

     
     
    -541
    -542
    -543
    -544
     545
     546
     547
    @@ -3503,10 +3499,14 @@ 

    549 550 551 -552

    +552 +553 +554 +555 +556

    -
    # File 'mrbgems/mruby-time/src/time.c', line 541
    +      
    # File 'mrbgems/mruby-time/src/time.c', line 545
     
     static mrb_value
     mrb_time_zone(mrb_state *mrb, mrb_value self)
    @@ -3530,9 +3530,9 @@ 

    diff --git a/docs/api/TrueClass.html b/docs/api/TrueClass.html index 6193ce8..13c42f5 100644 --- a/docs/api/TrueClass.html +++ b/docs/api/TrueClass.html @@ -6,7 +6,7 @@ Class: TrueClass - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -575,9 +575,9 @@

    diff --git a/docs/api/TypeError.html b/docs/api/TypeError.html index e778966..231938a 100644 --- a/docs/api/TypeError.html +++ b/docs/api/TypeError.html @@ -6,7 +6,7 @@ Exception: TypeError - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -154,9 +154,9 @@

    Constructor Details

    diff --git a/docs/api/UDPSocket.html b/docs/api/UDPSocket.html index 3c7ae98..473c62c 100644 --- a/docs/api/UDPSocket.html +++ b/docs/api/UDPSocket.html @@ -6,7 +6,7 @@ Class: UDPSocket - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -554,9 +554,9 @@

    diff --git a/docs/api/UNIXServer.html b/docs/api/UNIXServer.html index d502aaa..1884828 100644 --- a/docs/api/UNIXServer.html +++ b/docs/api/UNIXServer.html @@ -6,7 +6,7 @@ Class: UNIXServer - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -521,9 +521,9 @@

    diff --git a/docs/api/UNIXSocket.html b/docs/api/UNIXSocket.html index e2d49df..ba0e582 100644 --- a/docs/api/UNIXSocket.html +++ b/docs/api/UNIXSocket.html @@ -6,7 +6,7 @@ Class: UNIXSocket - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -580,9 +580,9 @@

    diff --git a/docs/api/UnboundMethod.html b/docs/api/UnboundMethod.html index 4955803..98a90f8 100644 --- a/docs/api/UnboundMethod.html +++ b/docs/api/UnboundMethod.html @@ -6,7 +6,7 @@ Class: UnboundMethod - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -1094,9 +1094,9 @@

    diff --git a/docs/api/_index.html b/docs/api/_index.html index f6e0cde..0b5c3aa 100644 --- a/docs/api/_index.html +++ b/docs/api/_index.html @@ -4,7 +4,7 @@ - Documentation by YARD 0.9.12 + Documentation by YARD 0.9.19 @@ -56,7 +56,7 @@
    -

    Documentation by YARD 0.9.12

    +

    Documentation by YARD 0.9.19

    Alphabetic Index

    @@ -70,25 +70,25 @@

    File Listing

  • AUTHORS
  • -
  • MITL
  • +
  • LICENSE
  • CONTRIBUTING
  • -
  • mrbgems
  • +
  • compile
  • -
  • debugger
  • +
  • mrbgems
  • -
  • compile
  • +
  • gc-arena-howto
  • -
  • mrbconf
  • +
  • debugger
  • -
  • gc-arena-howto
  • +
  • mrbconf
  • @@ -146,6 +146,13 @@

    Namespace Listing A-Z

  • C
    • +
    • + Chain + + (Enumerator) + +
    • +
    • Comparable @@ -652,9 +659,9 @@

      Namespace Listing A-Z

    diff --git a/docs/api/class_list.html b/docs/api/class_list.html index b24b5a8..2ddaeb1 100644 --- a/docs/api/class_list.html +++ b/docs/api/class_list.html @@ -51,7 +51,7 @@

    Class List

    diff --git a/docs/api/css/style.css b/docs/api/css/style.css index 57e8f9d..0bf7e2c 100644 --- a/docs/api/css/style.css +++ b/docs/api/css/style.css @@ -245,6 +245,7 @@ ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; } dl.constants { margin-left: 10px; } dl.constants dt { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; } +dl.constants.compact dt { display: inline-block; font-weight: normal } dl.constants dd { width: 75%; white-space: pre; font-family: monospace; margin-bottom: 18px; } dl.constants .docstring .note:first-child { margin-top: 5px; } @@ -326,13 +327,9 @@ ul.summary a, ul.summary a:visited { text-decoration: none; font-size: 1.1em; } ul.summary li { margin-bottom: 5px; } -.summary .summary_signature { - padding: 4px 8px; - background: #f8f8f8; - border: 1px solid #f0f0f0; - border-radius: 5px; -} +.summary_signature { padding: 4px 8px; background: #f8f8f8; border: 1px solid #f0f0f0; border-radius: 5px; } .summary_signature:hover { background: #CFEBFF; border-color: #A4CCDA; cursor: pointer; } +.summary_signature.deprecated { background: #ffe5e5; border-color: #e9dada; } ul.summary.compact li { display: inline-block; margin: 0px 5px 0px 0px; line-height: 2.6em;} ul.summary.compact .summary_signature { padding: 5px 7px; padding-right: 4px; } #content .summary_signature:hover a, @@ -485,7 +482,7 @@ pre.code .rubyid_nth_ref { color: #6D79DE; } pre.code .regexp, .dregexp { color: #036A07; } pre.code a { border-bottom: 1px dotted #bbf; } /* inline code */ -p > code { +*:not(pre) > code { padding: 1px 3px 1px 3px; border: 1px solid #E1E1E8; background: #F7F7F9; diff --git a/docs/api/file.AUTHORS.html b/docs/api/file.AUTHORS.html index c47027a..d3d9aaa 100644 --- a/docs/api/file.AUTHORS.html +++ b/docs/api/file.AUTHORS.html @@ -6,7 +6,7 @@ File: AUTHORS - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -61,8 +61,11 @@
    -

    Original Authors “mruby developers” are: - Yukihiro Matsumoto +

    This is the (likely incomplete) list of “mruby developers”. +If you submit a patch to mruby, please add your name to the end +of this list.

    + +

    Yukihiro Matsumoto (Matz) SCSK KYUSHU CORPORATION Kyushu Institute of Technology Network Applied Communication Laboratory, Inc. @@ -100,13 +103,14 @@ Tomasz Dąbrowski Christopher Aue Masahiro Wakame - YAMAMOTO Masaya

    + YAMAMOTO Masaya + KOBAYASHI Shuji

    diff --git a/docs/api/file.CONTRIBUTING.html b/docs/api/file.CONTRIBUTING.html index 1cd6fcf..f40bd58 100644 --- a/docs/api/file.CONTRIBUTING.html +++ b/docs/api/file.CONTRIBUTING.html @@ -6,7 +6,7 @@ File: CONTRIBUTING - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -136,9 +136,9 @@

    Comply with the Ruby sta

    diff --git a/docs/api/file.MITL.html b/docs/api/file.LICENSE.html similarity index 90% rename from docs/api/file.MITL.html rename to docs/api/file.LICENSE.html index 3f4c654..eecdfa8 100644 --- a/docs/api/file.MITL.html +++ b/docs/api/file.LICENSE.html @@ -4,9 +4,9 @@ - File: MITL + File: LICENSE - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -17,7 +17,7 @@ @@ -41,7 +41,7 @@ @@ -61,7 +61,7 @@
    -

    Copyright (c) 2018 mruby developers

    +

    Copyright (c) 2019 mruby developers

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), @@ -83,9 +83,9 @@

    diff --git a/docs/api/file.README.html b/docs/api/file.README.html index 53f100d..a90ea78 100644 --- a/docs/api/file.README.html +++ b/docs/api/file.README.html @@ -6,7 +6,7 @@ File: README - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -80,7 +80,7 @@

    What is mruby

    How to get mruby

    -

    The stable version 1.4.1 of mruby can be downloaded via the following URL: https://github.com/mruby/mruby/archive/1.4.1.zip

    +

    The stable version 2.0.1 of mruby can be downloaded via the following URL: https://github.com/mruby/mruby/archive/2.0.1.zip

    The latest development version of mruby can be downloaded via the following URL: https://github.com/mruby/mruby/zipball/master

    @@ -125,7 +125,7 @@

    How to customize mruby (mrbgems)

    License

    -

    mruby is released under the MIT License.

    +

    mruby is released under the MIT License.

    Note for License

    @@ -155,9 +155,9 @@

    How to Contribute

    diff --git a/docs/api/file.compile.html b/docs/api/file.compile.html index a89ca40..1e9eab2 100644 --- a/docs/api/file.compile.html +++ b/docs/api/file.compile.html @@ -6,7 +6,7 @@ File: compile - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -554,9 +554,9 @@

    Test Environment

    diff --git a/docs/api/file.debugger.html b/docs/api/file.debugger.html index c293ade..f6ac849 100644 --- a/docs/api/file.debugger.html +++ b/docs/api/file.debugger.html @@ -6,7 +6,7 @@ File: debugger - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -101,7 +101,7 @@

    2.1 Building mrdb

    bash $ mrdb --version -mruby 1.4.1 (2018-4-27) +mruby 2.0.1 (2019-4-4)

    2.2 Basic Operation

    @@ -480,9 +480,9 @@

    Step Command

    diff --git a/docs/api/file.gc-arena-howto.html b/docs/api/file.gc-arena-howto.html index bd3257a..5cbf298 100644 --- a/docs/api/file.gc-arena-howto.html +++ b/docs/api/file.gc-arena-howto.html @@ -6,7 +6,7 @@ File: gc-arena-howto - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -243,9 +243,9 @@ diff --git a/docs/api/file.mrbconf.html b/docs/api/file.mrbconf.html index aa435e5..ffd34a2 100644 --- a/docs/api/file.mrbconf.html +++ b/docs/api/file.mrbconf.html @@ -6,7 +6,7 @@ File: mrbconf - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -210,9 +210,9 @@

    Other configuration.

    diff --git a/docs/api/file.mrbgems.html b/docs/api/file.mrbgems.html index 982b765..2277e93 100644 --- a/docs/api/file.mrbgems.html +++ b/docs/api/file.mrbgems.html @@ -6,7 +6,7 @@ File: mrbgems - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -248,11 +248,11 @@

    Build process

    When more than one version requirements is passed, the dependency must satisfy all of it.

    -

    You can have default gem to use as depedency when it’s not defined in build_config.rb. +

    You can have default gem to use as dependency when it’s not defined in build_config.rb. When the last argument of add_dependency call is Hash, it will be treated as default gem information. Its format is same as argument of method MRuby::Build#gem, expect that it can’t be treated as path gem location.

    -

    When a special version of depedency is required, +

    When a special version of dependency is required, use MRuby::Build#gem in build_config.rb to override default gem.

    If you have conflicting GEMs use the following method: @@ -418,9 +418,9 @@

    Example

    diff --git a/docs/api/file_list.html b/docs/api/file_list.html index f90bd7c..41dc94a 100644 --- a/docs/api/file_list.html +++ b/docs/api/file_list.html @@ -62,8 +62,8 @@

    File List

    -
  • - +
  • +
  • @@ -72,28 +72,28 @@

    File List

    -
  • - +
  • +
  • -
  • - +
  • +
  • -
  • - +
  • +
  • -
  • - +
  • +
  • -
  • - +
  • +
  • diff --git a/docs/api/frames.html b/docs/api/frames.html index 42ca6b6..2caef9d 100644 --- a/docs/api/frames.html +++ b/docs/api/frames.html @@ -2,7 +2,7 @@ - Documentation by YARD 0.9.12 + Documentation by YARD 0.9.19 + + + + + + + + + + + + + +
    + + +

    Header: mruby/time.h

    + + +

    + Function Summary + collapse +

    + + + + +

    Define Summary

    +
    + +
    #define MRUBY_TIME_H + +
    +
    + +
    + + +
    +

    Function Details

    + + +
    +

    + mrb_value mrb_time_at(mrb_state * mrb, double sec, double usec, mrb_timezone timezone) + + +

    + +
    + + +
    +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fvalue.h.html b/docs/api/headers/mruby_2Fvalue.h.html index e163f96..e917e78 100644 --- a/docs/api/headers/mruby_2Fvalue.h.html +++ b/docs/api/headers/mruby_2Fvalue.h.html @@ -6,7 +6,7 @@ Header: mruby/value.h - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -394,6 +394,21 @@

    Define Summary

    +
    #define mrb_bool + +
    +
    + +
    #define MRB_SYMBOL_BITSIZE + +
    +
    + +
    #define MRB_SYMBOL_MAX + +
    +
    +
    #define mrb_float_p
    @@ -459,11 +474,6 @@

    Typedef Summary

    - -
    - -
    typedef mrb_bool -
    @@ -677,9 +687,9 @@

    diff --git a/docs/api/headers/mruby_2Fvariable.h.html b/docs/api/headers/mruby_2Fvariable.h.html index 867fda1..0d1f106 100644 --- a/docs/api/headers/mruby_2Fvariable.h.html +++ b/docs/api/headers/mruby_2Fvariable.h.html @@ -6,7 +6,7 @@ Header: mruby/variable.h - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -160,7 +160,7 @@

  • - mrb_bool mrb_iv_p(mrb_state *, mrb_sym) + mrb_bool mrb_iv_name_sym_p(mrb_state *, mrb_sym) @@ -178,7 +178,7 @@

  • - void mrb_iv_check(mrb_state *, mrb_sym) + void mrb_iv_name_sym_check(mrb_state *, mrb_sym) @@ -476,6 +476,24 @@

    +
    +
    + +

  • + + +
  • + + void mrb_iv_foreach(mrb_state *, mrb_value, mrb_iv_foreach_func *, void *) + + + + + + + + +
    @@ -541,8 +559,8 @@

    -

    - mrb_bool mrb_iv_p(mrb_state * mrb, mrb_sym sym) +

    + mrb_bool mrb_iv_name_sym_p(mrb_state * mrb, mrb_sym sym)

    @@ -551,8 +569,8 @@

    -

    - void mrb_iv_check(mrb_state * mrb, mrb_sym sym) +

    + void mrb_iv_name_sym_check(mrb_state * mrb, mrb_sym sym)

    @@ -933,6 +951,16 @@

    mrb_bool mrb_cv_defined(mrb_state * mrb, mrb_value mod, mrb_sym sym) +

    + +
    + + +
    +

    + void mrb_iv_foreach(mrb_state * mrb, mrb_value obj, mrb_iv_foreach_func * func, void * p) + +

    @@ -942,9 +970,9 @@

    diff --git a/docs/api/headers/mruby_2Fversion.h.html b/docs/api/headers/mruby_2Fversion.h.html index 4fcefa7..e5183e1 100644 --- a/docs/api/headers/mruby_2Fversion.h.html +++ b/docs/api/headers/mruby_2Fversion.h.html @@ -6,7 +6,7 @@ Header: mruby/version.h - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -358,9 +358,9 @@

    Function Details

    diff --git a/docs/api/index.html b/docs/api/index.html index c013db6..81df4bc 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -6,7 +6,7 @@ File: README - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -80,7 +80,7 @@

    What is mruby

    How to get mruby

    -

    The stable version 1.4.1 of mruby can be downloaded via the following URL: https://github.com/mruby/mruby/archive/1.4.1.zip

    +

    The stable version 2.0.1 of mruby can be downloaded via the following URL: https://github.com/mruby/mruby/archive/2.0.1.zip

    The latest development version of mruby can be downloaded via the following URL: https://github.com/mruby/mruby/zipball/master

    @@ -125,7 +125,7 @@

    How to customize mruby (mrbgems)

    License

    -

    mruby is released under the MIT License.

    +

    mruby is released under the MIT License.

    Note for License

    @@ -155,9 +155,9 @@

    How to Contribute

    diff --git a/docs/api/js/app.js b/docs/api/js/app.js index b9f2120..368f44a 100644 --- a/docs/api/js/app.js +++ b/docs/api/js/app.js @@ -120,6 +120,49 @@ function summaryToggle() { } else { localStorage.summaryCollapsed = "expand"; } } +function constantSummaryToggle() { + $('.constants_summary_toggle').click(function(e) { + e.preventDefault(); + localStorage.summaryCollapsed = $(this).text(); + $('.constants_summary_toggle').each(function() { + $(this).text($(this).text() == "collapse" ? "expand" : "collapse"); + var next = $(this).parent().parent().nextAll('dl.constants').first(); + if (next.hasClass('compact')) { + next.toggle(); + next.nextAll('dl.constants').first().toggle(); + } + else if (next.hasClass('constants')) { + var list = $('
    '); + list.html(next.html()); + list.find('dt').each(function() { + $(this).addClass('summary_signature'); + $(this).text( $(this).text().split('=')[0]); + if ($(this).has(".deprecated").length) { + $(this).addClass('deprecated'); + }; + }); + // Add the value of the constant as "Tooltip" to the summary object + list.find('pre.code').each(function() { + console.log($(this).parent()); + var dt_element = $(this).parent().prev(); + var tooltip = $(this).text(); + if (dt_element.hasClass("deprecated")) { + tooltip = 'Deprecated. ' + tooltip; + }; + dt_element.attr('title', tooltip); + }); + list.find('.docstring, .tags, dd').remove(); + next.before(list); + next.toggle(); + } + }); + return false; + }); + if (localStorage.summaryCollapsed == "collapse") { + $('.constants_summary_toggle').first().click(); + } else { localStorage.summaryCollapsed = "expand"; } +} + function generateTOC() { if ($('#filecontents').length === 0) return; var _toc = $('
      '); @@ -232,6 +275,16 @@ function mainFocus() { setTimeout(function() { $('#main').focus(); }, 10); } +function navigationChange() { + // This works around the broken anchor navigation with the YARD template. + window.onpopstate = function() { + var hash = window.location.hash; + if (hash !== '' && $(hash)[0]) { + $(hash)[0].scrollIntoView(); + } + }; +} + $(document).ready(function() { navResizer(); navExpander(); @@ -241,8 +294,10 @@ $(document).ready(function() { searchFrameButtons(); linkSummaries(); summaryToggle(); + constantSummaryToggle(); generateTOC(); mainFocus(); + navigationChange(); }); })(); diff --git a/docs/api/method_list.html b/docs/api/method_list.html index 1af3055..d76e88a 100644 --- a/docs/api/method_list.html +++ b/docs/api/method_list.html @@ -213,6 +213,14 @@

      Method List

    1. +
      + #+ + Enumerable +
      +
    2. + + +
    3. #+@ Numeric @@ -220,7 +228,7 @@

      Method List

    4. -
    5. +
    6. #- Fixnum @@ -228,7 +236,7 @@

      Method List

    7. -
    8. +
    9. #- Float @@ -236,7 +244,7 @@

      Method List

    10. -
    11. +
    12. #- Time @@ -244,7 +252,7 @@

      Method List

    13. -
    14. +
    15. #- Array @@ -252,7 +260,7 @@

      Method List

    16. -
    17. +
    18. #-@ Numeric @@ -260,7 +268,7 @@

      Method List

    19. -
    20. +
    21. #/ Numeric @@ -268,7 +276,7 @@

      Method List

    22. -
    23. +
    24. #< Numeric @@ -276,7 +284,7 @@

      Method List

    25. -
    26. +
    27. #< Comparable @@ -284,7 +292,7 @@

      Method List

    28. -
    29. +
    30. #< Hash @@ -292,6 +300,14 @@

      Method List

    31. +
    32. +
      + #< + Module +
      +
    33. + +
    34. #<< @@ -332,6 +348,22 @@

      Method List

    35. +
    36. +
      + #<< + Method +
      +
    37. + + +
    38. +
      + #<< + Proc +
      +
    39. + +
    40. #<< @@ -365,6 +397,14 @@

      Method List

    41. +
      + #<= + Module +
      +
    42. + + +
    43. #<=> String @@ -372,7 +412,7 @@

      Method List

    44. -
    45. +
    46. #<=> Symbol @@ -380,7 +420,7 @@

      Method List

    47. -
    48. +
    49. #<=> Numeric @@ -388,7 +428,7 @@

      Method List

    50. -
    51. +
    52. #<=> Array @@ -396,7 +436,7 @@

      Method List

    53. -
    54. +
    55. #<=> Time @@ -404,6 +444,14 @@

      Method List

    56. +
    57. +
      + #<=> + Module +
      +
    58. + +
    59. #== @@ -501,14 +549,6 @@

      Method List

    60. -
      - #=== - Symbol -
      -
    61. - - -
    62. #=== Proc @@ -516,7 +556,7 @@

      Method List

    63. -
    64. +
    65. #=~ String @@ -524,7 +564,7 @@

      Method List

    66. -
    67. +
    68. #> Numeric @@ -532,7 +572,7 @@

      Method List

    69. -
    70. +
    71. #> Comparable @@ -540,7 +580,7 @@

      Method List

    72. -
    73. +
    74. #> Hash @@ -548,6 +588,14 @@

      Method List

    75. +
    76. +
      + #> + Module +
      +
    77. + +
    78. #>= @@ -573,6 +621,14 @@

      Method List

    79. +
      + #>= + Module +
      +
    80. + + +
    81. #>> Fixnum @@ -580,7 +636,7 @@

      Method List

    82. -
    83. +
    84. #>> Float @@ -588,7 +644,23 @@

      Method List

    85. +
    86. +
      + #>> + Method +
      +
    87. + +
    88. +
      + #>> + Proc +
      +
    89. + + +
    90. Array Kernel @@ -596,7 +668,7 @@

      Method List

    91. -
    92. +
    93. Float Kernel @@ -604,7 +676,7 @@

      Method List

    94. -
    95. +
    96. Hash Kernel @@ -612,7 +684,7 @@

      Method List

    97. -
    98. +
    99. Integer Kernel @@ -620,7 +692,7 @@

      Method List

    100. -
    101. +
    102. String Kernel @@ -628,7 +700,7 @@

      Method List

    103. -
    104. +
    105. #[] Hash @@ -636,7 +708,7 @@

      Method List

    106. -
    107. +
    108. #[] Array @@ -644,7 +716,7 @@

      Method List

    109. -
    110. +
    111. #[] String @@ -652,7 +724,7 @@

      Method List

    112. -
    113. +
    114. #[] Struct @@ -660,7 +732,7 @@

      Method List

    115. -
    116. +
    117. [] Hash @@ -668,7 +740,7 @@

      Method List

    118. -
    119. +
    120. #[]= Hash @@ -676,7 +748,7 @@

      Method List

    121. -
    122. +
    123. #[]= Array @@ -684,7 +756,7 @@

      Method List

    124. -
    125. +
    126. #[]= String @@ -692,7 +764,7 @@

      Method List

    127. -
    128. +
    129. #[]= Struct @@ -700,7 +772,7 @@

      Method List

    130. -
    131. +
    132. #^ NilClass @@ -708,7 +780,7 @@

      Method List

    133. -
    134. +
    135. #^ TrueClass @@ -716,7 +788,7 @@

      Method List

    136. -
    137. +
    138. #^ FalseClass @@ -724,7 +796,7 @@

      Method List

    139. -
    140. +
    141. #^ Fixnum @@ -732,7 +804,7 @@

      Method List

    142. -
    143. +
    144. #^ Float @@ -740,7 +812,7 @@

      Method List

    145. -
    146. +
    147. #__ary_cmp Array @@ -748,7 +820,7 @@

      Method List

    148. -
    149. +
    150. #__ary_eq Array @@ -756,7 +828,7 @@

      Method List

    151. -
    152. +
    153. #__ary_index Array @@ -764,7 +836,7 @@

      Method List

    154. -
    155. +
    156. #__case_eqq Kernel @@ -772,7 +844,23 @@

      Method List

    157. +
    158. +
      + #__coerce_step_counter + Numeric +
      +
    159. + +
    160. +
      + #__copy_enums + Enumerator::Chain +
      +
    161. + + +
    162. #__delete Hash @@ -780,6 +868,14 @@

      Method List

    163. +
    164. +
      + #__lines + String +
      +
    165. + +
    166. #__method__ @@ -798,37 +894,45 @@

      Method List

    167. - #__sort_sub__ - Array + #__sub_replace + String
    168. - #__sub_replace - String + #__svalue + Array
    169. - #__svalue - Array + #__to_int + Kernel
    170. - #__update - Hash + #__to_str + Kernel
    171. +
      + __update_hash + Enumerable +
      +
    172. + + +
    173. #_check_readable IO @@ -836,7 +940,7 @@

      Method List

    174. -
    175. +
    176. #_inspect Hash @@ -844,7 +948,7 @@

      Method List

    177. -
    178. +
    179. #_inspect Array @@ -852,7 +956,7 @@

      Method List

    180. -
    181. +
    182. #_inspect Kernel @@ -860,7 +964,7 @@

      Method List

    183. -
    184. +
    185. #_inspect Struct @@ -868,7 +972,7 @@

      Method List

    186. -
    187. +
    188. #_is_socket= BasicSocket @@ -876,7 +980,7 @@

      Method List

    189. -
    190. +
    191. #_read_buf IO @@ -884,7 +988,7 @@

      Method List

    192. -
    193. +
    194. #_recvfrom BasicSocket @@ -892,7 +996,7 @@

      Method List

    195. -
    196. +
    197. #_setnonblock BasicSocket @@ -900,7 +1004,7 @@

      Method List

    198. -
    199. +
    200. #_sockaddr_in UDPSocket @@ -908,7 +1012,7 @@

      Method List

    201. -
    202. +
    203. #_to_array Addrinfo @@ -916,7 +1020,7 @@

      Method List

    204. -
    205. +
    206. #` Kernel @@ -924,7 +1028,7 @@

      Method List

    207. -
    208. +
    209. #abs Numeric @@ -932,7 +1036,7 @@

      Method List

    210. -
    211. +
    212. #accept TCPServer @@ -940,7 +1044,7 @@

      Method List

    213. -
    214. +
    215. #accept Socket @@ -948,7 +1052,7 @@

      Method List

    216. -
    217. +
    218. #accept UNIXServer @@ -956,7 +1060,7 @@

      Method List

    219. -
    220. +
    221. #accept_nonblock TCPServer @@ -964,7 +1068,7 @@

      Method List

    222. -
    223. +
    224. #accept_nonblock Socket @@ -972,7 +1076,7 @@

      Method List

    225. -
    226. +
    227. #accept_nonblock UNIXServer @@ -980,7 +1084,7 @@

      Method List

    228. -
    229. +
    230. acos Math @@ -988,7 +1092,7 @@

      Method List

    231. -
    232. +
    233. acosh Math @@ -996,7 +1100,7 @@

      Method List

    234. -
    235. +
    236. #addr IPSocket @@ -1004,7 +1108,7 @@

      Method List

    237. -
    238. +
    239. #addr UNIXSocket @@ -1012,7 +1116,7 @@

      Method List

    240. -
    241. +
    242. #afamily Addrinfo @@ -1020,7 +1124,7 @@

      Method List

    243. -
    244. +
    245. #alive? Fiber @@ -1028,7 +1132,7 @@

      Method List

    246. -
    247. +
    248. #all? Enumerable @@ -1036,7 +1140,7 @@

      Method List

    249. -
    250. +
    251. #any? Enumerable @@ -1044,7 +1148,7 @@

      Method List

    252. -
    253. +
    254. #append Array @@ -1052,7 +1156,7 @@

      Method List

    255. -
    256. +
    257. #args NoMethodError @@ -1060,6 +1164,14 @@

      Method List

    258. +
    259. +
      + #args + Enumerator +
      +
    260. + +
    261. #arity @@ -1358,15 +1470,15 @@

      Method List

    262. - #chars - String + #chain + Enumerable
    263. - #chomp + #chars String
    264. @@ -1374,7 +1486,7 @@

      Method List

    265. - #chomp! + #chomp String
    266. @@ -1382,7 +1494,7 @@

      Method List

    267. - #chop + #chomp! String
    268. @@ -1390,7 +1502,7 @@

      Method List

    269. - #chop! + #chop String
    270. @@ -1398,7 +1510,7 @@

      Method List

    271. - #chr + #chop! String
    272. @@ -1406,23 +1518,23 @@

      Method List

    273. - #clamp - Comparable + #chr + String
    274. - #class - Kernel + #clamp + Comparable
    275. - #class_defined? + #class Kernel
    276. @@ -1637,6 +1749,14 @@

      Method List

    277. +
      + #count + String +
      +
    278. + + +
    279. #count Enumerable @@ -1644,7 +1764,7 @@

      Method List

    280. -
    281. +
    282. #cover? String @@ -1652,7 +1772,7 @@

      Method List

    283. -
    284. +
    285. #ctime Time @@ -1660,7 +1780,7 @@

      Method List

    286. -
    287. +
    288. #curry Proc @@ -1668,7 +1788,7 @@

      Method List

    289. -
    290. +
    291. #cycle Enumerable @@ -1676,7 +1796,7 @@

      Method List

    292. -
    293. +
    294. #data Socket::Option @@ -1684,7 +1804,7 @@

      Method List

    295. -
    296. +
    297. #day Time @@ -1692,7 +1812,7 @@

      Method List

    298. -
    299. +
    300. #default Hash @@ -1700,7 +1820,7 @@

      Method List

    301. -
    302. +
    303. #default= Hash @@ -1708,7 +1828,7 @@

      Method List

    304. -
    305. +
    306. #default_proc Hash @@ -1716,7 +1836,7 @@

      Method List

    307. -
    308. +
    309. #default_proc= Hash @@ -1724,7 +1844,7 @@

      Method List

    310. -
    311. +
    312. #define_singleton_method Kernel @@ -1732,7 +1852,7 @@

      Method List

    313. -
    314. +
    315. #delete Hash @@ -1740,7 +1860,7 @@

      Method List

    316. -
    317. +
    318. #delete Array @@ -1748,7 +1868,23 @@

      Method List

    319. +
    320. +
      + #delete + String +
      +
    321. + +
    322. +
      + #delete! + String +
      +
    323. + + +
    324. #delete_at Array @@ -1756,7 +1892,7 @@

      Method List

    325. -
    326. +
    327. #delete_if Hash @@ -1764,7 +1900,7 @@

      Method List

    328. -
    329. +
    330. #delete_if Array @@ -1772,7 +1908,7 @@

      Method List

    331. -
    332. +
    333. #delete_prefix String @@ -1780,7 +1916,7 @@

      Method List

    334. -
    335. +
    336. #delete_prefix! String @@ -1788,7 +1924,7 @@

      Method List

    337. -
    338. +
    339. #delete_suffix String @@ -1796,7 +1932,7 @@

      Method List

    340. -
    341. +
    342. #delete_suffix! String @@ -1804,7 +1940,7 @@

      Method List

    343. -
    344. +
    345. #detect Enumerable @@ -1812,7 +1948,7 @@

      Method List

    346. -
    347. +
    348. #dig Hash @@ -1820,15 +1956,15 @@

      Method List

    349. -
    350. +
    351. - #dig - Top Level Namespace + #dig + Struct
    352. -
    353. +
    354. #dig Array @@ -1836,7 +1972,7 @@

      Method List

    355. -
    356. +
    357. directory? File @@ -1844,7 +1980,7 @@

      Method List

    358. -
    359. +
    360. #div Integral @@ -1852,7 +1988,7 @@

      Method List

    361. -
    362. +
    363. #divmod Fixnum @@ -1860,7 +1996,7 @@

      Method List

    364. -
    365. +
    366. #divmod Float @@ -1868,7 +2004,7 @@

      Method List

    367. -
    368. +
    369. do_not_reverse_lookup BasicSocket @@ -1876,7 +2012,7 @@

      Method List

    370. -
    371. +
    372. #do_not_reverse_lookup BasicSocket @@ -1884,7 +2020,7 @@

      Method List

    373. -
    374. +
    375. do_not_reverse_lookup= BasicSocket @@ -1892,7 +2028,7 @@

      Method List

    376. -
    377. +
    378. #downcase String @@ -1900,7 +2036,7 @@

      Method List

    379. -
    380. +
    381. #downcase Symbol @@ -1908,7 +2044,7 @@

      Method List

    382. -
    383. +
    384. #downcase! String @@ -1916,7 +2052,7 @@

      Method List

    385. -
    386. +
    387. #downto Integral @@ -1924,7 +2060,7 @@

      Method List

    388. -
    389. +
    390. #drop Enumerable @@ -1932,7 +2068,7 @@

      Method List

    391. -
    392. +
    393. #drop Enumerator::Lazy @@ -1940,7 +2076,7 @@

      Method List

    394. -
    395. +
    396. #drop_while Enumerable @@ -1948,7 +2084,7 @@

      Method List

    397. -
    398. +
    399. #drop_while Enumerator::Lazy @@ -1956,7 +2092,7 @@

      Method List

    400. -
    401. +
    402. #dst? Time @@ -1964,7 +2100,7 @@

      Method List

    403. -
    404. +
    405. #dump String @@ -1972,14 +2108,6 @@

      Method List

    406. -
    407. -
      - #dup - Hash -
      -
    408. - -
    409. #dup @@ -2029,6 +2157,14 @@

      Method List

    410. +
      + #each + Enumerator::Chain +
      +
    411. + + +
    412. #each Enumerator @@ -2036,7 +2172,7 @@

      Method List

    413. -
    414. +
    415. #each Enumerator::Generator @@ -2044,7 +2180,7 @@

      Method List

    416. -
    417. +
    418. #each_byte String @@ -2052,7 +2188,7 @@

      Method List

    419. -
    420. +
    421. #each_byte IO @@ -2060,7 +2196,7 @@

      Method List

    422. -
    423. +
    424. #each_char String @@ -2068,7 +2204,7 @@

      Method List

    425. -
    426. +
    427. #each_cons Enumerable @@ -2076,7 +2212,7 @@

      Method List

    428. -
    429. +
    430. #each_index Array @@ -2084,7 +2220,7 @@

      Method List

    431. -
    432. +
    433. #each_key Hash @@ -2092,7 +2228,7 @@

      Method List

    434. -
    435. +
    436. #each_line String @@ -2100,7 +2236,7 @@

      Method List

    437. -
    438. +
    439. #each_pair Struct @@ -2108,7 +2244,7 @@

      Method List

    440. -
    441. +
    442. #each_slice Enumerable @@ -2116,7 +2252,7 @@

      Method List

    443. -
    444. +
    445. #each_value Hash @@ -2124,7 +2260,7 @@

      Method List

    446. -
    447. +
    448. #each_with_index Enumerable @@ -2132,7 +2268,7 @@

      Method List

    449. -
    450. +
    451. #each_with_index Enumerator @@ -2140,7 +2276,7 @@

      Method List

    452. -
    453. +
    454. #each_with_object Enumerable @@ -2148,7 +2284,7 @@

      Method List

    455. -
    456. +
    457. #empty? Hash @@ -2156,7 +2292,7 @@

      Method List

    458. -
    459. +
    460. #empty? Array @@ -2164,7 +2300,7 @@

      Method List

    461. -
    462. +
    463. #empty? String @@ -2172,7 +2308,7 @@

      Method List

    464. -
    465. +
    466. #empty? Symbol @@ -2180,7 +2316,7 @@

      Method List

    467. -
    468. +
    469. #end_with? String @@ -2188,7 +2324,7 @@

      Method List

    470. -
    471. +
    472. #entries Enumerable @@ -2196,7 +2332,7 @@

      Method List

    473. -
    474. +
    475. #eof? IO @@ -2204,7 +2340,7 @@

      Method List

    476. -
    477. +
    478. #eql? Kernel @@ -2212,7 +2348,7 @@

      Method List

    479. -
    480. +
    481. #eql? String @@ -2220,7 +2356,7 @@

      Method List

    482. -
    483. +
    484. #eql? Fixnum @@ -2228,7 +2364,7 @@

      Method List

    485. -
    486. +
    487. #eql? Float @@ -2236,7 +2372,7 @@

      Method List

    488. -
    489. +
    490. #eql? Hash @@ -2244,7 +2380,7 @@

      Method List

    491. -
    492. +
    493. #eql? Array @@ -2252,7 +2388,7 @@

      Method List

    494. -
    495. +
    496. #eql? Struct @@ -2260,7 +2396,7 @@

      Method List

    497. -
    498. +
    499. #equal? Kernel @@ -2268,7 +2404,7 @@

      Method List

    500. -
    501. +
    502. erf Math @@ -2276,7 +2412,7 @@

      Method List

    503. -
    504. +
    505. erfc Math @@ -2284,7 +2420,7 @@

      Method List

    506. -
    507. +
    508. #exception Exception @@ -2292,7 +2428,7 @@

      Method List

    509. -
    510. +
    511. exist? File @@ -2300,7 +2436,7 @@

      Method List

    512. -
    513. +
    514. exists? File @@ -2308,7 +2444,7 @@

      Method List

    515. -
    516. +
    517. exp Math @@ -2316,7 +2452,7 @@

      Method List

    518. -
    519. +
    520. expand_path File @@ -2324,7 +2460,7 @@

      Method List

    521. -
    522. +
    523. #extend Kernel @@ -2332,7 +2468,7 @@

      Method List

    524. -
    525. +
    526. extname File @@ -2340,7 +2476,7 @@

      Method List

    527. -
    528. +
    529. fail Kernel @@ -2348,7 +2484,7 @@

      Method List

    530. -
    531. +
    532. #family Socket::Option @@ -2356,7 +2492,7 @@

      Method List

    533. -
    534. +
    535. #feed Enumerator @@ -2364,7 +2500,7 @@

      Method List

    536. -
    537. +
    538. #fetch Hash @@ -2372,7 +2508,7 @@

      Method List

    539. -
    540. +
    541. #fetch Array @@ -2380,7 +2516,7 @@

      Method List

    542. -
    543. +
    544. #fetch_values Hash @@ -2388,6 +2524,14 @@

      Method List

    545. +
    546. +
      + #fib + Enumerator +
      +
    547. + +
    548. file? @@ -3125,6 +3269,14 @@

      Method List

    549. +
      + #initialize + Enumerator::Chain +
      +
    550. + + +
    551. #initialize Enumerator @@ -3132,7 +3284,7 @@

      Method List

    552. -
    553. +
    554. #initialize Enumerator::Generator @@ -3140,7 +3292,7 @@

      Method List

    555. -
    556. +
    557. #initialize Enumerator::Yielder @@ -3148,7 +3300,7 @@

      Method List

    558. -
    559. +
    560. #initialize_copy Array @@ -3156,7 +3308,7 @@

      Method List

    561. -
    562. +
    563. #initialize_copy Kernel @@ -3164,7 +3316,7 @@

      Method List

    564. -
    565. +
    566. #initialize_copy String @@ -3172,7 +3324,7 @@

      Method List

    567. -
    568. +
    569. #initialize_copy IO @@ -3180,7 +3332,7 @@

      Method List

    570. -
    571. +
    572. #initialize_copy Time @@ -3188,7 +3340,7 @@

      Method List

    573. -
    574. +
    575. #initialize_copy Struct @@ -3196,6 +3348,14 @@

      Method List

    576. +
    577. +
      + #initialize_copy + Enumerator::Chain +
      +
    578. + +
    579. #initialize_copy @@ -3365,6 +3525,14 @@

      Method List

    580. +
      + #inspect + Enumerator::Chain +
      +
    581. + + +
    582. #inspect Enumerator @@ -3372,7 +3540,7 @@

      Method List

    583. -
    584. +
    585. #inspect_sockaddr Addrinfo @@ -3380,7 +3548,7 @@

      Method List

    586. -
    587. +
    588. #instance_of? Kernel @@ -3388,7 +3556,7 @@

      Method List

    589. -
    590. +
    591. #instance_variable_defined? Kernel @@ -3396,7 +3564,7 @@

      Method List

    592. -
    593. +
    594. #instance_variable_get Kernel @@ -3404,7 +3572,7 @@

      Method List

    595. -
    596. +
    597. #instance_variable_set Kernel @@ -3412,7 +3580,7 @@

      Method List

    598. -
    599. +
    600. #instance_variables Kernel @@ -3420,7 +3588,7 @@

      Method List

    601. -
    602. +
    603. int Socket::Option @@ -3428,7 +3596,7 @@

      Method List

    604. -
    605. +
    606. #int Socket::Option @@ -3436,7 +3604,7 @@

      Method List

    607. -
    608. +
    609. #intern String @@ -3444,7 +3612,7 @@

      Method List

    610. -
    611. +
    612. #invert Hash @@ -3452,7 +3620,7 @@

      Method List

    613. -
    614. +
    615. ip Addrinfo @@ -3460,7 +3628,7 @@

      Method List

    616. -
    617. +
    618. #ip? Addrinfo @@ -3468,7 +3636,7 @@

      Method List

    619. -
    620. +
    621. #ip_address Addrinfo @@ -3476,7 +3644,7 @@

      Method List

    622. -
    623. +
    624. #ip_port Addrinfo @@ -3484,7 +3652,7 @@

      Method List

    625. -
    626. +
    627. #ip_unpack Addrinfo @@ -3492,7 +3660,7 @@

      Method List

    628. -
    629. +
    630. #ipv4? Addrinfo @@ -3500,7 +3668,7 @@

      Method List

    631. -
    632. +
    633. #ipv6? Addrinfo @@ -3508,7 +3676,7 @@

      Method List

    634. -
    635. +
    636. #is_a? Kernel @@ -3516,7 +3684,7 @@

      Method List

    637. -
    638. +
    639. #isatty IO @@ -3524,7 +3692,7 @@

      Method List

    640. -
    641. +
    642. #iterator? Kernel @@ -3532,7 +3700,7 @@

      Method List

    643. -
    644. +
    645. itself Kernel @@ -3540,7 +3708,7 @@

      Method List

    646. -
    647. +
    648. #join Array @@ -3548,7 +3716,7 @@

      Method List

    649. -
    650. +
    651. join File @@ -3556,7 +3724,7 @@

      Method List

    652. -
    653. +
    654. #keep_if Hash @@ -3564,7 +3732,7 @@

      Method List

    655. -
    656. +
    657. #keep_if Array @@ -3572,7 +3740,7 @@

      Method List

    658. -
    659. +
    660. #key Hash @@ -3580,7 +3748,7 @@

      Method List

    661. -
    662. +
    663. #key? Hash @@ -3588,7 +3756,7 @@

      Method List

    664. -
    665. +
    666. #keys Hash @@ -3596,7 +3764,7 @@

      Method List

    667. -
    668. +
    669. #kind_of? Kernel @@ -3604,7 +3772,7 @@

      Method List

    670. -
    671. +
    672. #last Array @@ -3612,7 +3780,7 @@

      Method List

    673. -
    674. +
    675. #last String @@ -3620,7 +3788,7 @@

      Method List

    676. -
    677. +
    678. #lazy Enumerable @@ -3628,7 +3796,7 @@

      Method List

    679. -
    680. +
    681. ldexp Math @@ -3636,7 +3804,7 @@

      Method List

    682. -
    683. +
    684. #length Hash @@ -3644,7 +3812,7 @@

      Method List

    685. -
    686. +
    687. #length Array @@ -3652,7 +3820,7 @@

      Method List

    688. -
    689. +
    690. #length String @@ -3660,7 +3828,7 @@

      Method List

    691. -
    692. +
    693. #length Struct @@ -3668,7 +3836,7 @@

      Method List

    694. -
    695. +
    696. #level Socket::Option @@ -3676,7 +3844,7 @@

      Method List

    697. -
    698. +
    699. #lines String @@ -3684,7 +3852,7 @@

      Method List

    700. -
    701. +
    702. #linger Socket::Option @@ -3692,7 +3860,7 @@

      Method List

    703. -
    704. +
    705. #listen TCPServer @@ -3700,7 +3868,7 @@

      Method List

    706. -
    707. +
    708. #listen Socket @@ -3708,7 +3876,7 @@

      Method List

    709. -
    710. +
    711. #listen UNIXServer @@ -3716,7 +3884,7 @@

      Method List

    712. -
    713. +
    714. #ljust String @@ -3724,7 +3892,7 @@

      Method List

    715. -
    716. +
    717. #local_address BasicSocket @@ -3732,7 +3900,7 @@

      Method List

    718. -
    719. +
    720. #local_variables Kernel @@ -3740,7 +3908,7 @@

      Method List

    721. -
    722. +
    723. #localtime Time @@ -3748,7 +3916,7 @@

      Method List

    724. -
    725. +
    726. log Math @@ -3756,7 +3924,7 @@

      Method List

    727. -
    728. +
    729. log10 Math @@ -3764,7 +3932,7 @@

      Method List

    730. -
    731. +
    732. log2 Math @@ -3772,7 +3940,7 @@

      Method List

    733. -
    734. +
    735. #loop Kernel @@ -3780,7 +3948,7 @@

      Method List

    736. -
    737. +
    738. #lstrip String @@ -3788,7 +3956,7 @@

      Method List

    739. -
    740. +
    741. #lstrip! String @@ -3796,7 +3964,7 @@

      Method List

    742. -
    743. +
    744. #map Enumerator::Lazy @@ -3804,7 +3972,7 @@

      Method List

    745. -
    746. +
    747. #match String @@ -3812,7 +3980,7 @@

      Method List

    748. -
    749. +
    750. #max Enumerable @@ -3820,7 +3988,7 @@

      Method List

    751. -
    752. +
    753. #max_by Enumerable @@ -3828,7 +3996,7 @@

      Method List

    754. -
    755. +
    756. #mday Time @@ -3836,7 +4004,7 @@

      Method List

    757. -
    758. +
    759. #member? Hash @@ -3844,7 +4012,7 @@

      Method List

    760. -
    761. +
    762. #members Struct @@ -3852,7 +4020,7 @@

      Method List

    763. -
    764. +
    765. #merge Hash @@ -3860,7 +4028,7 @@

      Method List

    766. -
    767. +
    768. #merge! Hash @@ -3868,7 +4036,7 @@

      Method List

    769. -
    770. +
    771. #message Exception @@ -3876,6 +4044,14 @@

      Method List

    772. +
    773. +
      + #meth + Enumerator +
      +
    774. + +
    775. #method_missing @@ -4069,6 +4245,14 @@

      Method List

    776. +
      + #obj + Enumerator +
      +
    777. + + +
    778. #object_id Kernel @@ -4076,7 +4260,7 @@

      Method List

    779. -
    780. +
    781. #oct String @@ -4084,7 +4268,7 @@

      Method List

    782. -
    783. +
    784. #one? Enumerable @@ -4092,7 +4276,7 @@

      Method List

    785. -
    786. +
    787. open IO @@ -4100,7 +4284,7 @@

      Method List

    788. -
    789. +
    790. #open Kernel @@ -4108,7 +4292,7 @@

      Method List

    791. -
    792. +
    793. open Socket @@ -4116,7 +4300,7 @@

      Method List

    794. -
    795. +
    796. #optname Socket::Option @@ -4124,7 +4308,7 @@

      Method List

    797. -
    798. +
    799. #ord String @@ -4132,7 +4316,7 @@

      Method List

    800. -
    801. +
    802. #owner Method @@ -4140,7 +4324,7 @@

      Method List

    803. -
    804. +
    805. #owner UnboundMethod @@ -4148,7 +4332,7 @@

      Method List

    806. -
    807. +
    808. #p Kernel @@ -4156,7 +4340,7 @@

      Method List

    809. -
    810. +
    811. #parameters UnboundMethod @@ -4164,7 +4348,7 @@

      Method List

    812. -
    813. +
    814. #parameters Method @@ -4172,7 +4356,7 @@

      Method List

    815. -
    816. +
    817. #partition Enumerable @@ -4180,7 +4364,7 @@

      Method List

    818. -
    819. +
    820. #partition String @@ -4188,7 +4372,7 @@

      Method List

    821. -
    822. +
    823. #path File @@ -4196,7 +4380,7 @@

      Method List

    824. -
    825. +
    826. path File @@ -4204,7 +4388,7 @@

      Method List

    827. -
    828. +
    829. #path UNIXSocket @@ -4212,7 +4396,7 @@

      Method List

    830. -
    831. +
    832. #peek Enumerator @@ -4220,7 +4404,7 @@

      Method List

    833. -
    834. +
    835. #peek_values Enumerator @@ -4228,7 +4412,7 @@

      Method List

    836. -
    837. +
    838. #peeraddr IPSocket @@ -4236,7 +4420,7 @@

      Method List

    839. -
    840. +
    841. #peeraddr UNIXSocket @@ -4244,7 +4428,7 @@

      Method List

    842. -
    843. +
    844. #permutation Array @@ -4252,7 +4436,7 @@

      Method List

    845. -
    846. +
    847. #pfamily Addrinfo @@ -4260,7 +4444,7 @@

      Method List

    848. -
    849. +
    850. #pid IO @@ -4268,7 +4452,7 @@

      Method List

    851. -
    852. +
    853. pipe IO @@ -4276,7 +4460,7 @@

      Method List

    854. -
    855. +
    856. pipe? File @@ -4284,7 +4468,7 @@

      Method List

    857. -
    858. +
    859. #pop Array @@ -4292,7 +4476,7 @@

      Method List

    860. -
    861. +
    862. popen IO @@ -4300,7 +4484,7 @@

      Method List

    863. -
    864. +
    865. #pos IO @@ -4308,7 +4492,7 @@

      Method List

    866. -
    867. +
    868. #pos= IO @@ -4316,7 +4500,7 @@

      Method List

    869. -
    870. +
    871. #positive? Integral @@ -4324,7 +4508,7 @@

      Method List

    872. -
    873. +
    874. #prepend Array @@ -4332,7 +4516,7 @@

      Method List

    875. -
    876. +
    877. #prepend Module @@ -4340,7 +4524,7 @@

      Method List

    878. -
    879. +
    880. #prepend String @@ -4348,7 +4532,7 @@

      Method List

    881. -
    882. +
    883. #print IO @@ -4356,7 +4540,7 @@

      Method List

    884. -
    885. +
    886. #print Kernel @@ -4364,7 +4548,7 @@

      Method List

    887. -
    888. +
    889. #printf IO @@ -4372,7 +4556,7 @@

      Method List

    890. -
    891. +
    892. #printf Kernel @@ -4380,7 +4564,7 @@

      Method List

    893. -
    894. +
    895. private Top Level Namespace @@ -4388,7 +4572,7 @@

      Method List

    896. -
    897. +
    898. #private_methods Kernel @@ -4396,7 +4580,7 @@

      Method List

    899. -
    900. +
    901. protected Top Level Namespace @@ -4404,7 +4588,7 @@

      Method List

    902. -
    903. +
    904. #protected_methods Kernel @@ -4412,7 +4596,7 @@

      Method List

    905. -
    906. +
    907. #protocol Addrinfo @@ -4420,7 +4604,7 @@

      Method List

    908. -
    909. +
    910. public Top Level Namespace @@ -4428,7 +4612,7 @@

      Method List

    911. -
    912. +
    913. #public_methods Kernel @@ -4436,7 +4620,7 @@

      Method List

    914. -
    915. +
    916. #push Array @@ -4444,7 +4628,7 @@

      Method List

    917. -
    918. +
    919. #puts IO @@ -4452,7 +4636,7 @@

      Method List

    920. -
    921. +
    922. #puts Kernel @@ -4460,7 +4644,7 @@

      Method List

    923. -
    924. +
    925. #quo Numeric @@ -4468,7 +4652,7 @@

      Method List

    926. -
    927. +
    928. #raise Kernel @@ -4476,7 +4660,7 @@

      Method List

    929. -
    930. +
    931. #rand Random @@ -4484,7 +4668,7 @@

      Method List

    932. -
    933. +
    934. #rassoc Array @@ -4492,7 +4676,7 @@

      Method List

    935. -
    936. +
    937. read IO @@ -4500,7 +4684,7 @@

      Method List

    938. -
    939. +
    940. #read IO @@ -4508,7 +4692,7 @@

      Method List

    941. -
    942. +
    943. #readchar IO @@ -4516,7 +4700,7 @@

      Method List

    944. -
    945. +
    946. #readline IO @@ -4524,7 +4708,7 @@

      Method List

    947. -
    948. +
    949. #readlines IO @@ -4532,7 +4716,7 @@

      Method List

    950. -
    951. +
    952. #receiver Method @@ -4540,7 +4724,7 @@

      Method List

    953. -
    954. +
    955. #recv BasicSocket @@ -4548,7 +4732,7 @@

      Method List

    956. -
    957. +
    958. #recv_nonblock BasicSocket @@ -4556,7 +4740,7 @@

      Method List

    959. -
    960. +
    961. #recvfrom IPSocket @@ -4564,7 +4748,7 @@

      Method List

    962. -
    963. +
    964. #recvfrom Socket @@ -4572,7 +4756,7 @@

      Method List

    965. -
    966. +
    967. #recvfrom UNIXSocket @@ -4580,7 +4764,7 @@

      Method List

    968. -
    969. +
    970. #recvfrom_nonblock UDPSocket @@ -4588,7 +4772,7 @@

      Method List

    971. -
    972. +
    973. #recvfrom_nonblock Socket @@ -4596,7 +4780,7 @@

      Method List

    974. -
    975. +
    976. #rehash Hash @@ -4604,7 +4788,7 @@

      Method List

    977. -
    978. +
    979. #reject Enumerable @@ -4612,7 +4796,7 @@

      Method List

    980. -
    981. +
    982. #reject Hash @@ -4620,7 +4804,7 @@

      Method List

    983. -
    984. +
    985. #reject Enumerator::Lazy @@ -4628,7 +4812,7 @@

      Method List

    986. -
    987. +
    988. #reject! Hash @@ -4636,7 +4820,7 @@

      Method List

    989. -
    990. +
    991. #reject! Array @@ -4644,7 +4828,7 @@

      Method List

    992. -
    993. +
    994. #remote_address BasicSocket @@ -4652,7 +4836,7 @@

      Method List

    995. -
    996. +
    997. #remove_instance_variable Kernel @@ -4660,7 +4844,7 @@

      Method List

    998. -
    999. +
    1000. #replace Array @@ -4668,7 +4852,7 @@

      Method List

    1001. -
    1002. +
    1003. #replace String @@ -4676,7 +4860,7 @@

      Method List

    1004. -
    1005. +
    1006. #replace Hash @@ -4684,7 +4868,7 @@

      Method List

    1007. -
    1008. +
    1009. #respond_to? Kernel @@ -4692,7 +4876,7 @@

      Method List

    1010. -
    1011. +
    1012. #result StopIteration @@ -4700,7 +4884,7 @@

      Method List

    1013. -
    1014. +
    1015. #resume Fiber @@ -4708,7 +4892,7 @@

      Method List

    1016. -
    1017. +
    1018. #reverse Array @@ -4716,7 +4900,7 @@

      Method List

    1019. -
    1020. +
    1021. #reverse String @@ -4724,7 +4908,7 @@

      Method List

    1022. -
    1023. +
    1024. #reverse! Array @@ -4732,7 +4916,7 @@

      Method List

    1025. -
    1026. +
    1027. #reverse! String @@ -4740,7 +4924,7 @@

      Method List

    1028. -
    1029. +
    1030. #reverse_each Enumerable @@ -4748,7 +4932,7 @@

      Method List

    1031. -
    1032. +
    1033. #reverse_each Array @@ -4756,7 +4940,7 @@

      Method List

    1034. -
    1035. +
    1036. #rewind IO @@ -4764,6 +4948,14 @@

      Method List

    1037. +
    1038. +
      + #rewind + Enumerator::Chain +
      +
    1039. + +
    1040. #rewind @@ -4918,16 +5110,16 @@

      Method List

    1041. - #send - Kernel + #send + BasicSocket
    1042. - #send - BasicSocket + #send + Kernel
    1043. @@ -5069,6 +5261,14 @@

      Method List

    1044. +
      + #size + Enumerator::Chain +
      +
    1045. + + +
    1046. size? File @@ -5076,7 +5276,7 @@

      Method List

    1047. -
    1048. +
    1049. #slice Array @@ -5084,7 +5284,7 @@

      Method List

    1050. -
    1051. +
    1052. #slice String @@ -5092,7 +5292,7 @@

      Method List

    1053. -
    1054. +
    1055. #slice Hash @@ -5100,7 +5300,7 @@

      Method List

    1056. -
    1057. +
    1058. #slice! Array @@ -5108,7 +5308,7 @@

      Method List

    1059. -
    1060. +
    1061. #slice! String @@ -5116,7 +5316,7 @@

      Method List

    1062. -
    1063. +
    1064. sockaddr_in Socket @@ -5124,7 +5324,7 @@

      Method List

    1065. -
    1066. +
    1067. socket? File @@ -5132,7 +5332,7 @@

      Method List

    1068. -
    1069. +
    1070. socketpair UNIXSocket @@ -5140,7 +5340,7 @@

      Method List

    1071. -
    1072. +
    1073. #socktype Addrinfo @@ -5148,7 +5348,7 @@

      Method List

    1074. -
    1075. +
    1076. #sort Enumerable @@ -5156,7 +5356,7 @@

      Method List

    1077. -
    1078. +
    1079. #sort Array @@ -5164,7 +5364,7 @@

      Method List

    1080. -
    1081. +
    1082. #sort! Array @@ -5172,7 +5372,7 @@

      Method List

    1083. -
    1084. +
    1085. #sort_by Enumerable @@ -5180,7 +5380,7 @@

      Method List

    1086. -
    1087. +
    1088. #source_location UnboundMethod @@ -5188,7 +5388,7 @@

      Method List

    1089. -
    1090. +
    1091. #source_location Method @@ -5196,7 +5396,7 @@

      Method List

    1092. -
    1093. +
    1094. #split String @@ -5204,7 +5404,7 @@

      Method List

    1095. -
    1096. +
    1097. #sprintf Kernel @@ -5212,7 +5412,7 @@

      Method List

    1098. -
    1099. +
    1100. sqrt Math @@ -5220,7 +5420,23 @@

      Method List

    1101. +
    1102. +
      + #squeeze + String +
      +
    1103. + +
    1104. +
      + #squeeze! + String +
      +
    1105. + + +
    1106. #srand Random @@ -5228,7 +5444,7 @@

      Method List

    1107. -
    1108. +
    1109. #start_with? String @@ -5236,7 +5452,7 @@

      Method List

    1110. -
    1111. +
    1112. #step Integral @@ -5244,7 +5460,7 @@

      Method List

    1113. -
    1114. +
    1115. #store Hash @@ -5252,7 +5468,7 @@

      Method List

    1116. -
    1117. +
    1118. #strip String @@ -5260,7 +5476,7 @@

      Method List

    1119. -
    1120. +
    1121. #strip! String @@ -5268,7 +5484,7 @@

      Method List

    1122. -
    1123. +
    1124. #sub String @@ -5276,7 +5492,7 @@

      Method List

    1125. -
    1126. +
    1127. #sub! String @@ -5284,7 +5500,7 @@

      Method List

    1128. -
    1129. +
    1130. #succ String @@ -5292,7 +5508,7 @@

      Method List

    1131. -
    1132. +
    1133. #succ! String @@ -5300,7 +5516,7 @@

      Method List

    1134. -
    1135. +
    1136. #sunday? Time @@ -5308,7 +5524,7 @@

      Method List

    1137. -
    1138. +
    1139. #super_method UnboundMethod @@ -5316,7 +5532,7 @@

      Method List

    1140. -
    1141. +
    1142. #super_method Method @@ -5324,7 +5540,7 @@

      Method List

    1143. -
    1144. +
    1145. #swapcase String @@ -5332,7 +5548,7 @@

      Method List

    1146. -
    1147. +
    1148. #swapcase! String @@ -5340,7 +5556,7 @@

      Method List

    1149. -
    1150. +
    1151. symlink? File @@ -5348,7 +5564,7 @@

      Method List

    1152. -
    1153. +
    1154. #sync IO @@ -5356,7 +5572,7 @@

      Method List

    1155. -
    1156. +
    1157. #sync= IO @@ -5364,7 +5580,7 @@

      Method List

    1158. -
    1159. +
    1160. #sysaccept TCPServer @@ -5372,7 +5588,7 @@

      Method List

    1161. -
    1162. +
    1163. #sysaccept Socket @@ -5380,7 +5596,7 @@

      Method List

    1164. -
    1165. +
    1166. #sysaccept UNIXServer @@ -5388,7 +5604,7 @@

      Method List

    1167. -
    1168. +
    1169. #sysread IO @@ -5396,7 +5612,7 @@

      Method List

    1170. -
    1171. +
    1172. #sysread BasicSocket @@ -5404,7 +5620,7 @@

      Method List

    1173. -
    1174. +
    1175. #sysseek IO @@ -5412,7 +5628,7 @@

      Method List

    1176. -
    1177. +
    1178. #sysseek BasicSocket @@ -5420,7 +5636,7 @@

      Method List

    1179. -
    1180. +
    1181. #syswrite IO @@ -5428,7 +5644,7 @@

      Method List

    1182. -
    1183. +
    1184. #syswrite BasicSocket @@ -5436,7 +5652,7 @@

      Method List

    1185. -
    1186. +
    1187. #take Enumerable @@ -5444,7 +5660,7 @@

      Method List

    1188. -
    1189. +
    1190. #take Enumerator::Lazy @@ -5452,7 +5668,7 @@

      Method List

    1191. -
    1192. +
    1193. #take_while Enumerable @@ -5460,7 +5676,7 @@

      Method List

    1194. -
    1195. +
    1196. #take_while Enumerator::Lazy @@ -5468,7 +5684,7 @@

      Method List

    1197. -
    1198. +
    1199. tan Math @@ -5476,7 +5692,7 @@

      Method List

    1200. -
    1201. +
    1202. tanh Math @@ -5484,7 +5700,7 @@

      Method List

    1203. -
    1204. +
    1205. #tap Object @@ -5492,7 +5708,7 @@

      Method List

    1206. -
    1207. +
    1208. tcp Addrinfo @@ -5500,7 +5716,7 @@

      Method List

    1209. -
    1210. +
    1211. #thursday? Time @@ -5508,7 +5724,7 @@

      Method List

    1212. -
    1213. +
    1214. #times Integral @@ -5516,7 +5732,7 @@

      Method List

    1215. -
    1216. +
    1217. #to_a Struct @@ -5524,7 +5740,7 @@

      Method List

    1218. -
    1219. +
    1220. #to_a NilClass @@ -5532,14 +5748,6 @@

      Method List

    1221. -
    1222. -
      - #to_ary - Array -
      -
    1223. - -
    1224. #to_enum @@ -5605,14 +5813,6 @@

      Method List

    1225. -
      - #to_h - Array -
      -
    1226. - - -
    1227. #to_h Enumerable @@ -5620,7 +5820,7 @@

      Method List

    1228. -
    1229. +
    1230. to_h Enumerable @@ -5628,7 +5828,7 @@

      Method List

    1231. -
    1232. +
    1233. #to_h Hash @@ -5636,15 +5836,15 @@

      Method List

    1234. -
    1235. +
    1236. - #to_hash - Hash + #to_h + Array
    1237. -
    1238. +
    1239. #to_i String @@ -5652,7 +5852,7 @@

      Method List

    1240. -
    1241. +
    1242. #to_i Integer @@ -5660,7 +5860,7 @@

      Method List

    1243. -
    1244. +
    1245. #to_i Float @@ -5668,7 +5868,7 @@

      Method List

    1246. -
    1247. +
    1248. #to_i Time @@ -5676,7 +5876,7 @@

      Method List

    1249. -
    1250. +
    1251. #to_i NilClass @@ -5684,7 +5884,7 @@

      Method List

    1252. -
    1253. +
    1254. #to_int Integer @@ -5692,7 +5892,7 @@

      Method List

    1255. -
    1256. +
    1257. #to_int Float @@ -5700,6 +5900,14 @@

      Method List

    1258. +
    1259. +
      + #to_proc + Symbol +
      +
    1260. + +
    1261. #to_proc @@ -5725,14 +5933,6 @@

      Method List

    1262. -
      - #to_proc - Symbol -
      -
    1263. - - -
    1264. #to_s Exception @@ -5740,7 +5940,7 @@

      Method List

    1265. -
    1266. +
    1267. #to_s Kernel @@ -5748,7 +5948,7 @@

      Method List

    1268. -
    1269. +
    1270. #to_s NilClass @@ -5756,7 +5956,7 @@

      Method List

    1271. -
    1272. +
    1273. #to_s TrueClass @@ -5764,7 +5964,7 @@

      Method List

    1274. -
    1275. +
    1276. #to_s FalseClass @@ -5772,7 +5972,7 @@

      Method List

    1277. -
    1278. +
    1279. #to_s String @@ -5780,7 +5980,7 @@

      Method List

    1280. -
    1281. +
    1282. #to_s Symbol @@ -5788,7 +5988,7 @@

      Method List

    1283. -
    1284. +
    1285. #to_s Fixnum @@ -5796,7 +5996,7 @@

      Method List

    1286. -
    1287. +
    1288. #to_s Float @@ -5804,7 +6004,7 @@

      Method List

    1289. -
    1290. +
    1291. #to_s Time @@ -5812,7 +6012,7 @@

      Method List

    1292. -
    1293. +
    1294. #to_s UnboundMethod @@ -5820,7 +6020,7 @@

      Method List

    1295. -
    1296. +
    1297. #to_s Method @@ -5828,7 +6028,7 @@

      Method List

    1298. -
    1299. +
    1300. #to_sockaddr Addrinfo @@ -5836,7 +6036,7 @@

      Method List

    1301. -
    1302. +
    1303. #to_str String @@ -5844,7 +6044,7 @@

      Method List

    1304. -
    1305. +
    1306. #to_sym String @@ -5852,7 +6052,7 @@

      Method List

    1307. -
    1308. +
    1309. #to_sym Symbol @@ -5860,41 +6060,49 @@

      Method List

    1310. +
    1311. +
      + #tr + String +
      +
    1312. + +
    1313. - #transfer - Fiber + #tr! + String
    1314. - #transform_keys - Hash + #tr_s + String
    1315. - #transform_keys! - Hash + #tr_s! + String
    1316. - #transform_values - Hash + #transfer + Fiber
    1317. @@ -5902,23 +6110,23 @@

      Method List

    1318. - #transpose - Array + #transform_keys! + Hash
    1319. - #truncate - Float + #transform_values + Hash
    1320. @@ -5926,7 +6134,7 @@

      Method List

    1321. @@ -5934,8 +6142,8 @@

      Method List

    1322. - try_convert - String + #truncate + Float
    1323. @@ -5973,6 +6181,14 @@

      Method List

    1324. +
      + #union + Array +
      +
    1325. + + +
    1326. #uniq Enumerable @@ -5980,7 +6196,7 @@

      Method List

    1327. -
    1328. +
    1329. #uniq Enumerator::Lazy @@ -5988,7 +6204,7 @@

      Method List

    1330. -
    1331. +
    1332. #uniq Array @@ -5996,7 +6212,7 @@

      Method List

    1333. -
    1334. +
    1335. #uniq! Array @@ -6004,7 +6220,7 @@

      Method List

    1336. -
    1337. +
    1338. unix Addrinfo @@ -6012,7 +6228,7 @@

      Method List

    1339. -
    1340. +
    1341. #unix? Addrinfo @@ -6020,7 +6236,7 @@

      Method List

    1342. -
    1343. +
    1344. #unix_path Addrinfo @@ -6028,7 +6244,7 @@

      Method List

    1345. -
    1346. +
    1347. #unpack Socket::Option @@ -6036,7 +6252,7 @@

      Method List

    1348. -
    1349. +
    1350. unpack_sockaddr_in Socket @@ -6044,7 +6260,7 @@

      Method List

    1351. -
    1352. +
    1353. unpack_sockaddr_un Socket @@ -6052,7 +6268,7 @@

      Method List

    1354. -
    1355. +
    1356. #unshift Array @@ -6060,7 +6276,7 @@

      Method List

    1357. -
    1358. +
    1359. #upcase String @@ -6068,7 +6284,7 @@

      Method List

    1360. -
    1361. +
    1362. #upcase Symbol @@ -6076,7 +6292,7 @@

      Method List

    1363. -
    1364. +
    1365. #upcase! String @@ -6084,7 +6300,7 @@

      Method List

    1366. -
    1367. +
    1368. #upto Integral @@ -6092,7 +6308,7 @@

      Method List

    1369. -
    1370. +
    1371. #upto String @@ -6100,7 +6316,7 @@

      Method List

    1372. -
    1373. +
    1374. #usec Time @@ -6108,7 +6324,7 @@

      Method List

    1375. -
    1376. +
    1377. #utc Time @@ -6116,7 +6332,7 @@

      Method List

    1378. -
    1379. +
    1380. #utc? Time @@ -6124,7 +6340,7 @@

      Method List

    1381. -
    1382. +
    1383. #value? Hash @@ -6132,7 +6348,7 @@

      Method List

    1384. -
    1385. +
    1386. #values Hash @@ -6140,7 +6356,7 @@

      Method List

    1387. -
    1388. +
    1389. #values Struct @@ -6148,7 +6364,7 @@

      Method List

    1390. -
    1391. +
    1392. #values_at Struct @@ -6156,7 +6372,7 @@

      Method List

    1393. -
    1394. +
    1395. #values_at Array @@ -6164,7 +6380,7 @@

      Method List

    1396. -
    1397. +
    1398. #values_at Hash @@ -6172,7 +6388,7 @@

      Method List

    1399. -
    1400. +
    1401. #wday Time @@ -6180,7 +6396,7 @@

      Method List

    1402. -
    1403. +
    1404. #wednesday? Time @@ -6188,7 +6404,7 @@

      Method List

    1405. -
    1406. +
    1407. #with_index Enumerator @@ -6196,7 +6412,7 @@

      Method List

    1408. -
    1409. +
    1410. #with_object Enumerator @@ -6204,7 +6420,7 @@

      Method List

    1411. -
    1412. +
    1413. #write IO @@ -6212,7 +6428,7 @@

      Method List

    1414. -
    1415. +
    1416. #yday Time @@ -6220,7 +6436,7 @@

      Method List

    1417. -
    1418. +
    1419. #year Time @@ -6228,7 +6444,7 @@

      Method List

    1420. -
    1421. +
    1422. #yield Proc @@ -6236,7 +6452,7 @@

      Method List

    1423. -
    1424. +
    1425. #yield Enumerator::Yielder @@ -6244,7 +6460,7 @@

      Method List

    1426. -
    1427. +
    1428. #yield_self Kernel @@ -6252,7 +6468,7 @@

      Method List

    1429. -
    1430. +
    1431. zero? File @@ -6260,7 +6476,7 @@

      Method List

    1432. -
    1433. +
    1434. #zero? Integral @@ -6268,7 +6484,7 @@

      Method List

    1435. -
    1436. +
    1437. #zip Enumerable @@ -6276,7 +6492,7 @@

      Method List

    1438. -
    1439. +
    1440. #zip Enumerator::Lazy @@ -6284,7 +6500,7 @@

      Method List

    1441. -
    1442. +
    1443. #zone Time @@ -6292,7 +6508,7 @@

      Method List

    1444. -
    1445. +
    1446. #| NilClass @@ -6300,7 +6516,7 @@

      Method List

    1447. -
    1448. +
    1449. #| TrueClass @@ -6308,7 +6524,7 @@

      Method List

    1450. -
    1451. +
    1452. #| FalseClass @@ -6316,7 +6532,7 @@

      Method List

    1453. -
    1454. +
    1455. #| Fixnum @@ -6324,7 +6540,7 @@

      Method List

    1456. -
    1457. +
    1458. #| Float @@ -6332,7 +6548,7 @@

      Method List

    1459. -
    1460. +
    1461. #| Array @@ -6340,7 +6556,7 @@

      Method List

    1462. -
    1463. +
    1464. #~ Fixnum @@ -6348,7 +6564,7 @@

      Method List

    1465. -
    1466. +
    1467. #~ Float diff --git a/docs/api/top-level-namespace.html b/docs/api/top-level-namespace.html index cf83412..c0c45a7 100644 --- a/docs/api/top-level-namespace.html +++ b/docs/api/top-level-namespace.html @@ -6,7 +6,7 @@ Top Level Namespace - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.19 @@ -95,25 +95,31 @@

      Defined Under Namespace

      -

      Constant Summary

      -
      - -
      STDIN = - -
      -
      IO.open(0, "r")
      - -
      STDOUT = - -
      -
      IO.open(1, "w")
      - -
      STDERR = - -
      -
      IO.open(2, "w")
      - -
      + +

      + Constant Summary + collapse +

      + +
      + +
      STDIN = + +
      +
      IO.open(0, "r")
      + +
      STDOUT = + +
      +
      IO.open(1, "w")
      + +
      STDERR = + +
      +
      IO.open(2, "w")
      + +
      + @@ -218,38 +224,6 @@

      -

    1468. - - - - -

      - Instance Method Summary - collapse -

      - -
        - -
      • - - - #dig(idx, *args) ⇒ Object - - - - - - - - - - - - - -

        call-seq: hsh.dig(key,…) -> object.

        -
        -
      • @@ -374,69 +348,6 @@

        - - - - -
        -

        Instance Method Details

        - - -
        -

        - - #dig(idx, *args) ⇒ Object - - - - - -

        -
        -

        call-seq: - hsh.dig(key,…) -> object

        - -

        Extracts the nested value specified by the sequence of key -objects by calling +dig+ at each step, returning +nil+ if any -intermediate step is +nil+.

        - - -
        -
        -
        - - -
        - - - - - - -
        -
        -
        -
        -94
        -95
        -96
        -97
        -98
        -99
        -100
        -101
        -
        -
        # File 'mrbgems/mruby-struct/mrblib/struct.rb', line 94
        -
        -def dig(idx,*args)
        -  n = self[idx]
        -  if args.size > 0
        -    n&.dig(*args)
        -  else
        -    n
        -  end
        -end
        -
        @@ -444,9 +355,9 @@

        From 8d94293345caad2ab5980eb8bea99867a0e79a19 Mon Sep 17 00:00:00 2001 From: Yasuhiro Horimoto Date: Thu, 27 Jun 2019 22:39:59 +0900 Subject: [PATCH 005/250] Fix a broken link --- _config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/_config.yml b/_config.yml index 07179a8..3bf4fdb 100644 --- a/_config.yml +++ b/_config.yml @@ -1,6 +1,7 @@ name: mruby markdown: kramdown highlighter: rouge +include: _index.html exclude: - Gemfile - Gemfile.lock From 2e0c77a12b846008b40509415e5622b32b8677e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2019 10:52:34 +0000 Subject: [PATCH 006/250] Bump nokogiri from 1.10.3 to 1.10.4 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.3 to 1.10.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.3...v1.10.4) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1b61ba2..276db0f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -208,7 +208,7 @@ GEM jekyll-seo-tag (~> 2.1) minitest (5.11.3) multipart-post (2.1.1) - nokogiri (1.10.3) + nokogiri (1.10.4) mini_portile2 (~> 2.4.0) octokit (4.14.0) sawyer (~> 0.8.0, >= 0.5.3) From 71f77fa24541efa56e8ab321f86c1c1969b8deca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2019 13:55:21 +0000 Subject: [PATCH 007/250] Bump rubyzip from 1.2.2 to 2.0.0 Bumps [rubyzip](https://github.com/rubyzip/rubyzip) from 1.2.2 to 2.0.0. - [Release notes](https://github.com/rubyzip/rubyzip/releases) - [Changelog](https://github.com/rubyzip/rubyzip/blob/master/Changelog.md) - [Commits](https://github.com/rubyzip/rubyzip/compare/v1.2.2...v2.0.0) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 276db0f..f18ce3d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -222,7 +222,7 @@ GEM ruby-enum (0.7.2) i18n ruby_dep (1.5.0) - rubyzip (1.2.2) + rubyzip (2.0.0) safe_yaml (1.0.5) sass (3.7.4) sass-listen (~> 4.0.0) From ae24f5c22a8c43051d5477aadc3ed8bfa7fedbde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2019 13:55:21 +0000 Subject: [PATCH 008/250] Bump yard from 0.9.19 to 0.9.20 Bumps [yard](https://github.com/lsegal/yard) from 0.9.19 to 0.9.20. - [Release notes](https://github.com/lsegal/yard/releases) - [Changelog](https://github.com/lsegal/yard/blob/master/CHANGELOG.md) - [Commits](https://github.com/lsegal/yard/compare/v0.9.19...v0.9.20) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 276db0f..1852981 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -240,7 +240,7 @@ GEM tzinfo (1.2.5) thread_safe (~> 0.1) unicode-display_width (1.6.0) - yard (0.9.19) + yard (0.9.20) yard-coderay (0.1.0) coderay yard From 9d0c68d6444b47ee5cfc2d01d72eb19b1fe6d81d Mon Sep 17 00:00:00 2001 From: Hiroshi Mimaki Date: Tue, 19 Nov 2019 23:41:30 +0900 Subject: [PATCH 009/250] mruby 2.1.0 released. --- .../2019-11-10-mruby-2.1.0-released.markdown | 259 ++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 _posts/2019-11-10-mruby-2.1.0-released.markdown diff --git a/_posts/2019-11-10-mruby-2.1.0-released.markdown b/_posts/2019-11-10-mruby-2.1.0-released.markdown new file mode 100644 index 0000000..599f569 --- /dev/null +++ b/_posts/2019-11-10-mruby-2.1.0-released.markdown @@ -0,0 +1,259 @@ +--- +layout: post +title: "mruby 2.1.0 released" +date: 2019-11-19 00:00:00 +categories: releases +--- + +# mruby 2.1.0 + +We are proudly announcing the stable release of mruby 2.0 series - [mruby 2.1.0](https://github.com/mruby/mruby/releases/tag/2.1.0). +The [mruby 2.1.0](https://github.com/mruby/mruby/releases/tag/2.1.0) has been enhanced with compatibility with Ruby 2 series, and some new features of Ruby 2.7 have been added. + +--- + +# New Features + +## Core Language Features + +- Suffix support (`Rational` and `Complex` literals) (#4125) + +## Core Libraries + +### Ruby 2.7 features + +- Add `Array#intersection` method which returns a new array containing elements common to both arrays. (mrbgems/mruby-array-ext) +- Add `Enumerable#filter_map` method which is a short hand for `filter` + `map` in a single call. (mrbgems/mruby-enum-ext) +- Add `Enumerable#tally` method which group and count elements of the collection. (mrbgems/mruby-enum-ext) +- Add `Enumerator.produce` method which creates an infinite enumerator from any block. (mrbgems/mruby-enumerator) +- Add `UnboundMethod#bind_call` method which call a method that overridden without allocation of intermediate Method object. (mruby-method) +- `Module#name`, `true#to_s`, `false#to_s` return a frozen string. The returned string is always the same object. + +### Ruby 2.6 features + +- Add `Array#difference` method: +`Array#difference` returns a new array that is a copy of the original array, removing any items that also appear in other_ary. (mrbgems/mruby-array-ext) + +### New Libraries + +- Add `mrbgems/mruby-rational`: +[dyama/mruby-rational](https://github.com/dyama/mruby-rational) has been included into the core library, and rational numbers like `1/3` can be handled. +- Add `mrbgems/mruby-complex`: +[pbosetti/mruby-complex](https://github.com/pbosetti/mruby-complex) has been included into the core library to handle complex numbers. + +### New C APIs + +#### Macros for checking object type + +```c +mrb_false_p(o) +mrb_true_p(o) +mrb_free_p(o) +mrb_object_p(o) +mrb_class_p(o) +mrb_module_p(o) +mrb_iclass_p(o) +mrb_sclass_p(o) +mrb_proc_p(o) +mrb_range_p(o) +mrb_file_p(o) +mrb_env_p(o) +mrb_data_p(o) +mrb_fiber_p(o) +mrb_istruct_p(o) +mrb_break_p(o) +``` + +#### mruby core (mruby.h) + +```c +MRB_API mrb_int mrb_cmp(mrb_state *mrb, mrb_value obj1, mrb_value obj2); +``` + +#### mruby binary (mruby/dump.h, mruby/irep.h) + +```c +MRB_API mrb_irep *mrb_read_irep_buf(mrb_state*, const void*, size_t); // mruby/dump.h +MRB_API mrb_value mrb_load_irep_buf(mrb_state*, const void*, size_t); // mruby/irep.h +MRB_API mrb_value mrb_load_irep_buf_cxt(mrb_state*, const void*, size_t, mrbc_context*); // mruby/irep.h +``` + +#### Numeric class (mruby/numeric.h) + +```c +MRB_API mrb_value mrb_num_plus(mrb_state *mrb, mrb_value x, mrb_value y); +MRB_API mrb_value mrb_num_minus(mrb_state *mrb, mrb_value x, mrb_value y); +MRB_API mrb_value mrb_num_mul(mrb_state *mrb, mrb_value x, mrb_value y); +MRB_API mrb_value mrb_int_value(mrb_state *mrb, mrb_float f); +``` + +#### String class (mruby/string.h) + +```c +MRB_API void mrb_str_modify_keep_ascii(mrb_state *mrb, struct RString *s); +MRB_API const char *mrb_string_cstr(mrb_state *mrb, mrb_value str); +``` + +#### mruby/value.h + +- Add customized `mrb_ro_data_p()` (#4408) + +#### Enumerable module and Hash class + +- Add `filter` aliases for `Enumerable` and `Hash`. (57a0132b) + +## Configuration + +- (Proof of Concept) mruby tuning profiles (#4446) + +## mrbtest + +### Test Features + +- Warn if assertion is missing inside `assert` (#4320) + +### New test method (mrbtest) + +```ruby +assert_match(pattern, str, msg=nil) +assert_not_match(pattern, str, msg=nil) +assert_raise_with_message(exc, exp_msg, msg = nil, &block +assert_raise_with_message_pattern(exc, exp_msg, msg = nil, &block) +assert_not_nil(target, msg) +``` + +## Tools + +### Interactive mruby (mirb) + +- As with `irb` in Ruby, a local variable `_` is added to store the last result. + +--- +# Update Features + +## mruby core + +- Allow newlines and comments between method calls. (4296c77e) +- Support `&.` at the beginning of the line (4124047c) + +## Build system + +- Support lock file +It is now possible to fix mruby and mrbgems versions in products that use mruby. +- Rename MRB_USE_ETEXT_EDATA to MRB_USE_LINK_TIME_RO_DATA_P and support lld linked programs (#4716) + +## C APIs + +### mruby core + +- Keyword arguments can be obtained with `mrb_get_args` using the format string `:`. +- `mrb_parser_dump` supports displaying `NODE_DSYM`, `NODE_WORDS`, `NODE_SYMBOLS` and `NODE_LITERAL_DELIM`. +- Raise `ArgumentError` by `aspec` check. (30f37872) + +### src/error.c + +- Add new specifiers/modifiers to format string of `mrb_vfromat()` (#4608) + +## mrbtest + +- Nested `assert` for mrbtest (#4540) + +--- +# Compatibility + +## mruby core + +- Pad leading zero to month and day in `MRUBY_RELEASE_DATE` (#4353) + +## Core Libraries + +- Add `Class#new(*args, &block)` method. +- Add optional argument to `Module#class_variables`. +- Add constants for floating point number. (`RADIX`, `MANT_DIG`, `EPSILON`, `DIG`, `MIN_EXP`, `MIN`, `MIN_10_EXP`, `MAX_EXP`, `MAX`, `MAX_10_EXP`) +- Removed `$1`..`$9` from `Kernel#global_variables`. +- String#unpack/Array#pack does support base64 directive (`m`). +- Add encoding argument to `Integral#chr` (#4593) +- Fixed `length` for IO should be in bytes, not in characters (8c90b5fc) + +--- +# Breaking Changes + +There are three major breaking changes from mruby 2.0.1. + +## Changed methods + +- Move `Array#append` and `Array#prepend` from core to `mrbgems/mruby-ary-ext`. +- Move `Numeric#div` from `mrbgems/mruby-numeric-ext` to the core. +- Move `Integral#zero?`, `Integral#nonzero?`, `Integral#positive?` and `Integral#negative)?` to `Numeric` class. +- Move `Numeric#__coerce_step_counter` to `Integral` class. +- Move `Kernel#instance_exec`, `Kernel#equal?` and `Kernel#instance_eval` to `BasicObject` class. +- Move `NilClass#to_h` to `mrbgems/mruby-object-ext` from `mrbgems/mruby-enum-ext` +- Move `String#getbyte`, `String#setbyte` and `String#byteslice` to the core. (#4696) +- Remove `Kernel#global_variables` from core. This method is defined in `mrbgems/mruby-metaprog`. +- Integrate `Integral#chr` (`Fixnum#chr`) to `mrbgems/mruby-string-ext`. +- Remove `String#=~` and `String#match` that requires `Regexp` (fd37bc53) +- `Symbol#to_s` return a frozen string. The returned string is always the same object. This feature will be reverted next mruby, because which reverted from Ruby 2.7. +- Explicit `.0` is removed from result of `Float#to_s` and `Float#inspect`. (9d08025b) + +## Change C APIs + +- Rename symbol-to-string functions. (#4684) + - `mrb_sym2name()` -> `mrb_sym_name()` + - `mrb_sym2name_len()` -> `mrb_sym_name_len()` + - `mrb_sym2str()` -> `mrb_sym_str()` + +## Remove C APIs + +- Functions to remove `MRB_API` from definitions (referenced from within `libmruby`): +`mrb_instance_new()`, `mrb_vm_define_class()`, `mrb_vm_define_module()` +- `struct RIstruct` is renamed to `struct RIStruct` (e41f1574) +* Remove `mrb_fixnum_plus()`, `mrb_fixnum_minus()`, `mrb_fixnum_mul()`, and `mrb_num_div()`. Use `mrb_num_plus()`, `mrb_num_minus()`, `mrb_num_mul()` instead. +- Remove a member `ary` of `struct RString`. `struct RStringEmbed` is used for String embedding. (#4646) + +## mruby core + +- Remove global variable `$/`. The current Ruby policy do not encourage Perl-ish global variables. +- Remove `MRB_TT_HAS_BASIC` macro. (#4728) +- Remove members `flags` and `mems` of `struct mrb_state`. (0c5f26e0 and #4470) + +## Configuration + +- Remove `MRB_METHOD_TABLE_INLINE` and `MRB_NO_INIT_ARRAY_START`. (2256bb07 and #4716) +- `MRB_USE_ETEXT_EDATA` is deprecated (warned and ignored). instead, use `MRB_USE_LINK_TIME_RO_DATA_P`. (#4716) + +## mruby binary (MRB) + +- Remove "LINE" section reader. (#4455) + +--- +# Major bug fixes + +- `SystemStackError` is raised from `String#=~`. (#4363) +- Null pointer dereference in ecall. (#4370) +- mismatched shift functions. (#4380) +- Compilation error with "MRB_ARY_EMBED_LEN_MAX" in "array.h". (#4382) +- Fixed a bug in recursive `mrb_top_run` calls; fix (#4384) +- Unexpected error: `Can't get cfunc env from non-cfunc proc.` (#4389) +- build error on master by MRB_WITHOUT_FLOAT. (#4478) +- Null pointer dereference in mrb_str_cat_str. (#4504) +- Some comments do not increment lineno on context. (#4513) +- Null pointer dereference in mrb_check_frozen. (#4519) +- Invalid read in mrb_class. (#4534) +- Array#inspect recurses too much for self-referential arrays. (#4552) +- Infinite loop in Integer#step when both args are INFINITY. (#4555) +- Float#round hangs for large ndigits. (#4566) +- Cannot call `Fiber.yield` in method. (#4567) +- Reference to top-level variable in top-level block is broken. (#4581) +- Bugs with mutually recursive Array and Hash. (#4582) +- `mrb_gc_unregister()` may access freed memory. (#4618) +- memcpy-param-overlap in str_replace_partial. (#4627) +- Symbol#inspect does not handle Unicode characters. (#4678) +- mrb_funcall returns odd value. (#4696) +- behavior of alias is defferent from CRuby. (#4718) +- compile error at master by clang 9. (#4786) + +--- + +We have done 912 commits to 229 files, 12,006 lines were added, 5,382 lines removed since mruby 2.0.1. For more detail of the updates, [see Commit Log](https://github.com/mruby/mruby/compare/2.0.1...stable). + +Let's try `mruby 2.1.0`. From 98fef87a44f499eec686eeafb66620a82686862f Mon Sep 17 00:00:00 2001 From: Hiroshi Mimaki Date: Tue, 26 Nov 2019 18:48:01 +0900 Subject: [PATCH 010/250] Fix discription of `mruby-rational` and `mruby-complex`. --- _posts/2019-11-10-mruby-2.1.0-released.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_posts/2019-11-10-mruby-2.1.0-released.markdown b/_posts/2019-11-10-mruby-2.1.0-released.markdown index 599f569..17222bb 100644 --- a/_posts/2019-11-10-mruby-2.1.0-released.markdown +++ b/_posts/2019-11-10-mruby-2.1.0-released.markdown @@ -37,9 +37,9 @@ The [mruby 2.1.0](https://github.com/mruby/mruby/releases/tag/2.1.0) has been en ### New Libraries - Add `mrbgems/mruby-rational`: -[dyama/mruby-rational](https://github.com/dyama/mruby-rational) has been included into the core library, and rational numbers like `1/3` can be handled. +`Rational` class has been included into the core library, and rational numbers like `1/3` can be handled. - Add `mrbgems/mruby-complex`: -[pbosetti/mruby-complex](https://github.com/pbosetti/mruby-complex) has been included into the core library to handle complex numbers. +`Complex` class has been included into the core library to handle complex numbers. ### New C APIs From 6b5b3e3baaa2e7eda70017c5210215ad3154b87f Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 27 Nov 2019 22:36:42 +0900 Subject: [PATCH 011/250] Update for `2.1.0`; mruby#4844 --- _data/mgems.yml | 514 ++- docs/api/Addrinfo.html | 62 +- docs/api/ArgumentError.html | 8 +- docs/api/Array.html | 1576 ++++--- docs/api/BasicSocket.html | 146 +- docs/api/Comparable.html | 24 +- docs/api/Complex.html | 1285 ++++++ docs/api/EOFError.html | 8 +- docs/api/Enumerable.html | 403 +- docs/api/Enumerator.html | 337 +- docs/api/Enumerator/Chain.html | 143 +- docs/api/Enumerator/Generator.html | 14 +- docs/api/Enumerator/Lazy.html | 36 +- docs/api/Enumerator/Yielder.html | 14 +- docs/api/Exception.html | 72 +- docs/api/FalseClass.html | 18 +- docs/api/Fiber.html | 70 +- docs/api/File.html | 232 +- docs/api/File/Constants.html | 6 +- docs/api/File/FileError.html | 148 - docs/api/File/NoFileError.html | 152 - docs/api/File/PermissionError.html | 152 - docs/api/File/UnableToStat.html | 152 - docs/api/FileTest.html | 10 +- docs/api/Fixnum.html | 446 +- docs/api/Float.html | 540 ++- docs/api/FloatDomainError.html | 8 +- docs/api/FrozenError.html | 8 +- docs/api/GC.html | 6 +- docs/api/Hash.html | 397 +- docs/api/IO.html | 550 +-- docs/api/IOError.html | 8 +- docs/api/IPSocket.html | 22 +- docs/api/IndexError.html | 8 +- docs/api/Integer.html | 64 +- docs/api/Integral.html | 1090 ++++- docs/api/Kernel.html | 1467 +++---- docs/api/KeyError.html | 8 +- docs/api/LocalJumpError.html | 8 +- docs/api/Math.html | 246 +- docs/api/Method.html | 821 ++-- docs/api/Module.html | 26 +- docs/api/NameError.html | 10 +- docs/api/NilClass.html | 113 +- docs/api/NoMemoryError.html | 8 +- docs/api/NoMethodError.html | 10 +- docs/api/NotImplementedError.html | 8 +- docs/api/Numeric.html | 881 +--- docs/api/Object.html | 273 -- docs/api/ObjectSpace.html | 6 +- docs/api/Proc.html | 22 +- docs/api/Random.html | 174 +- docs/api/Range.html | 186 +- docs/api/RangeError.html | 8 +- docs/api/Rational.html | 678 +++ docs/api/RegexpError.html | 8 +- docs/api/ScriptError.html | 8 +- docs/api/Socket.html | 36 +- docs/api/Socket/Constants.html | 6 +- docs/api/Socket/Option.html | 32 +- docs/api/SocketError.html | 8 +- docs/api/StandardError.html | 8 +- docs/api/StopIteration.html | 10 +- docs/api/String.html | 4287 +++++++++---------- docs/api/Struct.html | 376 +- docs/api/Symbol.html | 182 +- docs/api/SystemStackError.html | 8 +- docs/api/TCPServer.html | 16 +- docs/api/TCPSocket.html | 10 +- docs/api/Time.html | 1110 +++-- docs/api/TrueClass.html | 20 +- docs/api/TypeError.html | 8 +- docs/api/UDPSocket.html | 18 +- docs/api/UNIXServer.html | 16 +- docs/api/UNIXSocket.html | 18 +- docs/api/UnboundMethod.html | 709 +-- docs/api/_index.html | 51 +- docs/api/class_list.html | 2 +- docs/api/file.AUTHORS.html | 6 +- docs/api/file.CONTRIBUTING.html | 19 +- docs/api/file.LICENSE.html | 6 +- docs/api/file.README.html | 35 +- docs/api/file.compile.html | 20 +- docs/api/file.debugger.html | 8 +- docs/api/file.gc-arena-howto.html | 6 +- docs/api/file.mrbconf.html | 57 +- docs/api/file.mrbgems.html | 11 +- docs/api/frames.html | 2 +- docs/api/function_list.html | 406 +- docs/api/headers.html | 6 +- docs/api/headers/mrbconf.h.html | 36 +- docs/api/headers/mruby.h.html | 809 +++- docs/api/headers/mruby_2Farray.h.html | 6 +- docs/api/headers/mruby_2Fboxing_nan.h.html | 11 +- docs/api/headers/mruby_2Fboxing_no.h.html | 11 +- docs/api/headers/mruby_2Fboxing_word.h.html | 68 +- docs/api/headers/mruby_2Fclass.h.html | 52 +- docs/api/headers/mruby_2Fcommon.h.html | 11 +- docs/api/headers/mruby_2Fcompile.h.html | 6 +- docs/api/headers/mruby_2Fdata.h.html | 34 +- docs/api/headers/mruby_2Fdebug.h.html | 6 +- docs/api/headers/mruby_2Fdump.h.html | 39 +- docs/api/headers/mruby_2Ferror.h.html | 47 +- docs/api/headers/mruby_2Fext_2Fio.h.html | 6 +- docs/api/headers/mruby_2Fgc.h.html | 6 +- docs/api/headers/mruby_2Fhash.h.html | 12 +- docs/api/headers/mruby_2Firep.h.html | 154 +- docs/api/headers/mruby_2Fistruct.h.html | 6 +- docs/api/headers/mruby_2Fkhash.h.html | 11 +- docs/api/headers/mruby_2Fnumeric.h.html | 168 +- docs/api/headers/mruby_2Fobject.h.html | 10 +- docs/api/headers/mruby_2Fopcode.h.html | 6 +- docs/api/headers/mruby_2Fproc.h.html | 29 +- docs/api/headers/mruby_2Frange.h.html | 24 +- docs/api/headers/mruby_2Fre.h.html | 6 +- docs/api/headers/mruby_2Fstring.h.html | 345 +- docs/api/headers/mruby_2Fthrow.h.html | 6 +- docs/api/headers/mruby_2Ftime.h.html | 10 +- docs/api/headers/mruby_2Fvalue.h.html | 261 +- docs/api/headers/mruby_2Fvariable.h.html | 22 +- docs/api/headers/mruby_2Fversion.h.html | 21 +- docs/api/index.html | 35 +- docs/api/method_list.html | 1134 +++-- docs/api/top-level-namespace.html | 16 +- downloads/index.html | 2 +- index.html | 2 +- team/index.html | 15 +- 127 files changed, 13900 insertions(+), 10754 deletions(-) create mode 100644 docs/api/Complex.html delete mode 100644 docs/api/File/FileError.html delete mode 100644 docs/api/File/NoFileError.html delete mode 100644 docs/api/File/PermissionError.html delete mode 100644 docs/api/File/UnableToStat.html delete mode 100644 docs/api/Object.html create mode 100644 docs/api/Rational.html diff --git a/_data/mgems.yml b/_data/mgems.yml index a04fc38..cdfd729 100644 --- a/_data/mgems.yml +++ b/_data/mgems.yml @@ -41,6 +41,13 @@ protocol: git repository: https://github.com/kyab/mruby-arduino.git repooptions: +- name: mruby-argon2 + description: The password hash Argon2, winner of PHC for mruby + author: Hendrik Beskow + website: https://github.com/Asmod4n/mruby-argon2 + protocol: git + repository: https://github.com/Asmod4n/mruby-argon2.git + repooptions: - name: mruby-argtable description: Argtable class author: @@ -85,6 +92,14 @@ protocol: git repository: https://github.com/iij/mruby-aws-s3.git repooptions: +- name: mruby-aws-sigv4 + description: AWS Signature Version 4 signing library for mruby. mruby port of aws-sigv4 + rubygem. + author: Okumura Takahiro + website: https://github.com/hfm/mruby-aws-sigv4 + protocol: git + repository: https://github.com/hfm/mruby-aws-sigv4.git + repooptions: - name: mruby-b64 description: Base64 for mruby with streaming interface author: Hendrik Beskow @@ -102,9 +117,9 @@ - name: mruby-base32 description: Base32 Encoder/Decoder author: qtakamitsu - website: https://github.com/qtkmz/mruby-base32 + website: https://github.com/tk3/mruby-base32 protocol: git - repository: https://github.com/qtkmz/mruby-base32.git + repository: https://github.com/tk3/mruby-base32.git repooptions: - name: mruby-base58 description: Base58 Encoder/Decoder @@ -134,6 +149,20 @@ protocol: git repository: https://github.com/chasonr/mruby-bignum.git repooptions: +- name: mruby-bin-mirb-hostbased + description: Hostbased mirb for serial connection + author: kyab + website: https://github.com/kyab/mruby-bin-mirb-hostbased + protocol: git + repository: https://github.com/kyab/mruby-bin-mirb-hostbased.git + repooptions: +- name: mruby-bin-mruby-afl + description: mruby interpreter in american fuzzy lop persistent mode + author: Daniel Bovensiepen + website: https://github.com/bovi/mruby-bin-mruby-afl + protocol: git + repository: https://github.com/bovi/mruby-bin-mruby-afl.git + repooptions: - name: mruby-bin-scite-mruby description: A SciTE based text editor with mruby scripting extension author: Takashi Sawanaka @@ -148,6 +177,13 @@ protocol: git repository: https://github.com/IceDragon200/mruby-blendish repooptions: +- name: mruby-c-ext-helpers + description: Helpers for mruby c extensions + author: Asmod4n + website: https://github.com/Asmod4n/mruby-c-ext-helpers + protocol: git + repository: https://github.com/Asmod4n/mruby-c-ext-helpers.git + repooptions: - name: mruby-cache description: mruby inter process share memory cache author: charlescui @@ -162,6 +198,13 @@ protocol: git repository: https://github.com/matsumotory/mruby-capability.git repooptions: +- name: mruby-capacity + description: mruby capacity interface + author: pyama86 + website: https://github.com/pyama86/mruby-capacity + protocol: git + repository: https://github.com/pyama86/mruby-capacity.git + repooptions: - name: mruby-catch-throw description: catch and throw for mruby. author: Corey Powell @@ -172,9 +215,9 @@ - name: mruby-cfunc description: Interface to C functions based on libffi. author: Yuichiro MASUI - website: https://github.com/mobiruby/mruby-cfunc + website: https://github.com/mrbgems/mruby-cfunc protocol: git - repository: https://github.com/mobiruby/mruby-cfunc.git + repository: https://github.com/mrbgems/mruby-cfunc.git repooptions: - name: mruby-cgroup description: cgroup binding @@ -204,7 +247,7 @@ protocol: git repository: https://github.com/IceDragon200/mruby-chipmunk2d repooptions: -- name: mruby-chrony +- name: mruby-chrono description: Steady and System clocks for mruby author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-chrono @@ -246,6 +289,13 @@ protocol: git repository: https://github.com/pbosetti/mruby-complex.git repooptions: +- name: mruby-concurrently + description: A concurrency framework based on fibers + author: Christopher Aue + website: https://github.com/christopheraue/m-ruby-concurrently + protocol: git + repository: https://github.com/christopheraue/m-ruby-concurrently.git + repooptions: - name: mruby-config description: With mruby we continuously switching between Ruby and C code. mruby-config gives you an easy way to maintain configuration values on both sides. @@ -268,6 +318,13 @@ protocol: git repository: https://github.com/matsumotory/mruby-correlation.git repooptions: +- name: mruby-crc + description: Configurable general CRC calcurator for mruby + author: dearblue + website: https://github.com/dearblue/mruby-crc + protocol: git + repository: https://github.com/dearblue/mruby-crc.git + repooptions: - name: mruby-criu description: CRIU, Checkpoint Restart In Userspace for Linux, class author: MATSUMOTO Ryosuke @@ -310,6 +367,13 @@ protocol: git repository: https://github.com/inokappa/mruby-datadog.git repooptions: +- name: mruby-delegate + description: delegate implementation for mruby + author: dearblue + website: https://github.com/dearblue/mruby-delegate + protocol: git + repository: https://github.com/dearblue/mruby-delegate.git + repooptions: - name: mruby-digest description: MD5, RMD160, SHA1, SHA256, SHA384, SHA512 and HMAC Digests. author: Internet Initiative Japan., Inc. @@ -380,6 +444,34 @@ protocol: git repository: https://github.com/iij/mruby-errno.git repooptions: +- name: mruby-esp32-gpio + description: GPIO library for ESP32 MCU + author: YAMAMOTO Masaya + website: https://github.com/mruby-esp32/mruby-esp32-gpio + protocol: git + repository: https://github.com/mruby-esp32/mruby-esp32-gpio.git + repooptions: +- name: mruby-esp32-i2c + description: I2C library for ESP32 MCU + author: YAMAMOTO Masaya + website: https://github.com/mruby-esp32/mruby-esp32-i2c + protocol: git + repository: https://github.com/mruby-esp32/mruby-esp32-i2c.git + repooptions: +- name: mruby-esp32-system + description: System library for ESP32 MCU + author: Carson McDonald + website: https://github.com/mruby-esp32/mruby-esp32-system + protocol: git + repository: https://github.com/mruby-esp32/mruby-esp32-system.git + repooptions: +- name: mruby-esp32-wifi + description: WIFI library for ESP32 MCU + author: Carson McDonald + website: https://github.com/mruby-esp32/mruby-esp32-wifi + protocol: git + repository: https://github.com/mruby-esp32/mruby-esp32-wifi.git + repooptions: - name: mruby-etcd description: Simple etcd API wrapper author: Uchio Kondo @@ -402,6 +494,27 @@ protocol: git repository: https://github.com/matsumotory/mruby-fast-remote-check.git repooptions: +- name: mruby-fiberpool + description: mruby port of fiberpool + author: mattn + website: https://github.com/mattn/mruby-fiberpool + protocol: git + repository: https://github.com/mattn/mruby-fiberpool.git + repooptions: +- name: mruby-file-access + description: File access class + author: takumakume + website: https://github.com/takumakume/mruby-file-access + protocol: git + repository: https://github.com/takumakume/mruby-file-access.git + repooptions: +- name: mruby-file-fnmatch + description: File.fnmatch() + author: katzer + website: https://github.com/appplant/mruby-file-fnmatch + protocol: git + repository: https://github.com/appplant/mruby-file-fnmatch.git + repooptions: - name: mruby-file-stat description: File::Stat class implementation author: ksss @@ -458,6 +571,13 @@ protocol: git repository: https://github.com/UniTN-Mechatronics/mruby-ftp.git repooptions: +- name: mruby-gemcut + description: runtime reconfigurer for mruby gems + author: dearblue + website: https://github.com/dearblue/mruby-gemcut + protocol: git + repository: https://github.com/dearblue/mruby-gemcut.git + repooptions: - name: mruby-geoip description: GeoIP(City) class using GeoIPCity.dat for mruby author: MATSUMOTO Ryosuke @@ -465,6 +585,13 @@ protocol: git repository: https://github.com/matsumotory/mruby-geoip.git repooptions: +- name: mruby-getloadavg + description: Linux getloadavg(3) module + author: takumakume + website: https://github.com/takumakume/mruby-getloadavg + protocol: git + repository: https://github.com/takumakume/mruby-getloadavg.git + repooptions: - name: mruby-getoptlong description: An almost straight mruby port of Ruby's GetoptLong author: Sergio Rubio @@ -486,6 +613,13 @@ protocol: git repository: https://github.com/Asmod4n/mruby-getpass.git repooptions: +- name: mruby-gettimeofday + description: A simple wrapper of `gettimeofday(2)` for mruby + author: mame + website: https://github.com/mame/mruby-gettimeofday + protocol: git + repository: https://github.com/mame/mruby-gettimeofday.git + repooptions: - name: mruby-girffi description: GObjectIntrospection bindings that dynamically bind GLib based libraries. ie, GLib,Gtk,WebKit ... @@ -595,6 +729,13 @@ protocol: git repository: https://github.com/k0kubun/mruby-hashie.git repooptions: +- name: mruby-heeler + description: Multi-process webserver + author: Sebastian Katzer + website: https://github.com/katzer/mruby-heeler + protocol: git + repository: https://github.com/katzer/mruby-heeler.git + repooptions: - name: mruby-hibari description: A Web application framework for Web servers that support mruby and Rack-based API @@ -610,12 +751,19 @@ protocol: git repository: https://github.com/Asmod4n/mruby-hiredis.git repooptions: +- name: mruby-hmac + description: Digest::HMAC::hexdigest and Digest::HMAC::digest + author: scalone + website: https://github.com/scalone/mruby-hmac + protocol: git + repository: https://github.com/scalone/mruby-hmac.git + repooptions: - name: mruby-hogun description: convenient library to build the command line interface. author: qtakamitsu - website: https://github.com/qtkmz/mruby-hogun + website: https://github.com/tk3/mruby-hogun protocol: git - repository: https://github.com/qtkmz/mruby-hogun.git + repository: https://github.com/tk3/mruby-hogun.git repooptions: - name: mruby-host-stats description: library to gather stats on running system (cpu, memory, ...). @@ -673,6 +821,13 @@ protocol: git repository: https://github.com/iij/mruby-iijson.git repooptions: +- name: mruby-implerr + description: ImplementationError class + author: Kouichi Nakanishi + website: https://github.com/keizo042/mruby-implerr + protocol: git + repository: https://github.com/keizo042/mruby-implerr.git + repooptions: - name: mruby-inotify description: Inotify bindings author: FlavourSys Technology GmbH @@ -694,6 +849,20 @@ protocol: git repository: https://github.com/ksss/mruby-io-console.git repooptions: +- name: mruby-io-copy_stream + description: IO.copy_stream method for mruby + author: ksss + website: https://github.com/ksss/mruby-io-copy_stream + protocol: git + repository: https://github.com/ksss/mruby-io-copy_stream.git + repooptions: +- name: mruby-ionice + description: Ionice class + author: takumakume + website: https://github.com/takumakume/mruby-ionice + protocol: git + repository: https://github.com/takumakume/mruby-ionice.git + repooptions: - name: mruby-ipaddr description: IPAddr class author: iij @@ -701,6 +870,13 @@ protocol: git repository: https://github.com/iij/mruby-ipaddr.git repooptions: +- name: mruby-ipfilter + description: IPFilter class + author: tap1ra + website: https://github.com/pepabo/mruby-ipfilter + protocol: git + repository: https://github.com/pepabo/mruby-ipfilter.git + repooptions: - name: mruby-ipvs description: interface to IP Virtual Server (IPVS) for mruby author: YOSHIKAWA Ryota @@ -708,13 +884,6 @@ protocol: git repository: https://github.com/rrreeeyyy/mruby-ipvs repooptions: "--recursive" -- name: mruby-irb-mirb-hostbased - description: Hostbased mirb for serial connection - author: kyab - website: https://github.com/kyab/mruby-bin-mirb-hostbased - protocol: git - repository: https://github.com/kyab/mruby-bin-mirb-hostbased.git - repooptions: - name: mruby-javascriptcore description: bindings to an from JavaScript for JavaScriptCore from WebKitGTK author: ppibburr @@ -764,6 +933,13 @@ protocol: git repository: https://github.com/santazhang/mruby-kmp.git repooptions: +- name: mruby-knn-detector + description: Anomaly detector based on K-Nearest Neighbor + author: tsurubee + website: https://github.com/tsurubee/mruby-knn-detector + protocol: git + repository: https://github.com/tsurubee/mruby-knn-detector.git + repooptions: - name: mruby-leapmotion description: Providing wrapper classes for Leap Motion SDK. author: crimsonwoods @@ -778,6 +954,13 @@ protocol: git repository: https://github.com/take-cheeze/mruby-leveldb.git repooptions: +- name: mruby-libhydrogen + description: A lightweight, secure, easy-to-use crypto library for constrained environments. + author: Hendrik Beskow + website: https://github.com/Asmod4n/mruby-libhydrogen + protocol: git + repository: https://github.com/Asmod4n/mruby-libhydrogen.git + repooptions: - name: mruby-libqrng description: libQRNG interface author: cremno @@ -827,6 +1010,13 @@ protocol: git repository: https://github.com/matsumotory/mruby-localmemcache.git repooptions: +- name: mruby-logger + description: A simple but sophisticated logging utility + author: katzer + website: https://github.com/katzer/mruby-logger + protocol: git + repository: https://github.com/katzer/mruby-logger.git + repooptions: - name: mruby-lruc description: Least Recently Used(LRU) cache using lruc author: MATSUMOTO Ryosuke @@ -841,6 +1031,20 @@ protocol: git repository: https://github.com/dyama/mruby-lua.git repooptions: +- name: mruby-lz4 + description: mruby bindings for lz4 + author: dearblue + website: https://github.com/dearblue/mruby-lz4 + protocol: git + repository: https://github.com/dearblue/mruby-lz4.git + repooptions: +- name: mruby-lzma + description: mruby bindings for lzma + author: dearblue + website: https://github.com/dearblue/mruby-lzma + protocol: git + repository: https://github.com/dearblue/mruby-lzma.git + repooptions: - name: mruby-m2x description: Client library for AT&T’s M2X API author: AT&T M2X Team @@ -862,6 +1066,13 @@ protocol: git repository: https://github.com/take-cheeze/mruby-marshal.git repooptions: +- name: mruby-marshal-fast + description: Marshal module for mruby written in C, with speed advantages + author: Carlo Prelz + website: https://github.com/asfluido/mruby-marshal-fast + protocol: git + repository: https://github.com/asfluido/mruby-marshal-fast.git + repooptions: - name: mruby-matrix description: Matrix and vector library author: listrophy @@ -918,6 +1129,14 @@ protocol: git repository: https://github.com/bggd/mruby-minigame.git repooptions: +- name: mruby-miniz + description: Ruby interface for Miniz v1.15, a zlib-subset to deflate/inflate and + zip/unzip without dir support + author: scalone + website: https://github.com/scalone/mruby-miniz + protocol: git + repository: https://github.com/scalone/mruby-miniz.git + repooptions: - name: mruby-mod-mruby-ext description: Extended Apache class author: MATSUMOTO Ryosuke @@ -946,6 +1165,13 @@ protocol: git repository: https://github.com/mattn/mruby-msagent.git repooptions: +- name: mruby-msd + description: msd class + author: pyama86 + website: https://github.com/pepabo/mruby-msd + protocol: git + repository: https://github.com/pepabo/mruby-msd.git + repooptions: - name: mruby-msgpack description: MessagePack for mruby. author: Jun Hiroe @@ -1010,6 +1236,13 @@ protocol: git repository: https://github.com/matsumotory/mruby-netlink.git repooptions: +- name: mruby-network-analyzer + description: network statistics class + author: pyama86 + website: https://github.com/pyama86/mruby-network-analyzer + protocol: git + repository: https://github.com/pyama86/mruby-network-analyzer.git + repooptions: - name: mruby-ngx-mruby-ext description: Nginx ext class author: MATSUMOTO Ryosuke @@ -1027,9 +1260,9 @@ - name: mruby-odbc description: unixODBC bindings author: qtakamitsu - website: https://github.com/qtkmz/mruby-odbc + website: https://github.com/tk3/mruby-odbc protocol: git - repository: https://github.com/qtkmz/mruby-odbc.git + repository: https://github.com/tk3/mruby-odbc.git repooptions: - name: mruby-onig-regexp description: Onigumo Regular Expression @@ -1073,12 +1306,19 @@ protocol: git repository: https://github.com/ksss/mruby-ostruct.git repooptions: +- name: mruby-otp + description: Generate and verify OTPs (HOTP and TOTP) + author: Emanuele Vicentini + website: https://github.com/baldowl/mruby-otp + protocol: git + repository: https://github.com/baldowl/mruby-otp.git + repooptions: - name: mruby-otpauth description: One time password class author: qtakamitsu - website: https://github.com/qtkmz/mruby-otpauth + website: https://github.com/tk3/mruby-otpauth protocol: git - repository: https://github.com/qtkmz/mruby-otpauth.git + repository: https://github.com/tk3/mruby-otpauth.git repooptions: - name: mruby-oui description: Duangle OUI bindings. @@ -1167,6 +1407,21 @@ protocol: git repository: https://github.com/luisbebop/mruby-polarssl.git repooptions: +- name: mruby-poll + description: Low level system poll for mruby + author: Asmod4n + website: https://github.com/Asmod4n/mruby-poll + protocol: git + repository: https://github.com/Asmod4n/mruby-poll.git + repooptions: +- name: mruby-pong + description: mruby-pong is a simple library for quickly creating web applications + in MRuby + author: Nazarii Sheremet + website: https://nsheremet.github.io/mruby-pong + protocol: git + repository: https://github.com/nsheremet/mruby-pong.git + repooptions: - name: mruby-posix_ipc description: A mgem for access to POSIX IPC API author: Uchio Kondo @@ -1174,6 +1429,20 @@ protocol: git repository: https://github.com/udzura/mruby-posix_ipc.git repooptions: +- name: mruby-postgresql + description: Postgresql adapter for mruby + author: Hendrik Beskow + website: https://github.com/Asmod4n/mruby-postgresql + protocol: git + repository: https://github.com/Asmod4n/mruby-postgresql.git + repooptions: +- name: mruby-proc-irep-ext + description: irep extensions for Proc class + author: Hendrik Beskow + website: https://github.com/Asmod4n/mruby-proc-irep-ext + protocol: git + repository: https://github.com/Asmod4n/mruby-proc-irep-ext.git + repooptions: - name: mruby-process description: Process interface (waitpid, pid, kill, fork, ppid) author: Internet Initiative Japan., Inc. @@ -1181,6 +1450,21 @@ protocol: git repository: https://github.com/iij/mruby-process.git repooptions: +- name: mruby-process2 + description: Implementation of the Ruby 2.4.1 Core Library Process for mruby. + author: katzer + website: https://github.com/appPlant/mruby-process + protocol: git + repository: https://github.com/appPlant/mruby-process.git + repooptions: +- name: mruby-publicsuffix + description: mruby port of publicsuffix-ruby. PublicSuffix can parse and decompose + a domain name into top level domain, domain and subdomains. + author: Okumura Takahiro + website: https://github.com/hfm/mruby-publicsuffix + protocol: git + repository: https://github.com/hfm/mruby-publicsuffix.git + repooptions: - name: mruby-pure-regexp description: Pure mruby Regexp author: h2so5 @@ -1188,6 +1472,36 @@ protocol: git repository: https://github.com/h2so5/mruby-pure-regexp.git repooptions: +- name: mruby-qml-parse + description: QML Parser for mruby + author: fundamental + website: https://github.com/mruby-zest/mruby-qml-parse + protocol: git + repository: https://github.com/mruby-zest/mruby-qml-parse + repooptions: +- name: mruby-qml-spawn + description: Optimized ruby flavored qml->pure ruby pseudo-compiler + author: fundamental + website: https://github.com/mruby-zest/mruby-qml-spawn + protocol: git + repository: https://github.com/mruby-zest/mruby-qml-spawn + repooptions: +- name: mruby-qrcode + description: Ruby interface to QR Code C Library by Ryusuke SEKIYAMA + author: + - sadasant + - scalone + website: https://github.com/scalone/mruby-qrcode + protocol: git + repository: https://github.com/scalone/mruby-qrcode.git + repooptions: +- name: mruby-r3 + description: mruby binding for libr3 (path dispatching library) + author: katzer + website: https://github.com/katzer/mruby-r3 + protocol: git + repository: https://github.com/katzer/mruby-r3.git + repooptions: - name: mruby-rake description: rake for mruby author: ksss @@ -1237,6 +1551,13 @@ protocol: git repository: https://github.com/Asmod4n/mruby-redis-ae.git repooptions: +- name: mruby-redis-cluster + description: Client library for Redis Cluster based on matsumotory/mruby-redis + author: Yuki Kirii + website: https://github.com/yukirii/mruby-redis-cluster + protocol: git + repository: https://github.com/yukirii/mruby-redis-cluster.git + repooptions: - name: mruby-regexp-pcre description: regular expression module utilizing PCRE library author: iij @@ -1244,6 +1565,13 @@ protocol: git repository: https://github.com/iij/mruby-regexp-pcre.git repooptions: +- name: mruby-renice + description: getpriority(2)/setpriority(2) for mruby, it like renice(1) + author: takumakume + website: https://github.com/takumakume/mruby-renice + protocol: git + repository: https://github.com/takumakume/mruby-renice.git + repooptions: - name: mruby-require description: require implementation author: mattn @@ -1258,6 +1586,22 @@ protocol: git repository: https://github.com/ksss/mruby-research.git repooptions: +- name: mruby-resource + description: resource binding + author: harasou + website: https://github.com/harasou/mruby-resource + protocol: git + repository: https://github.com/harasou/mruby-resource.git + repooptions: +- name: mruby-ripemd + description: Ruby interface to C RIPEMD-160 hash-function by Antoon Bosselaers + author: + - sadasant + - scalone + website: https://github.com/scalone/mruby-ripemd + protocol: git + repository: https://github.com/scalone/mruby-ripemd.git + repooptions: - name: mruby-romajify description: Japanese romanization library for mruby author: emsk @@ -1272,6 +1616,13 @@ protocol: git repository: https://github.com/schmurfy/mruby-rubyffi-compat.git repooptions: +- name: mruby-seccomp + description: libseccomp wrapper for mruby + author: Uchio Kondo + website: https://github.com/haconiwa/mruby-seccomp + protocol: git + repository: https://github.com/haconiwa/mruby-seccomp.git + repooptions: - name: mruby-secure-compare description: Secure String comparisons for mruby author: Hendrik Beskow @@ -1300,6 +1651,20 @@ protocol: git repository: https://github.com/yui-knk/mruby-set.git repooptions: +- name: mruby-sftp + description: Simple SFTP client for mruby + author: katzer + website: https://github.com/katzer/mruby-sftp + protocol: git + repository: https://github.com/katzer/mruby-sftp.git + repooptions: +- name: mruby-sftp-glob + description: SFTP::Dir#glob extension for mruby-sftp + author: katzer + website: https://github.com/appplant/mruby-sftp-glob + protocol: git + repository: https://github.com/appplant/mruby-sftp-glob.git + repooptions: - name: mruby-sha1 description: SHA1 Hash Alghorithm author: mattn @@ -1314,6 +1679,20 @@ protocol: git repository: https://github.com/h2so5/mruby-sha2.git repooptions: +- name: mruby-shelf + description: modular webserver interface inspired by rack + author: katzer + website: https://github.com/katzer/mruby-shelf + protocol: git + repository: https://github.com/katzer/mruby-shelf.git + repooptions: +- name: mruby-shelf-deflater + description: Enables compression of http responses + author: katzer + website: https://github.com/katzer/mruby-shelf-deflater + protocol: git + repository: https://github.com/katzer/mruby-shelf-deflater.git + repooptions: - name: mruby-shellwords description: Manipulates strings like the UNIX Bourne shell author: @@ -1460,6 +1839,13 @@ protocol: git repository: https://github.com/mattn/mruby-sqlite3.git repooptions: +- name: mruby-ssh + description: Simple SSH client for mruby + author: katzer + website: https://github.com/katzer/mruby-ssh + protocol: git + repository: https://github.com/katzer/mruby-ssh.git + repooptions: - name: mruby-statemachine description: a tiny state machine for mruby author: Hendrik Beskow @@ -1474,6 +1860,13 @@ protocol: git repository: https://github.com/mattn/mruby-string-crypt.git repooptions: +- name: mruby-string-ext-latin9 + description: Conversion from iso-8859-15 (Latin9) to UTF-8 + author: katzer + website: https://github.com/appPlant/mruby-string-ext-latin9 + protocol: git + repository: https://github.com/appPlant/mruby-string-ext-latin9.git + repooptions: - name: mruby-string-is-utf8 description: checks if a string is valid utf8 author: Hendrik Beskow @@ -1495,6 +1888,20 @@ protocol: git repository: https://github.com/ksss/mruby-stringio.git repooptions: +- name: mruby-strptime + description: Strptime in mruby + author: naritta + website: https://github.com/naritta/mruby-strptime + protocol: git + repository: https://github.com/naritta/mruby-strptime.git + repooptions: +- name: mruby-sysconf + description: Sysconf class + author: pyama86 + website: https://github.com/pyama86/mruby-sysconf + protocol: git + repository: https://github.com/pyama86/mruby-sysconf.git + repooptions: - name: mruby-syslog description: Syslog binding author: iij @@ -1509,6 +1916,13 @@ protocol: git repository: https://github.com/Asmod4n/mruby-sysrandom.git repooptions: +- name: mruby-tbot + description: MRuby wrapper for Telegram's Bot API + author: Nazarii Sheremet + website: https://github.com/nsheremet/mruby-tbot + protocol: git + repository: https://github.com/nsheremet/mruby-tbot.git + repooptions: - name: mruby-tempfile description: Tempfile class author: iij @@ -1544,6 +1958,20 @@ protocol: git repository: https://github.com/matsumotory/mruby-timer-thread.git repooptions: +- name: mruby-tiny-io + description: Tiny IO library for mruby + author: mimaki + website: https://github.com/mimaki/mruby-tiny-io + protocol: git + repository: https://github.com/mimaki/mruby-tiny-io.git + repooptions: +- name: mruby-tiny-opt-parser + description: Command-line option analysis for mruby + author: katzer + website: https://github.com/katzer/mruby-tiny-opt-parser + protocol: git + repository: https://github.com/katzer/mruby-tiny-opt-parser.git + repooptions: - name: mruby-tinymt description: random module using TinyMT author: MATSUMOTO Ryosuke @@ -1565,6 +1993,13 @@ protocol: git repository: https://github.com/Asmod4n/mruby-tls.git repooptions: +- name: mruby-tty-screen + description: Detects terminal screen size + author: Piotr Murach, Jeremy Jung + website: https://github.com/jeremyjung/mruby-tty-screen + protocol: git + repository: https://github.com/jeremyjung/mruby-tty-screen.git + repooptions: - name: mruby-uchardet description: mruby binding of Mozilla's universal charset detector. author: Takeshi Watanabe @@ -1643,6 +2078,13 @@ protocol: git repository: https://github.com/matsumotory/mruby-virtualing.git repooptions: +- name: mruby-weakref + description: weakref implementation for mruby + author: dearblue + website: https://github.com/dearblue/mruby-weakref + protocol: git + repository: https://github.com/dearblue/mruby-weakref.git + repooptions: - name: mruby-webkit-1 description: Bindings to WebKitGTK-1.x. uses mruby-girffi author: ppibburr @@ -1688,9 +2130,16 @@ - name: mruby-yaml description: YAML parser and emitter author: Andrew Belt - website: https://github.com/hone/mruby-yaml + website: https://github.com/mrbgems/mruby-yaml + protocol: git + repository: https://github.com/mrbgems/mruby-yaml.git + repooptions: +- name: mruby-yeah + description: mruby on tiny rails + author: katzer + website: https://github.com/katzer/mruby-yeah protocol: git - repository: https://github.com/hone/mruby-yaml.git + repository: https://github.com/katzer/mruby-yeah.git repooptions: - name: mruby-zabbix description: zabbix 2.0 API client class @@ -1699,6 +2148,13 @@ protocol: git repository: https://github.com/matsumotory/mruby-zabbix.git repooptions: +- name: mruby-zest + description: Widget classes for the mruby-zest framework + author: fundamental + website: https://github.com/mruby-zest/mruby-zest + protocol: git + repository: https://github.com/mruby-zest/mruby-zest + repooptions: - name: mruby-zlib description: ZLib bindings for MRuby author: Jared Breeden @@ -1709,7 +2165,21 @@ - name: mruby-zmq description: mruby bindings for libzmq4 author: Hendrik Beskow - website: https://github.com/Asmod4n/mruby-zmq + website: https://github.com/zeromq/mruby-zmq + protocol: git + repository: https://github.com/zeromq/mruby-zmq.git + repooptions: +- name: mruby-zstd + description: mruby bindings for zstd + author: dearblue + website: https://github.com/dearblue/mruby-zstd + protocol: git + repository: https://github.com/dearblue/mruby-zstd.git + repooptions: +- name: mruby-zyre + description: Zyre - an open-source framework for proximity-based peer-to-peer applications + author: Hendrik Beskow + website: https://github.com/Asmod4n/mruby-zyre protocol: git - repository: https://github.com/Asmod4n/mruby-zmq.git + repository: https://github.com/Asmod4n/mruby-zyre.git repooptions: diff --git a/docs/api/Addrinfo.html b/docs/api/Addrinfo.html index febb93c..ddd5386 100644 --- a/docs/api/Addrinfo.html +++ b/docs/api/Addrinfo.html @@ -6,7 +6,7 @@ Class: Addrinfo - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
        Inherits:
        - Object + Object
          -
        • Object
        • +
        • Object
        • @@ -801,7 +801,7 @@

          Instance Attribute Details

          - #canonnameObject (readonly) + #canonnameObject (readonly) @@ -845,7 +845,7 @@

          - #protocolObject (readonly) + #protocolObject (readonly) @@ -889,7 +889,7 @@

          - #socktypeObject (readonly) + #socktypeObject (readonly) @@ -938,7 +938,7 @@

          Class Method Details

          - .foreach(nodename, service, family = nil, socktype = nil, protocol = nil, flags = 0, &block) ⇒ Object + .foreach(nodename, service, family = nil, socktype = nil, protocol = nil, flags = 0, &block) ⇒ Object @@ -972,7 +972,7 @@

          - .ip(host) ⇒ Object + .ip(host) ⇒ Object @@ -1002,7 +1002,7 @@

          - .tcp(host, port) ⇒ Object + .tcp(host, port) ⇒ Object @@ -1032,7 +1032,7 @@

          - .udp(host, port) ⇒ Object + .udp(host, port) ⇒ Object @@ -1062,7 +1062,7 @@

          - .unix(path, socktype = Socket::SOCK_STREAM) ⇒ Object + .unix(path, socktype = Socket::SOCK_STREAM) ⇒ Object @@ -1098,7 +1098,7 @@

          Instance Method Details

          - #_to_arrayObject + #_to_arrayObject @@ -1150,7 +1150,7 @@

          - #afamilyObject + #afamilyObject @@ -1180,7 +1180,7 @@

          - #getnameinfoObject + #getnameinfoObject @@ -1192,7 +1192,6 @@

           
           
          -190
           191
           192
           193
          @@ -1218,10 +1217,11 @@ 

          213 214 215 -216

          +216 +217

    1469. -
      # File 'mrbgems/mruby-socket/src/socket.c', line 190
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 191
       
       static mrb_value
       mrb_addrinfo_getnameinfo(mrb_state *mrb, mrb_value self)
      @@ -1241,7 +1241,7 @@ 

      } error = getnameinfo((struct sockaddr *)RSTRING_PTR(sastr), (socklen_t)RSTRING_LEN(sastr), RSTRING_PTR(host), NI_MAXHOST, RSTRING_PTR(serv), NI_MAXSERV, (int)flags); if (error) { - mrb_raisef(mrb, E_SOCKET_ERROR, "getnameinfo: %S", mrb_str_new_cstr(mrb, gai_strerror(error))); + mrb_raisef(mrb, E_SOCKET_ERROR, "getnameinfo: %s", gai_strerror(error)); } ary = mrb_ary_new_capa(mrb, 2); mrb_str_resize(mrb, host, strlen(RSTRING_PTR(host))); @@ -1258,7 +1258,7 @@

      - #inspectObject + #inspectObject @@ -1325,7 +1325,7 @@

      - #inspect_sockaddrObject + #inspect_sockaddrObject @@ -1430,7 +1430,7 @@

      - #ip_addressObject + #ip_addressObject @@ -1460,7 +1460,7 @@

      - #ip_portObject + #ip_portObject @@ -1490,7 +1490,7 @@

      - #ip_unpackObject + #ip_unpackObject @@ -1634,7 +1634,7 @@

      - #pfamilyObject + #pfamilyObject @@ -1687,7 +1687,7 @@

      - #to_sockaddrObject + #to_sockaddrObject @@ -1776,7 +1776,7 @@

      - #unix_pathObject + #unix_pathObject @@ -1788,7 +1788,6 @@

       
       
      -219
       220
       221
       222
      @@ -1801,10 +1800,11 @@ 

      229 230 231 -232

      +232 +233

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 219
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 220
       
       static mrb_value
       mrb_addrinfo_unix_path(mrb_state *mrb, mrb_value self)
      @@ -1830,9 +1830,9 @@ 

      diff --git a/docs/api/ArgumentError.html b/docs/api/ArgumentError.html index 8d14467..71f3c7f 100644 --- a/docs/api/ArgumentError.html +++ b/docs/api/ArgumentError.html @@ -6,7 +6,7 @@ Exception: ArgumentError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ StandardError

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 136
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 152
       
       def &(elem)
         raise TypeError, "can't convert #{elem.class} into Array" unless elem.class == Array
      @@ -2212,7 +2195,7 @@ 

      - #*Object + #*Object @@ -2302,7 +2285,7 @@

      - #+Object + #+Object @@ -2378,7 +2361,7 @@

      - #-(elem) ⇒ Object + #-(elem) ⇒ Object @@ -2475,7 +2458,7 @@

      - #<<Object + #<<Object @@ -2553,7 +2536,7 @@

      - #<=>(other) ⇒ Object + #<=>(other) ⇒ Object @@ -2587,6 +2570,8 @@

       
       
      +158
      +159
       160
       161
       162
      @@ -2607,12 +2592,10 @@ 

      177 178 179 -180 -181 -182

      +180

      -
      # File 'mrblib/array.rb', line 160
      +      
      # File 'mrblib/array.rb', line 158
       
       def <=>(other)
         other = self.__ary_cmp(other)
      @@ -2645,7 +2628,7 @@ 

      - #==(other) ⇒ Object + #==(other) ⇒ Object @@ -2673,6 +2656,8 @@

       
       
      +115
      +116
       117
       118
       119
      @@ -2682,12 +2667,10 @@ 

      123 124 125 -126 -127 -128

      +126

      -
      # File 'mrblib/array.rb', line 117
      +      
      # File 'mrblib/array.rb', line 115
       
       def ==(other)
         other = self.__ary_eq(other)
      @@ -2710,13 +2693,13 @@ 

      - #[](index) ⇒ Object? + #[](index) ⇒ Object? #[](start, length) ⇒ Array? #[](range) ⇒ Array? - #slice(index) ⇒ Object? + #slice(index) ⇒ Object? #slice(start, length) ⇒ Array? @@ -2755,7 +2738,7 @@

    1470. - #[](index) ⇒ Object? + #[](index) ⇒ Object?
      @@ -2771,7 +2754,7 @@

    1471. - (Object, nil) + (Object, nil) @@ -2848,7 +2831,7 @@

    1472. - #slice(index) ⇒ Object? + #slice(index) ⇒ Object?
      @@ -2864,7 +2847,7 @@

    1473. - (Object, nil) + (Object, nil) @@ -2999,7 +2982,7 @@

      switch (mrb_type(index)) { /* a[n..m] */ case MRB_TT_RANGE: - if (mrb_range_beg_len(mrb, index, &i, &len, ARY_LEN(a), TRUE) == 1) { + if (mrb_range_beg_len(mrb, index, &i, &len, ARY_LEN(a), TRUE) == MRB_RANGE_OK) { return ary_subseq(mrb, a, i, len); } else { @@ -3031,11 +3014,11 @@

      - #[]=(index) ⇒ Object + #[]=(index) ⇒ Object - #[]=(start, length) ⇒ Object? + #[]=(start, length) ⇒ Object? - #[]=(range) ⇒ Object? + #[]=(range) ⇒ Object? @@ -3082,7 +3065,7 @@

    1474. - #[]=(index) ⇒ Object + #[]=(index) ⇒ Object
      @@ -3098,7 +3081,7 @@

    1475. - (Object) + (Object) @@ -3113,7 +3096,7 @@

    1476. - #[]=(start, length) ⇒ Object? + #[]=(start, length) ⇒ Object?
      @@ -3129,7 +3112,7 @@

    1477. - (Object, nil) + (Object, nil) @@ -3144,7 +3127,7 @@

    1478. - #[]=(range) ⇒ Object? + #[]=(range) ⇒ Object?
      @@ -3160,7 +3143,7 @@

    1479. - (Object, nil) + (Object, nil) @@ -3225,14 +3208,14 @@

      if (mrb_get_args(mrb, "oo|o", &v1, &v2, &v3) == 2) { /* a[n..m] = v */ switch (mrb_range_beg_len(mrb, v1, &i, &len, RARRAY_LEN(self), FALSE)) { - case 0: /* not range */ + case MRB_RANGE_TYPE_MISMATCH: mrb_ary_set(mrb, self, aget_index(mrb, v1), v2); break; - case 1: /* range */ + case MRB_RANGE_OK: mrb_ary_splice(mrb, self, i, len, v2); break; - case 2: /* out of range */ - mrb_raisef(mrb, E_RANGE_ERROR, "%S out of range", v1); + case MRB_RANGE_OUT: + mrb_raisef(mrb, E_RANGE_ERROR, "%v out of range", v1); break; } return v2; @@ -3250,7 +3233,7 @@

      - #__ary_cmpObject + #__ary_cmpObject @@ -3262,6 +3245,7 @@

       
       
      +1232
       1233
       1234
       1235
      @@ -3273,11 +3257,10 @@ 

      1241 1242 1243 -1244 -1245

      +1244

    1480. -
      # File 'src/array.c', line 1233
      +      
      # File 'src/array.c', line 1232
       
       static mrb_value
       mrb_ary_cmp(mrb_state *mrb, mrb_value ary1)
      @@ -3300,18 +3283,31 @@ 

      - #__ary_eqObject + #__ary_eqObject -

      +
      +
      +

      15.2.12.5.30

      + + +
      +
      +
      + + +
      + +
       
       
      +1217
       1218
       1219
       1220
      @@ -3324,11 +3320,10 @@ 

      1227 1228 1229 -1230 -1231

      +1230
      -
      # File 'src/array.c', line 1218
      +      
      # File 'src/array.c', line 1217
       
       static mrb_value
       mrb_ary_eq(mrb_state *mrb, mrb_value ary1)
      @@ -3352,7 +3347,7 @@ 

      - #__ary_indexObject + #__ary_indexObject @@ -3416,7 +3411,7 @@

      - #__svalueObject + #__svalueObject @@ -3440,6 +3435,7 @@

       
       
      +1247
       1248
       1249
       1250
      @@ -3450,17 +3446,14 @@ 

      1255 1256 1257 -1258 -1259 -1260

      +1258

      -
      # File 'src/array.c', line 1248
      +      
      # File 'src/array.c', line 1247
       
       static mrb_value
       mrb_ary_svalue(mrb_state *mrb, mrb_value ary)
       {
      -  mrb_get_args(mrb, "");
         switch (RARRAY_LEN(ary)) {
         case 0:
           return mrb_nil_value();
      @@ -3478,7 +3471,7 @@ 

      - #_inspectObject + #_inspect(recur_list) ⇒ Object @@ -3500,18 +3493,22 @@

      93 94 95 -96

      +96 +97 +98
      # File 'mrblib/array.rb', line 86
       
      -def _inspect
      +def _inspect(recur_list)
         size = self.size
         return "[]" if size == 0
      +  return "[...]" if recur_list[self.object_id]
      +  recur_list[self.object_id] = true
         ary=[]
         i=0
         while i<size
      -    ary<<self[i].inspect
      +    ary<<self[i]._inspect(recur_list)
           i+=1
         end
         "["+ary.join(", ")+"]"
      @@ -3519,84 +3516,6 @@ 

      -
      - -
      -

      - - #appendObject - - - - - -

      -
      -

      15.2.12.5.22

      - - -
      -
      -
      - - -
      - - - - - - -
      -
      -
      -
      -508
      -509
      -510
      -511
      -512
      -513
      -514
      -515
      -516
      -517
      -518
      -519
      -520
      -521
      -522
      -523
      -524
      -525
      -526
      -527
      -528
      -
      -
      # File 'src/array.c', line 508
      -
      -static mrb_value
      -mrb_ary_push_m(mrb_state *mrb, mrb_value self)
      -{
      -  mrb_value *argv;
      -  mrb_int len, len2, alen;
      -  struct RArray *a;
      -
      -  mrb_get_args(mrb, "*!", &argv, &alen);
      -  a = mrb_ary_ptr(self);
      -  ary_modify(mrb, a);
      -  len = ARY_LEN(a);
      -  len2 = len + alen;
      -  if (ARY_CAPA(a) < len2) {
      -    ary_expand_capa(mrb, a, len2);
      -  }
      -  array_copy(ARY_PTR(a)+len, argv, alen);
      -  ARY_SET_LEN(a, len2);
      -  mrb_write_barrier(mrb, (struct RBasic*)a);
      -
      -  return self;
      -}
      -
      @@ -3710,7 +3629,7 @@

      - #at(index) ⇒ Object? + #at(index) ⇒ Object? @@ -3746,7 +3665,7 @@

    1481. - (Object, nil) + (Object, nil) @@ -3795,7 +3714,7 @@

      - #bsearch(&block) ⇒ Object + #bsearch(&block) ⇒ Object @@ -3874,18 +3793,18 @@

       
       
      -598
      -599
      -600
      -601
      -602
      -603
      -604
      -605
      -606
      +632 +633 +634 +635 +636 +637 +638 +639 +640

    1482. -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 598
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 632
       
       def bsearch(&block)
         return to_enum :bsearch unless block
      @@ -3904,7 +3823,7 @@ 

      - #bsearch_index(&block) ⇒ Object + #bsearch_index(&block) ⇒ Object @@ -3937,43 +3856,43 @@

       
       
      -620
      -621
      -622
      -623
      -624
      -625
      -626
      -627
      -628
      -629
      -630
      -631
      -632
      -633
      -634
      -635
      -636
      -637
      -638
      -639
      -640
      -641
      -642
      -643
      -644
      -645
      -646
      -647
      -648
      -649
      -650
      -651
      -652
      -653
      - - -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 620
      +654
      +655
      +656
      +657
      +658
      +659
      +660
      +661
      +662
      +663
      +664
      +665
      +666
      +667
      +668
      +669
      +670
      +671
      +672
      +673
      +674
      +675
      +676
      +677
      +678
      +679
      +680
      +681
      +682
      +683
      +684
      +685
      +686
      +687
      + + +
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 654
       
       def bsearch_index(&block)
         return to_enum :bsearch_index unless block
      @@ -4017,7 +3936,7 @@ 

      - #clearObject + #clearObject @@ -4045,8 +3964,7 @@

      1106 1107 1108 -1109 -1110

      +1109

      # File 'src/array.c', line 1105
      @@ -4054,7 +3972,6 @@ 

      static mrb_value mrb_ary_clear_m(mrb_state *mrb, mrb_value self) { - mrb_get_args(mrb, ""); return mrb_ary_clear(mrb, self); }

      @@ -4065,7 +3982,7 @@

      - #collect!(&block) ⇒ Object + #collect!(&block) ⇒ Object @@ -4131,7 +4048,7 @@

      - #combination(n, &block) ⇒ Object + #combination(n, &block) ⇒ Object @@ -4175,37 +4092,36 @@

       
       
      -863
      -864
      -865
      -866
      -867
      -868
      -869
      -870
      -871
      -872
      -873
      -874
      -875
      -876
      -877
      -878
      -879
      -880
      -881
      -882
      -883
      -884
      -885
      +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 863
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 897
       
       def combination(n, &block)
      -  size = self.size
         return to_enum(:combination, n) unless block
      -  return if n > size
      +  size = self.size
         if n == 0
            yield []
         elsif n == 1
      @@ -4214,7 +4130,7 @@ 

      yield [self[i]] i += 1 end - else + elsif n <= size i = 0 while i<size result = [self[i]] @@ -4224,6 +4140,7 @@

      i += 1 end end + self end

      @@ -4233,7 +4150,7 @@

      - #compactObject + #compactObject @@ -4263,14 +4180,14 @@

       
       
      -231
      -232
      -233
      -234
      -235
      +265 +266 +267 +268 +269

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 231
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 265
       
       def compact
         result = self.dup
      @@ -4285,7 +4202,7 @@ 

      - #compact!Object + #compact!Object @@ -4317,17 +4234,17 @@

       
       
      -248
      -249
      -250
      -251
      -252
      -253
      -254
      -255
      +282 +283 +284 +285 +286 +287 +288 +289

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 248
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 282
       
       def compact!
         result = self.select { |e| !e.nil? }
      @@ -4345,7 +4262,7 @@ 

      - #concatObject + #concatObject @@ -4399,7 +4316,7 @@

      - #delete(key, &block) ⇒ Object + #delete(key, &block) ⇒ Object @@ -4423,17 +4340,17 @@

       
       
      +184
      +185
       186
       187
       188
       189
       190
      -191
      -192
      -193
      +191

      -
      # File 'mrblib/array.rb', line 186
      +      
      # File 'mrblib/array.rb', line 184
       
       def delete(key, &block)
         while i = self.index(key)
      @@ -4451,7 +4368,7 @@ 

      - #delete_atObject + #delete_atObject @@ -4547,7 +4464,7 @@

      - #delete_if(&block) ⇒ Object + #delete_if(&block) ⇒ Object @@ -4586,22 +4503,22 @@

       
       
      -479
      -480
      -481
      -482
      -483
      -484
      -485
      -486
      -487
      -488
      -489
      -490
      -491
      +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 479
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 513
       
       def delete_if(&block)
         return to_enum :delete_if unless block
      @@ -4622,9 +4539,9 @@ 

      -

      +

      - #dig(idx, *args) ⇒ Object + #difference(*args) ⇒ Object @@ -4633,11 +4550,11 @@

      call-seq: - ary.dig(idx, …) -> object

      + ary.difference(other_ary1, other_ary2, …) -> new_ary

      -

      Extracts the nested value specified by the sequence of idx -objects by calling +dig+ at each step, returning +nil+ if any -intermediate step is +nil+.

      +

      Returns a new array that is a copy of the original array, removing all +occurrences of any item that also appear in +other_ary+. The order is +preserved from the original array.

      @@ -4653,25 +4570,23 @@

       
       
      -782
      -783
      -784
      -785
      -786
      -787
      -788
      -789
      +99 +100 +101 +102 +103 +104 +105

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 782
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 99
       
      -def dig(idx,*args)
      -  n = self[idx]
      -  if args.size > 0
      -    n&.dig(*args)
      -  else
      -    n
      +def difference(*args)
      +  ary = self
      +  args.each do |x|
      +    ary = ary - x
         end
      +  ary
       end
      @@ -4679,9 +4594,9 @@

      -

      +

      - #each(&block) ⇒ Object + #dig(idx, *args) ⇒ Object @@ -4689,10 +4604,12 @@

      -

      Calls the given block for each element of +self+ -and pass the respective element.

      +

      call-seq: + ary.dig(idx, …) -> object

      -

      ISO 15.2.12.5.10

      +

      Extracts the nested value specified by the sequence of idx +objects by calling +dig+ at each step, returning +nil+ if any +intermediate step is +nil+.

      @@ -4708,29 +4625,25 @@

       
       
      -13
      -14
      -15
      -16
      -17
      -18
      -19
      -20
      -21
      -22
      +816 +817 +818 +819 +820 +821 +822 +823

      -
      # File 'mrblib/array.rb', line 13
      -
      -def each(&block)
      -  return to_enum :each unless block
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 816
       
      -  idx = 0
      -  while idx < length
      -    block.call(self[idx])
      -    idx += 1
      +def dig(idx,*args)
      +  n = self[idx]
      +  if args.size > 0
      +    n&.dig(*args)
      +  else
      +    n
         end
      -  self
       end
      @@ -4740,7 +4653,7 @@

      - #each_index(&block) ⇒ Object + #each_index(&block) ⇒ Object @@ -4836,16 +4749,16 @@

       
       
      +1111
       1112
       1113
       1114
       1115
       1116
      -1117
      -1118
      +1117

      -
      # File 'src/array.c', line 1112
      +      
      # File 'src/array.c', line 1111
       
       static mrb_value
       mrb_ary_empty_p(mrb_state *mrb, mrb_value self)
      @@ -4902,6 +4815,8 @@ 

       
       
      +133
      +134
       135
       136
       137
      @@ -4911,12 +4826,10 @@ 

      141 142 143 -144 -145 -146

      +144

      -
      # File 'mrblib/array.rb', line 135
      +      
      # File 'mrblib/array.rb', line 133
       
       def eql?(other)
         other = self.__ary_eq(other)
      @@ -4938,7 +4851,7 @@ 

      - #fetch(n, ifnone = NONE, &block) ⇒ Object + #fetch(n, ifnone = NONE, &block) ⇒ Object @@ -4983,25 +4896,25 @@

       
       
      -293
      -294
      -295
      -296
      -297
      -298
      -299
      -300
      -301
      -302
      -303
      -304
      -305
      -306
      -307
      -308
      +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 293
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 327
       
       def fetch(n, ifnone=NONE, &block)
         warn "block supersedes default value argument" if !n.nil? && ifnone != NONE && block
      @@ -5027,7 +4940,7 @@ 

      - #fill(arg0 = nil, arg1 = nil, arg2 = nil, &block) ⇒ Object + #fill(arg0 = nil, arg1 = nil, arg2 = nil, &block) ⇒ Object @@ -5081,40 +4994,6 @@

       
       
      -343
      -344
      -345
      -346
      -347
      -348
      -349
      -350
      -351
      -352
      -353
      -354
      -355
      -356
      -357
      -358
      -359
      -360
      -361
      -362
      -363
      -364
      -365
      -366
      -367
      -368
      -369
      -370
      -371
      -372
      -373
      -374
      -375
      -376
       377
       378
       379
      @@ -5147,10 +5026,44 @@ 

      406 407 408 -409

      +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 343
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 377
       
       def fill(arg0=nil, arg1=nil, arg2=nil, &block)
         if arg0.nil? && arg1.nil? && arg2.nil? && !block
      @@ -5227,7 +5140,7 @@ 

      - #firstObject + #firstObject @@ -5305,7 +5218,7 @@

      - #flatten(depth = nil) ⇒ Object + #flatten(depth = nil) ⇒ Object @@ -5343,14 +5256,14 @@

       
       
      -177
      -178
      -179
      -180
      -181
      +211 +212 +213 +214 +215

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 177
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 211
       
       def flatten(depth=nil)
         res = dup
      @@ -5365,7 +5278,7 @@ 

      - #flatten!(depth = nil) ⇒ Object + #flatten!(depth = nil) ⇒ Object @@ -5403,30 +5316,30 @@

       
       
      -200
      -201
      -202
      -203
      -204
      -205
      -206
      -207
      -208
      -209
      -210
      -211
      -212
      -213
      -214
      -215
      -216
      -217
      -218
      -219
      -220
      +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 200
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 234
       
       def flatten!(depth=nil)
         modified = false
      @@ -5457,7 +5370,7 @@ 

      - #index(val = NONE, &block) ⇒ Object + #index(val = NONE, &block) ⇒ Object @@ -5532,7 +5445,7 @@

      - #initialize_copyObject + #initialize_copyObject @@ -5588,7 +5501,7 @@

      - #insert(idx, *args) ⇒ Object + #insert(idx, *args) ⇒ Object @@ -5623,14 +5536,14 @@

       
       
      -540
      -541
      -542
      -543
      -544
      +574 +575 +576 +577 +578

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 540
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 574
       
       def insert(idx, *args)
         idx += self.size + 1 if idx < 0
      @@ -5645,7 +5558,7 @@ 

      - #inspectObject + #inspectObject @@ -5675,23 +5588,72 @@

       
       
      -101
      -102
       103
       104
      -105
      -106
      -107
      +105

      -
      # File 'mrblib/array.rb', line 101
      +      
      # File 'mrblib/array.rb', line 103
       
       def inspect
      -  begin
      -    self._inspect
      -  rescue SystemStackError
      -    "[...]"
      +  self._inspect({})
      +end
      + + + + + +
      +

      + + #intersection(*args) ⇒ Object + + + + + +

      +
      +

      call-seq: + ary.intersection(other_ary,…) -> new_ary

      + +

      Set Intersection—Returns a new array containing elements common to +this array and other_arys, removing duplicates. The order is +preserved from the original array.

      + +

      [1, 2, 3].intersection([3, 4, 1], [1, 3, 5]) #=> [1, 3]

      + + +
      +
      +
      + + +
      + + + + + @@ -5756,17 +5718,17 @@

       
       
      +1208
       1209
       1210
       1211
       1212
       1213
       1214
      -1215
      -1216
      +1215

      - + - -
      +
      +
      +
      +186
      +187
      +188
      +189
      +190
      +191
      +192
      +
      +
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 186
      +
      +def intersection(*args)
      +  ary = self
      +  args.each do |x|
      +    ary = ary & x
         end
      +  ary
       end
      -
      # File 'src/array.c', line 1209
      +      
      # File 'src/array.c', line 1208
       
       static mrb_value
       mrb_ary_join_m(mrb_state *mrb, mrb_value ary)
      @@ -5784,7 +5746,7 @@ 

      - #keep_if(&block) ⇒ Object + #keep_if(&block) ⇒ Object @@ -5821,23 +5783,23 @@

       
       
      -701
      -702
      -703
      -704
      -705
      -706
      -707
      -708
      -709
      -710
      -711
      -712
      -713
      -714
      +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 701
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 735
       
       def keep_if(&block)
         return to_enum :keep_if unless block
      @@ -5861,7 +5823,7 @@ 

      - #lastObject + #lastObject @@ -5939,7 +5901,7 @@

      - #lengthObject + #lengthObject @@ -5989,7 +5951,7 @@

      - #permutation(n = self.size, &block) ⇒ Object + #permutation(n = self.size, &block) ⇒ Object @@ -6037,39 +5999,38 @@

       
       
      -817
      -818
      -819
      -820
      -821
      -822
      -823
      -824
      -825
      -826
      -827
      -828
      -829
      -830
      -831
      -832
      -833
      -834
      -835
      -836
      -837
      -838
      -

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 817
      +851
      +852
      +853
      +854
      +855
      +856
      +857
      +858
      +859
      +860
      +861
      +862
      +863
      +864
      +865
      +866
      +867
      +868
      +869
      +870
      +871
      +872
      +
      +
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 851
       
       def permutation(n=self.size, &block)
      -  size = self.size
         return to_enum(:permutation, n) unless block
      -  return if n > size
      +  size = self.size
         if n == 0
      -     yield []
      -  else
      +    yield []
      +  elsif 0 < n && n <= size
           i = 0
           while i<size
             result = [self[i]]
      @@ -6084,177 +6045,66 @@ 

      i += 1 end end + self end

      -
      - -
      -

      - - #popObject - - - - - -

      -
      -

      15.2.12.5.21

      - - -
      -
      -
      - - -
      - - - - - - -
      -
      -
      -
      -530
      -531
      -532
      -533
      -534
      -535
      -536
      -537
      -538
      -539
      -540
      -
      -
      # File 'src/array.c', line 530
      -
      -MRB_API mrb_value
      -mrb_ary_pop(mrb_state *mrb, mrb_value ary)
      -{
      -  struct RArray *a = mrb_ary_ptr(ary);
      -  mrb_int len = ARY_LEN(a);
      -
      -  ary_modify_check(mrb, a);
      -  if (len == 0) return mrb_nil_value();
      -  ARY_SET_LEN(a, len-1);
      -  return ARY_PTR(a)[len-1];
      -}
      -
      -
      - -
      -

      - - #prependObject - - - - - -

      -
      -

      15.2.12.5.30

      - - -
      -
      -
      - - -
      - - - - + +
      -
      -
      -
      -610
      -611
      -612
      -613
      -614
      -615
      -616
      -617
      -618
      -619
      -620
      -621
      -622
      -623
      -624
      -625
      -626
      -627
      -628
      -629
      -630
      -631
      -632
      -633
      -634
      -635
      -636
      -637
      -638
      -639
      -640
      -641
      -642
      -643
      -644
      -645
      -646
      -647
      -
      +
      + +
      +

      + + #popObject + + + + + +

      +
      +

      15.2.12.5.21

      + + +
      +
      +
      + + +
      + + + +
      -
      # File 'src/array.c', line 610
      +      
       
      -static mrb_value
      -mrb_ary_unshift_m(mrb_state *mrb, mrb_value self)
      -{
      -  struct RArray *a = mrb_ary_ptr(self);
      -  mrb_value *vals, *ptr;
      -  mrb_int alen, len;
       
      -  mrb_get_args(mrb, "*!", &vals, &alen);
      -  if (alen == 0) {
      -    ary_modify_check(mrb, a);
      -    return self;
      -  }
      -  len = ARY_LEN(a);
      -  if (alen > ARY_MAX_SIZE - len) {
      -    mrb_raise(mrb, E_ARGUMENT_ERROR, "array size too big");
      -  }
      -  if (ARY_SHARED_P(a)
      -      && a->as.heap.aux.shared->refcnt == 1 /* shared only referenced from this array */
      -      && a->as.heap.ptr - a->as.heap.aux.shared->ptr >= alen) /* there's room for unshifted item */ {
      -    ary_modify_check(mrb, a);
      -    a->as.heap.ptr -= alen;
      -    ptr = a->as.heap.ptr;
      -  }
      -  else {
      -    ary_modify(mrb, a);
      -    if (ARY_CAPA(a) < len + alen)
      -      ary_expand_capa(mrb, a, len + alen);
      -    ptr = ARY_PTR(a);
      -    value_move(ptr + alen, ptr, len);
      -  }
      -  array_copy(ptr, vals, alen);
      -  ARY_SET_LEN(a, len+alen);
      -  while (alen--) {
      -    mrb_field_write_barrier_value(mrb, (struct RBasic*)a, vals[alen]);
      -  }
      +530
      +531
      +532
      +533
      +534
      +535
      +536
      +537
      +538
      +539
      +540
      +
      +
      # File 'src/array.c', line 530
       
      -  return self;
      -}
      +MRB_API mrb_value +mrb_ary_pop(mrb_state *mrb, mrb_value ary) +{ + struct RArray *a = mrb_ary_ptr(ary); + mrb_int len = ARY_LEN(a); + + ary_modify_check(mrb, a); + if (len == 0) return mrb_nil_value(); + ARY_SET_LEN(a, len-1); + return ARY_PTR(a)[len-1]; +}
      @@ -6263,10 +6113,14 @@

      - #pushObject + #pushObject + Also known as: + append + +

      @@ -6430,7 +6284,7 @@

      for (i = 0; i < RARRAY_LEN(ary); ++i) { v = RARRAY_PTR(ary)[i]; - if (mrb_type(v) == MRB_TT_ARRAY && + if (mrb_array_p(v) && RARRAY_LEN(v) > 1 && mrb_equal(mrb, RARRAY_PTR(v)[1], value)) return v; @@ -6445,7 +6299,7 @@

      - #reject!(&block) ⇒ Object + #reject!(&block) ⇒ Object @@ -6481,27 +6335,27 @@

       
       
      -508
      -509
      -510
      -511
      -512
      -513
      -514
      -515
      -516
      -517
      -518
      -519
      -520
      -521
      -522
      -523
      -524
      -525
      +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 508
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 542
       
       def reject!(&block)
         return to_enum :reject! unless block
      @@ -6529,7 +6383,7 @@ 

      - #replaceObject + #replaceObject @@ -6585,7 +6439,7 @@

      - #reverseObject + #reverseObject @@ -6659,7 +6513,7 @@

      - #reverse!Object + #reverse!Object @@ -6737,7 +6591,7 @@

      - #reverse_each(&block) ⇒ Object + #reverse_each(&block) ⇒ Object @@ -6761,19 +6615,19 @@

       
       
      -258
      -259
      -260
      -261
      -262
      -263
      -264
      -265
      -266
      -267
      +292 +293 +294 +295 +296 +297 +298 +299 +300 +301

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 258
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 292
       
       def reverse_each(&block)
         return to_enum :reverse_each unless block
      @@ -6793,7 +6647,7 @@ 

      - #rindexObject + #rindexObject @@ -6863,7 +6717,7 @@

      - #rotate(count = 1) ⇒ Object + #rotate(count = 1) ⇒ Object @@ -6901,23 +6755,23 @@

       
       
      -427
      -428
      -429
      -430
      -431
      -432
      -433
      -434
      -435
      -436
      -437
      -438
      -439
      -440
      +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 427
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 461
       
       def rotate(count=1)
         ary = []
      @@ -6941,7 +6795,7 @@ 

      - #rotate!(count = 1) ⇒ Object + #rotate!(count = 1) ⇒ Object @@ -6979,12 +6833,12 @@

       
       
      -458
      -459
      -460
      +492 +493 +494

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 458
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 492
       
       def rotate!(count=1)
         self.replace(self.rotate(count))
      @@ -6997,10 +6851,14 @@ 

      - #select!(&block) ⇒ Object + #select!(&block) ⇒ Object + Also known as: + filter! + +

      @@ -7032,23 +6890,23 @@

       
       
      -730
      -731
      -732
      -733
      -734
      -735
      -736
      -737
      -738
      -739
      -740
      -741
      -742
      -743
      +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 730
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 764
       
       def select!(&block)
         return to_enum :select! unless block
      @@ -7072,7 +6930,7 @@ 

      - #shiftObject + #shiftObject @@ -7174,7 +7032,7 @@

      - #sizeObject + #sizeObject @@ -7225,13 +7083,13 @@

      - #[](index) ⇒ Object? + #[](index) ⇒ Object? #[](start, length) ⇒ Array? #[](range) ⇒ Array? - #slice(index) ⇒ Object? + #slice(index) ⇒ Object? #slice(start, length) ⇒ Array? @@ -7270,7 +7128,7 @@

    1483. - #[](index) ⇒ Object? + #[](index) ⇒ Object?
      @@ -7286,7 +7144,7 @@

    1484. - (Object, nil) + (Object, nil) @@ -7363,7 +7221,7 @@

    1485. - #slice(index) ⇒ Object? + #slice(index) ⇒ Object?
      @@ -7379,7 +7237,7 @@

    1486. - (Object, nil) + (Object, nil) @@ -7514,7 +7372,7 @@

      switch (mrb_type(index)) { /* a[n..m] */ case MRB_TT_RANGE: - if (mrb_range_beg_len(mrb, index, &i, &len, ARY_LEN(a), TRUE) == 1) { + if (mrb_range_beg_len(mrb, index, &i, &len, ARY_LEN(a), TRUE) == MRB_RANGE_OK) { return ary_subseq(mrb, a, i, len); } else { @@ -7546,7 +7404,7 @@

      - #slice!(index) ⇒ Object? + #slice!(index) ⇒ Object? #slice!(start, length) ⇒ Array? @@ -7583,7 +7441,7 @@

    1487. - #slice!(index) ⇒ Object? + #slice!(index) ⇒ Object?
      @@ -7599,7 +7457,7 @@

    1488. - (Object, nil) + (Object, nil) @@ -7762,7 +7620,7 @@

      mrb_get_args(mrb, "o|i", &index, &len); switch (mrb_type(index)) { case MRB_TT_RANGE: - if (mrb_range_beg_len(mrb, index, &i, &len, ARY_LEN(a), TRUE) == 1) { + if (mrb_range_beg_len(mrb, index, &i, &len, ARY_LEN(a), TRUE) == MRB_RANGE_OK) { goto delete_pos_len; } else { @@ -7809,7 +7667,7 @@

      - #sort(&block) ⇒ Object + #sort(&block) ⇒ Object @@ -7821,12 +7679,12 @@

       
       
      -270
      -271
      -272
      +268 +269 +270

    1489. -
      # File 'mrblib/array.rb', line 270
      +      
      # File 'mrblib/array.rb', line 268
       
       def sort(&block)
         self.dup.sort!(&block)
      @@ -7839,7 +7697,7 @@ 

      - #sort!(&block) ⇒ Object + #sort!(&block) ⇒ Object @@ -7864,6 +7722,8 @@

       
       
      +203
      +204
       205
       206
       207
      @@ -7925,12 +7785,10 @@ 

      263 264 265 -266 -267 -268

      +266

      -
      # File 'mrblib/array.rb', line 205
      +      
      # File 'mrblib/array.rb', line 203
       
       def sort!(&block)
         stack = [ [ 0, self.size - 1 ] ]
      @@ -8004,7 +7862,7 @@ 

      - #to_h(&blk) ⇒ Object + #to_h(&blk) ⇒ Object @@ -8040,19 +7898,19 @@

       
       
      -929
      -930
      -931
      -932
      -933
      -934
      -935
      -936
      -937
      -938
      +963 +964 +965 +966 +967 +968 +969 +970 +971 +972

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 929
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 963
       
       def to_h(&blk)
         h = {}
      @@ -8072,7 +7930,7 @@ 

      - #transposeObject + #transposeObject @@ -8106,23 +7964,23 @@

       
       
      -900
      -901
      -902
      -903
      -904
      -905
      -906
      -907
      -908
      -909
      -910
      -911
      -912
      -913
      +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 900
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 934
       
       def transpose
         return [] if empty?
      @@ -8130,8 +7988,8 @@ 

      column_count = nil self.each do |row| raise TypeError unless row.is_a?(Array) - column_count ||= row.count - raise IndexError, 'element size differs' unless column_count == row.count + column_count ||= row.size + raise IndexError, 'element size differs' unless column_count == row.size end Array.new(column_count) do |column_index| @@ -8146,7 +8004,7 @@

      - #union(*args) ⇒ Object + #union(*args) ⇒ Object @@ -8177,17 +8035,17 @@

       
       
      -118
      -119
      -120
      -121
      -122
      -123
      -124
      -125
      +134 +135 +136 +137 +138 +139 +140 +141

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 118
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 134
       
       def union(*args)
         ary = self.dup
      @@ -8205,7 +8063,7 @@ 

      - #uniq(&block) ⇒ Object + #uniq(&block) ⇒ Object @@ -8261,7 +8119,7 @@

      - #uniq!(&block) ⇒ Object + #uniq!(&block) ⇒ Object @@ -8352,10 +8210,14 @@

      - #unshiftObject + #unshiftObject + Also known as: + prepend + +

      @@ -8464,7 +8326,7 @@

      - #values_atObject + #values_atObject @@ -8508,7 +8370,7 @@

      - #|(elem) ⇒ Object + #|(elem) ⇒ Object @@ -8552,15 +8414,15 @@

       
       
      -101
      -102
      -103
      -104
      -105
      -106
      +117 +118 +119 +120 +121 +122

      -
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 101
      +      
      # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 117
       
       def |(elem)
         raise TypeError, "can't convert #{elem.class} into Array" unless elem.class == Array
      @@ -8578,9 +8440,9 @@ 

      diff --git a/docs/api/BasicSocket.html b/docs/api/BasicSocket.html index 9b54174..619c16f 100644 --- a/docs/api/BasicSocket.html +++ b/docs/api/BasicSocket.html @@ -6,7 +6,7 @@ Class: BasicSocket - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ IO
        -
      • Object
      • +
      • Object
      • @@ -769,7 +769,7 @@

        Instance Attribute Details

        - #do_not_reverse_lookupObject + #do_not_reverse_lookupObject @@ -818,7 +818,7 @@

        Class Method Details

        - .do_not_reverse_lookupObject + .do_not_reverse_lookupObject @@ -848,7 +848,7 @@

        - .do_not_reverse_lookup=(val) ⇒ Object + .do_not_reverse_lookup=(val) ⇒ Object @@ -878,7 +878,7 @@

        - .for_fd(fd) ⇒ Object + .for_fd(fd) ⇒ Object @@ -914,7 +914,7 @@

        Instance Method Details

        - #_is_socket=Object + #_is_socket=Object @@ -926,7 +926,6 @@

         
         
        -498
         499
         500
         501
        @@ -939,10 +938,11 @@ 

        508 509 510 -511

        +511 +512

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 498
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 499
       
       static mrb_value
       mrb_basicsocket_set_is_socket(mrb_state *mrb, mrb_value self)
      @@ -966,7 +966,7 @@ 

      - #_recvfromObject + #_recvfromObject @@ -978,7 +978,6 @@

       
       
      -371
       372
       373
       374
      @@ -999,10 +998,11 @@ 

      389 390 391 -392

      +392 +393

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 371
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 372
       
       static mrb_value
       mrb_basicsocket_recvfrom(mrb_state *mrb, mrb_value self)
      @@ -1034,7 +1034,7 @@ 

      - #_setnonblockObject + #_setnonblockObject @@ -1046,7 +1046,6 @@

       
       
      -413
       414
       415
       416
      @@ -1073,10 +1072,11 @@ 

      437 438 439 -440

      +440 +441

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 413
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 414
       
       static mrb_value
       mrb_basicsocket_setnonblock(mrb_state *mrb, mrb_value self)
      @@ -1114,7 +1114,7 @@ 

      - #closeObject + #closeObject @@ -1126,16 +1126,16 @@

       
       
      -772
       773
       774
       775
       776
       777
      -778
      +778 +779

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 772
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 773
       
       static mrb_value
       mrb_win32_basicsocket_close(mrb_state *mrb, mrb_value self)
      @@ -1152,7 +1152,7 @@ 

      - #getpeereidObject + #getpeereidObject @@ -1164,7 +1164,6 @@

       
       
      -286
       287
       288
       289
      @@ -1185,10 +1184,11 @@ 

      304 305 306 -307

      +307 +308

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 286
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 287
       
       static mrb_value
       mrb_basicsocket_getpeereid(mrb_state *mrb, mrb_value self)
      @@ -1220,7 +1220,7 @@ 

      - #getpeernameObject + #getpeernameObject @@ -1232,7 +1232,6 @@

       
       
      -309
       310
       311
       312
      @@ -1243,10 +1242,11 @@ 

      317 318 319 -320

      +320 +321

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 309
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 310
       
       static mrb_value
       mrb_basicsocket_getpeername(mrb_state *mrb, mrb_value self)
      @@ -1268,7 +1268,7 @@ 

      - #getsocknameObject + #getsocknameObject @@ -1280,7 +1280,6 @@

       
       
      -322
       323
       324
       325
      @@ -1291,10 +1290,11 @@ 

      330 331 332 -333

      +333 +334

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 322
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 323
       
       static mrb_value
       mrb_basicsocket_getsockname(mrb_state *mrb, mrb_value self)
      @@ -1316,7 +1316,7 @@ 

      - #getsockoptObject + #getsockoptObject @@ -1328,7 +1328,6 @@

       
       
      -335
       336
       337
       338
      @@ -1346,10 +1345,11 @@ 

      350 351 352 -353

      +353 +354

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 335
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 336
       
       static mrb_value
       mrb_basicsocket_getsockopt(mrb_state *mrb, mrb_value self)
      @@ -1378,7 +1378,7 @@ 

      - #local_addressObject + #local_addressObject @@ -1420,7 +1420,7 @@

      - #recvObject + #recvObject @@ -1432,7 +1432,6 @@

       
       
      -355
       356
       357
       358
      @@ -1446,10 +1445,11 @@ 

      366 367 368 -369

      +369 +370

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 355
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 356
       
       static mrb_value
       mrb_basicsocket_recv(mrb_state *mrb, mrb_value self)
      @@ -1474,7 +1474,7 @@ 

      - #recv_nonblock(maxlen, flags = 0) ⇒ Object + #recv_nonblock(maxlen, flags = 0) ⇒ Object @@ -1514,7 +1514,7 @@

      - #remote_addressObject + #remote_addressObject @@ -1544,7 +1544,7 @@

      - #sendObject + #sendObject @@ -1568,7 +1568,6 @@

      recvmsg(maxlen, flags=0)

       
       
      -394
       395
       396
       397
      @@ -1585,10 +1584,11 @@ 

      recvmsg(maxlen, flags=0)

      408 409 410 -411
      +411 +412

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 394
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 395
       
       static mrb_value
       mrb_basicsocket_send(mrb_state *mrb, mrb_value self)
      @@ -1616,7 +1616,7 @@ 

      recvmsg(maxlen, flags=0)

      - #setsockoptObject + #setsockoptObject @@ -1640,7 +1640,6 @@

      sendmsg_nonblock

       
       
      -442
       443
       444
       445
      @@ -1683,10 +1682,11 @@ 

      sendmsg_nonblock

      482 483 484 -485
      +485 +486
      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 442
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 443
       
       static mrb_value
       mrb_basicsocket_setsockopt(mrb_state *mrb, mrb_value self)
      @@ -1703,7 +1703,7 @@ 

      sendmsg_nonblock

      level = mrb_fixnum(so); if (mrb_string_p(optval)) { /* that's good */ - } else if (mrb_type(optval) == MRB_TT_TRUE || mrb_type(optval) == MRB_TT_FALSE) { + } else if (mrb_true_p(optval) || mrb_false_p(optval)) { mrb_int i = mrb_test(optval) ? 1 : 0; optval = mrb_str_new(mrb, (char*)&i, sizeof(i)); } else if (mrb_fixnum_p(optval)) { @@ -1724,7 +1724,7 @@

      sendmsg_nonblock

      optname = mrb_fixnum(mrb_funcall(mrb, so, "optname", 0)); optval = mrb_funcall(mrb, so, "data", 0); } else { - mrb_raisef(mrb, E_ARGUMENT_ERROR, "wrong number of arguments (%S for 3)", mrb_fixnum_value(argc)); + mrb_raisef(mrb, E_ARGUMENT_ERROR, "wrong number of arguments (%i for 3)", argc); } s = socket_fd(mrb, self); @@ -1740,7 +1740,7 @@

      sendmsg_nonblock

      - #shutdownObject + #shutdownObject @@ -1752,7 +1752,6 @@

       
       
      -487
       488
       489
       490
      @@ -1761,10 +1760,11 @@ 

      493 494 495 -496

      +496 +497

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 487
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 488
       
       static mrb_value
       mrb_basicsocket_shutdown(mrb_state *mrb, mrb_value self)
      @@ -1784,7 +1784,7 @@ 

      - #sysreadObject + #sysreadObject @@ -1796,7 +1796,6 @@

       
       
      -781
       782
       783
       784
      @@ -1837,10 +1836,11 @@ 

      819 820 821 -822

      +822 +823

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 781
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 782
       
       static mrb_value
       mrb_win32_basicsocket_sysread(mrb_state *mrb, mrb_value self)
      @@ -1892,7 +1892,7 @@ 

      - #sysseekObject + #sysseekObject @@ -1904,15 +1904,15 @@

       
       
      -824
       825
       826
       827
       828
      -829
      +829 +830

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 824
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 825
       
       static mrb_value
       mrb_win32_basicsocket_sysseek(mrb_state *mrb, mrb_value self)
      @@ -1928,7 +1928,7 @@ 

      - #syswriteObject + #syswriteObject @@ -1940,7 +1940,6 @@

       
       
      -831
       832
       833
       834
      @@ -1953,10 +1952,11 @@ 

      841 842 843 -844

      +844 +845

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 831
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 832
       
       static mrb_value
       mrb_win32_basicsocket_syswrite(mrb_state *mrb, mrb_value self)
      @@ -1982,9 +1982,9 @@ 

      diff --git a/docs/api/Comparable.html b/docs/api/Comparable.html index c909f75..6663d5a 100644 --- a/docs/api/Comparable.html +++ b/docs/api/Comparable.html @@ -6,7 +6,7 @@ Module: Comparable - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -88,7 +88,7 @@
      Defined in:
      mrblib/compar.rb,
      - mrblib/string.rb,
      mrbgems/mruby-compar-ext/mrblib/compar.rb
      + mrbgems/mruby-compar-ext/mrblib/compar.rb
      @@ -96,9 +96,9 @@

      Overview

      -

      String is comparable

      +

      Comparable

      -

      ISO 15.2.10.3

      +

      ISO 15.3.3

      @@ -296,7 +296,7 @@

      Instance Method Details

      - #<(other) ⇒ Object + #<(other) ⇒ Object @@ -350,7 +350,7 @@

      - #<=(other) ⇒ Object + #<=(other) ⇒ Object @@ -404,7 +404,7 @@

      - #==(other) ⇒ Object + #==(other) ⇒ Object @@ -452,7 +452,7 @@

      - #>(other) ⇒ Object + #>(other) ⇒ Object @@ -506,7 +506,7 @@

      - #>=(other) ⇒ Object + #>=(other) ⇒ Object @@ -620,7 +620,7 @@

      - #clamp(min, max) ⇒ Object + #clamp(min, max) ⇒ Object @@ -702,9 +702,9 @@

      diff --git a/docs/api/Complex.html b/docs/api/Complex.html new file mode 100644 index 0000000..d48e821 --- /dev/null +++ b/docs/api/Complex.html @@ -0,0 +1,1285 @@ + + + + + + + Class: Complex + + — Documentation by YARD 0.9.20 + + + + + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Complex + + + +

      +
      + +
      +
      Inherits:
      +
      + Numeric + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      mrbgems/mruby-complex/mrblib/complex.rb
      +
      + +
      + + + + + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods inherited from Numeric

      +

      #finite?, #infinite?, #negative?, #nonzero?, #positive?, #zero?

      + + + + + + + + + +

      Methods included from Comparable

      +

      #<, #<=, #>, #>=, #between?, #clamp

      + + +
      +

      Class Method Details

      + + +
      +

      + + .polar(abs, arg = 0) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +2
      +3
      +4
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 2
      +
      +def self.polar(abs, arg = 0)
      +  Complex(abs * Math.cos(arg), abs * Math.sin(arg))
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #*(rhs) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 38
      +
      +def *(rhs)
      +  if rhs.is_a? Complex
      +    Complex(real * rhs.real - imaginary * rhs.imaginary, real * rhs.imaginary + rhs.real * imaginary)
      +  elsif rhs.is_a? Numeric
      +    Complex(real * rhs, imaginary * rhs)
      +  end
      +end
      +
      +
      + +
      +

      + + #+(rhs) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 22
      +
      +def +(rhs)
      +  if rhs.is_a? Complex
      +    Complex(real + rhs.real, imaginary + rhs.imaginary)
      +  elsif rhs.is_a? Numeric
      +    Complex(real + rhs, imaginary)
      +  end
      +end
      +
      +
      + +
      +

      + + #+@Object + + + + + +

      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 14
      +
      +def +@
      +  Complex(real, imaginary)
      +end
      +
      +
      + +
      +

      + + #-(rhs) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 30
      +
      +def -(rhs)
      +  if rhs.is_a? Complex
      +    Complex(real - rhs.real, imaginary - rhs.imaginary)
      +  elsif rhs.is_a? Numeric
      +    Complex(real - rhs, imaginary)
      +  end
      +end
      +
      +
      + +
      +

      + + #-@Object + + + + + +

      + + + + +
      +
      +
      +
      +18
      +19
      +20
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 18
      +
      +def -@
      +  Complex(-real, -imaginary)
      +end
      +
      +
      + +
      +

      + + #/(rhs) ⇒ Object + + + + Also known as: + quo + + + + +

      + + + + +
      +
      +
      +
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 46
      +
      +def /(rhs)
      +  if rhs.is_a? Complex
      +    __div__(rhs)
      +  elsif rhs.is_a? Numeric
      +    Complex(real / rhs, imaginary / rhs)
      +  end
      +end
      +
      +
      + +
      +

      + + #==(rhs) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 55
      +
      +def ==(rhs)
      +  if rhs.is_a? Complex
      +    real == rhs.real && imaginary == rhs.imaginary
      +  elsif rhs.is_a? Numeric
      +    imaginary.zero? && real == rhs
      +  end
      +end
      +
      +
      + +
      +

      + + #absObject + + + + Also known as: + magnitude + + + + +

      + + + + +
      +
      +
      +
      +63
      +64
      +65
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 63
      +
      +def abs
      +  Math.hypot imaginary, real
      +end
      +
      +
      + +
      +

      + + #abs2Object + + + + + +

      + + + + +
      +
      +
      +
      +68
      +69
      +70
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 68
      +
      +def abs2
      +  real * real + imaginary * imaginary
      +end
      +
      +
      + +
      +

      + + #argObject + + + + Also known as: + angle, phase + + + + +

      + + + + +
      +
      +
      +
      +72
      +73
      +74
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 72
      +
      +def arg
      +  Math.atan2 imaginary, real
      +end
      +
      +
      + +
      +

      + + #conjugateObject + + + + Also known as: + conj + + + + +

      + + + + +
      +
      +
      +
      +78
      +79
      +80
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 78
      +
      +def conjugate
      +  Complex(real, -imaginary)
      +end
      +
      +
      + +
      +

      + + #fdiv(numeric) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +83
      +84
      +85
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 83
      +
      +def fdiv(numeric)
      +  Complex(real.to_f / numeric, imaginary.to_f / numeric)
      +end
      +
      +
      + +
      +

      + + #inspectObject + + + + + +

      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 6
      +
      +def inspect
      +  "(#{to_s})"
      +end
      +
      +
      + +
      +

      + + #polarObject + + + + + +

      + + + + +
      +
      +
      +
      +87
      +88
      +89
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 87
      +
      +def polar
      +  [abs, arg]
      +end
      +
      +
      + +
      +

      + + #real?Boolean + + + + + +

      +
      + + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + + + +
      +
      +
      +
      +91
      +92
      +93
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 91
      +
      +def real?
      +  false
      +end
      +
      +
      + +
      +

      + + #rectangularObject + + + + Also known as: + rect + + + + +

      + + + + +
      +
      +
      +
      +95
      +96
      +97
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 95
      +
      +def rectangular
      +  [real, imaginary]
      +end
      +
      +
      + +
      +

      + + #to_rObject + + + + + +

      + + + + +
      +
      +
      +
      +100
      +101
      +102
      +103
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 100
      +
      +def to_r
      +  raise RangeError.new "can't convert #{to_s} into Rational" unless imaginary.zero?
      +  Rational(real, 1)
      +end
      +
      +
      + +
      +

      + + #to_sObject + + + + + +

      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'mrbgems/mruby-complex/mrblib/complex.rb', line 10
      +
      +def to_s
      +  "#{real}#{'+' unless imaginary.negative?}#{imaginary}i"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/EOFError.html b/docs/api/EOFError.html index 8e6a595..1f2ce9d 100644 --- a/docs/api/EOFError.html +++ b/docs/api/EOFError.html @@ -6,7 +6,7 @@ Exception: EOFError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ IOError

      diff --git a/docs/api/Enumerable.html b/docs/api/Enumerable.html index b7d34cf..a92c503 100644 --- a/docs/api/Enumerable.html +++ b/docs/api/Enumerable.html @@ -6,7 +6,7 @@ Module: Enumerable - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -158,29 +158,6 @@

      internal method __update_hash(oldhash, index, itemhash).

      - - - -
    1490. - - - .to_h ⇒ Object - - - - - - - - - - - - - -
      -
      -
    1491. @@ -196,29 +173,6 @@

    1492. - #+(other) ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    1493. - - -
    1494. - - #all?(pat = NONE, &block) ⇒ Boolean @@ -407,7 +361,7 @@

      -

      Call the given block for each element which is yield by +each+.

      +

      Return the first element for which value from the block is true.

    1495. @@ -589,6 +543,29 @@

      Return an array of all elements which are yield by +each+.

      + + + +
    1496. + + + #filter_map(&blk) ⇒ Object + + + + + + + + + + + + + +
      +
      +
    1497. @@ -1270,6 +1247,29 @@

      + + + +
    1498. + + + #tally ⇒ Object + + + + + + + + + + + + + +

      call-seq: enum.tally -> a_hash.

      +
      +
    1499. @@ -1354,7 +1354,7 @@

      Class Method Details

      - .__update_hashObject + .__update_hashObject @@ -1409,36 +1409,6 @@

      -

      - -
      -

      - - .to_hObject - - - - - -

      - - - - -
      -
      -
      -
      -814
      -815
      -816
      -
      -
      # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 814
      -
      -def nil.to_h
      -  {}
      -end
      -
      @@ -1448,37 +1418,7 @@

      Instance Method Details

      -

      - - #+(other) ⇒ Object - - - - - -

      - - - - -
      -
      -
      -
      -10
      -11
      -12
      -
      -
      # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 10
      -
      -def +(other)
      -  Enumerator::Chain.new(self, other)
      -end
      -
      -
      - -
      -

      +

      #all?(pat = NONE, &block) ⇒ Boolean @@ -1651,7 +1591,7 @@

      - #chain(*args) ⇒ Object + #chain(*args) ⇒ Object @@ -1681,7 +1621,7 @@

      - #collect(&block) ⇒ Object + #collect(&block) ⇒ Object @@ -1740,7 +1680,7 @@

      - #count(v = NONE, &block) ⇒ Object + #count(v = NONE, &block) ⇒ Object @@ -1818,7 +1758,7 @@

      - #cycle(nv = nil, &block) ⇒ Object + #cycle(nv = nil, &block) ⇒ Object @@ -1925,7 +1865,7 @@

      - #detect(ifnone = nil, &block) ⇒ Object + #detect(ifnone = nil, &block) ⇒ Object @@ -1937,11 +1877,11 @@

      -

      Call the given block for each element -which is yield by +each+. Return -+ifnone+ if no block value was true. -Otherwise return the first block value -which had was true.

      +

      Return the first element for which +value from the block is true. If no +object matches, calls +ifnone+ and +returns its result. Otherwise returns ++nil+.

      ISO 15.3.2.2.4

      @@ -1974,14 +1914,14 @@

      # File 'mrblib/enum.rb', line 75
       
       def detect(ifnone=nil, &block)
      -  ret = ifnone
      +  return to_enum :detect, ifnone unless block
      +
         self.each{|*val|
           if block.call(*val)
      -      ret = val.__svalue
      -      break
      +      return val.__svalue
           end
         }
      -  ret
      +  ifnone.call unless ifnone.nil?
       end
      @@ -1991,7 +1931,7 @@

      - #drop(n) ⇒ Object + #drop(n) ⇒ Object @@ -2063,7 +2003,7 @@

      - #drop_while(&block) ⇒ Object + #drop_while(&block) ⇒ Object @@ -2347,7 +2287,7 @@

      - #each_with_index(&block) ⇒ Object + #each_with_index(&block) ⇒ Object @@ -2408,7 +2348,7 @@

      - #each_with_object(obj, &block) ⇒ Object + #each_with_object(obj, &block) ⇒ Object @@ -2467,7 +2407,7 @@

      - #entriesObject + #entriesObject @@ -2521,12 +2461,56 @@

      +

      + +
      +

      + + #filter_map(&blk) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +830
      +831
      +832
      +833
      +834
      +835
      +836
      +837
      +838
      +839
      +
      +
      # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 830
      +
      +def filter_map(&blk)
      +  return to_enum(:filter_map) unless blk
      +
      +  ary = []
      +  self.each do |x|
      +    x = blk.call(x)
      +    ary.push x if x
      +  end
      +  ary
      +end
      +

      - #find_all(&block) ⇒ Object + #find_all(&block) ⇒ Object @@ -2589,7 +2573,7 @@

      - #find_index(val = NONE, &block) ⇒ Object + #find_index(val = NONE, &block) ⇒ Object @@ -2674,7 +2658,7 @@

      - #first(*args) ⇒ Object + #first(*args) ⇒ Object @@ -2760,7 +2744,7 @@

      - #flat_map(&block) ⇒ Object + #flat_map(&block) ⇒ Object @@ -2852,7 +2836,7 @@

      - #grep(pattern, &block) ⇒ Object + #grep(pattern, &block) ⇒ Object @@ -2914,7 +2898,7 @@

      - #group_by(&block) ⇒ Object + #group_by(&block) ⇒ Object @@ -2981,7 +2965,7 @@

      - #hashObject + #hashObject @@ -3005,18 +2989,18 @@

       
       
      -340
      -341
      -342
      -343
       344
       345
       346
       347
      -348
      +348 +349 +350 +351 +352

      -
      # File 'mrblib/enum.rb', line 340
      +      
      # File 'mrblib/enum.rb', line 344
       
       def hash
         h = 12347
      @@ -3105,7 +3089,7 @@ 

      - #inject(*args, &block) ⇒ Object + #inject(*args, &block) ⇒ Object @@ -3216,7 +3200,7 @@

      - #lazyObject + #lazyObject @@ -3274,7 +3258,7 @@

      - #max(&block) ⇒ Object + #max(&block) ⇒ Object @@ -3353,7 +3337,7 @@

      - #max_by(&block) ⇒ Object + #max_by(&block) ⇒ Object @@ -3448,7 +3432,7 @@

      - #min(&block) ⇒ Object + #min(&block) ⇒ Object @@ -3527,7 +3511,7 @@

      - #min_by(&block) ⇒ Object + #min_by(&block) ⇒ Object @@ -3622,7 +3606,7 @@

      - #minmax(&block) ⇒ Object + #minmax(&block) ⇒ Object @@ -3718,7 +3702,7 @@

      - #minmax_by(&block) ⇒ Object + #minmax_by(&block) ⇒ Object @@ -4030,7 +4014,7 @@

      - #partition(&block) ⇒ Object + #partition(&block) ⇒ Object @@ -4073,12 +4057,16 @@

      294 295 296 -297

      +297 +298 +299
      # File 'mrblib/enum.rb', line 286
       
       def partition(&block)
      +  return to_enum :partition unless block
      +
         ary_T = []
         ary_F = []
         self.each{|*val|
      @@ -4098,7 +4086,7 @@ 

      - #reject(&block) ⇒ Object + #reject(&block) ⇒ Object @@ -4127,18 +4115,22 @@

       
       
      -306
      -307
       308
       309
       310
       311
      -312
      +312 +313 +314 +315 +316

      -
      # File 'mrblib/enum.rb', line 306
      +      
      # File 'mrblib/enum.rb', line 308
       
       def reject(&block)
      +  return to_enum :reject unless block
      +
         ary = []
         self.each{|*val|
           ary.push(val.__svalue) unless block.call(*val)
      @@ -4153,7 +4145,7 @@ 

      - #reverse_each(&block) ⇒ Object + #reverse_each(&block) ⇒ Object @@ -4227,7 +4219,7 @@

      - #sort(&block) ⇒ Object + #sort(&block) ⇒ Object @@ -4258,12 +4250,12 @@

       
       
      -329
      -330
      -331
      +333 +334 +335

      -
      # File 'mrblib/enum.rb', line 329
      +      
      # File 'mrblib/enum.rb', line 333
       
       def sort(&block)
         self.map{|*val| val.__svalue}.sort(&block)
      @@ -4276,7 +4268,7 @@ 

      - #sort_by(&block) ⇒ Object + #sort_by(&block) ⇒ Object @@ -4347,7 +4339,7 @@

      - #take(n) ⇒ Object + #take(n) ⇒ Object @@ -4428,7 +4420,7 @@

      - #take_while(&block) ⇒ Object + #take_while(&block) ⇒ Object @@ -4490,12 +4482,69 @@

      +

      + +
      +

      + + #tallyObject + + + + + +

      +
      +

      call-seq: + enum.tally -> a_hash

      + +

      Tallys the collection. Returns a hash where the keys are the +elements and the values are numbers of elements in the collection +that correspond to the key.

      + +

      [“a”, “b”, “c”, “b”].tally #=> “b”=>2, “c”=>1

      + + +
      +
      +
      + + +
      + + + + + + +
      +
      +
      +
      +852
      +853
      +854
      +855
      +856
      +857
      +858
      +
      +
      # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 852
      +
      +def tally
      +  hash = {}
      +  self.each do |x|
      +    hash[x] = (hash[x]||0)+1
      +  end
      +  hash
      +end
      +

      - #to_h(&blk) ⇒ Object + #to_h(&blk) ⇒ Object @@ -4577,7 +4626,7 @@

      - #uniq(&block) ⇒ Object + #uniq(&block) ⇒ Object @@ -4589,6 +4638,10 @@

       
       
      +814
      +815
      +816
      +817
       818
       819
       820
      @@ -4599,14 +4652,10 @@ 

      825 826 827 -828 -829 -830 -831 -832

      +828

      -
      # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 818
      +      
      # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 814
       
       def uniq(&block)
         hash = {}
      @@ -4631,7 +4680,7 @@ 

      - #zip(*args, &block) ⇒ Object + #zip(*args, &block) ⇒ Object @@ -4723,9 +4772,9 @@

      diff --git a/docs/api/Enumerator.html b/docs/api/Enumerator.html index 639a72e..17cfd82 100644 --- a/docs/api/Enumerator.html +++ b/docs/api/Enumerator.html @@ -6,7 +6,7 @@ Class: Enumerator - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
      Inherits:
      - Object + Object

      -
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 118
      +      
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 117
       
       def initialize(obj=NONE, meth=:each, *args, &block)
         if block
      @@ -811,7 +871,7 @@ 

      Instance Attribute Details

      - #argsObject + #argsObject @@ -835,12 +895,12 @@

       
       
      +133
       134
      -135
      -136
      +135

      -
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 134
      +      
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 133
       
       def args
         @args
      @@ -855,7 +915,7 @@ 

      - #fibObject (readonly) + #fibObject (readonly) @@ -879,12 +939,12 @@

       
       
      +134
       135
      -136
      -137
      +136

      -
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 135
      +      
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 134
       
       def fib
         @fib
      @@ -899,7 +959,7 @@ 

      - #methObject + #methObject @@ -923,12 +983,12 @@

       
       
      +133
       134
      -135
      -136
      +135

      -
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 134
      +      
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 133
       
       def meth
         @meth
      @@ -943,7 +1003,7 @@ 

      - #objObject + #objObject @@ -967,12 +1027,12 @@

       
       
      +133
       134
      -135
      -136
      +135

      -
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 134
      +      
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 133
       
       def obj
         @obj
      @@ -985,14 +1045,166 @@ 

      +
      +

      Class Method Details

      + + +
      +

      + + .produce(init = NONE, &block) ⇒ Object + + + + + +

      +
      +

      call-seq: + Enumerator.produce(initial = nil) { |val| } -> enumerator

      + +

      Creates an infinite enumerator from any block, just called over and +over. Result of the previous iteration is passed to the next one. +If +initial+ is provided, it is passed to the first iteration, and +becomes the first element of the enumerator; if it is not provided, +first iteration receives +nil+, and its result becomes first +element of the iterator.

      + +

      Raising StopIteration from the block stops an iteration.

      + +

      Examples of usage:

      + +

      Enumerator.produce(1, &:succ) # => enumerator of 1, 2, 3, 4, ….

      + +

      Enumerator.produce { rand(10) } # => infinite random number sequence

      + + + + + + + + + + + + + + +
      ancestors = Enumerator.produce(node) {prevnode = prev.parent or raise StopIteration }
      enclosing_section = ancestors.find {nn.type == :section }
      + + +
      +
      +
      + +

      Raises:

      + + +
      + + + + + + +
      +
      +
      +
      +580
      +581
      +582
      +583
      +584
      +585
      +586
      +587
      +588
      +589
      +590
      +591
      +592
      +593
      +594
      +595
      +596
      +597
      +
      +
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 580
      +
      +def Enumerator.produce(init=NONE, &block)
      +  raise ArgumentError, "no block given" if block.nil?
      +  Enumerator.new do |y|
      +    if init == NONE
      +      val = nil
      +    else
      +      val = init
      +      y.yield(val)
      +    end
      +    begin
      +      while true
      +        y.yield(val = block.call(val))
      +      end
      +    rescue StopIteration
      +      # do nothing
      +    end
      +  end
      +end
      +
      +
      + +
      +

      Instance Method Details

      -

      +

      - #each(*argv, &block) ⇒ Object + #+(other) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +
      +
      # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 12
      +
      +def +(other)
      +  Chain.new(self, other)
      +end
      +
      +
      + +
      +

      + + #each(*argv, &block) ⇒ Object @@ -1011,9 +1223,10 @@

      === Examples

      -

      “Hello, world!”.scan(/\w+/) #=> [“Hello”, “world”] - “Hello, world!”.to_enum(:scan, /\w+/).to_a #=> [“Hello”, “world”] - “Hello, world!”.to_enum(:scan).each(/\w+/).to_a #=> [“Hello”, “world”]

      +

      Array.new(3) #=> [nil, nil, nil] + Array.new(3) { |i| i } #=> [0, 1, 2] + Array.to_enum(:new, 3).to_a #=> [0, 1, 2] + Array.to_enum(:new).each(3).to_a #=> [0, 1, 2]

      obj = Object.new

      @@ -1092,7 +1305,7 @@

      - #each_with_index(&block) ⇒ Object + #each_with_index(&block) ⇒ Object @@ -1122,12 +1335,12 @@

       
       
      +184
       185
      -186
      -187
      +186

      -
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 185
      +      
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 184
       
       def each_with_index(&block)
         with_index(0, &block)
      @@ -1140,7 +1353,7 @@ 

      - #feed(value) ⇒ Object + #feed(value) ⇒ Object @@ -1241,7 +1454,7 @@

      - #initialize_copy(obj) ⇒ Object + #initialize_copy(obj) ⇒ Object @@ -1278,6 +1491,7 @@

       
       
      +136
       137
       138
       139
      @@ -1287,11 +1501,10 @@ 

      143 144 145 -146 -147

      +146

      -
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 137
      +      
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 136
       
       def initialize_copy(obj)
         raise TypeError, "can't copy type #{obj.class}" unless obj.kind_of? Enumerator
      @@ -1312,7 +1525,7 @@ 

      - #inspectObject + #inspectObject @@ -1324,17 +1537,17 @@

       
       
      +225
       226
       227
       228
       229
       230
       231
      -232
      -233
      +232

      -
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 226
      +      
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 225
       
       def inspect
         if @args && @args.size > 0
      @@ -1352,7 +1565,7 @@ 

      - #nextObject + #nextObject @@ -1411,7 +1624,7 @@

      - #next_valuesObject + #next_valuesObject @@ -1579,7 +1792,7 @@

      - #peekObject + #peekObject @@ -1638,7 +1851,7 @@

      - #peek_valuesObject + #peek_valuesObject @@ -1709,7 +1922,7 @@

      - #rewindObject + #rewindObject @@ -1768,7 +1981,7 @@

      - #with_index(offset = 0, &block) ⇒ Object + #with_index(offset = 0, &block) ⇒ Object @@ -1800,6 +2013,7 @@

       
       
      +159
       160
       161
       162
      @@ -1813,11 +2027,10 @@ 

      170 171 172 -173 -174

      +173

      -
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 160
      +      
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 159
       
       def with_index(offset=0, &block)
         return to_enum :with_index, offset unless block
      @@ -1842,7 +2055,7 @@ 

      - #with_object(object, &block) ⇒ Object + #with_object(object, &block) ⇒ Object @@ -1896,17 +2109,17 @@

       
       
      +216
       217
       218
       219
       220
       221
       222
      -223
      -224
      +223

      -
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 217
      +      
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 216
       
       def with_object(object, &block)
         return to_enum(:with_object, object) unless block
      @@ -1926,9 +2139,9 @@ 

      diff --git a/docs/api/Enumerator/Chain.html b/docs/api/Enumerator/Chain.html index 8d23e3d..dec58e4 100644 --- a/docs/api/Enumerator/Chain.html +++ b/docs/api/Enumerator/Chain.html @@ -6,7 +6,7 @@ Class: Enumerator::Chain - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
      Inherits:
      - Object + Object

      +21 +22
      # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 19
       
       def initialize(*args)
      -  @enums = args
      +  @enums = args.freeze
      +  @pos = -1
       end
      @@ -359,9 +338,9 @@

      Instance Method Details

      -

      +

      - #__copy_enumsObject + #+(other) ⇒ Object @@ -375,17 +354,13 @@

      54 55 -56 -57 -58

      +56
      # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 54
       
      -def __copy_enums
      -  @enums.each_with_object([]) do |e, a|
      -    a << e.clone
      -  end
      +def +(other)
      +  self.class.new(self, other)
       end
      @@ -395,7 +370,7 @@

      - #each(&block) ⇒ Object + #each(&block) ⇒ Object @@ -407,63 +382,43 @@

       
       
      +24
      +25
      +26
       27
       28
       29
       30
       31
       32
      -33
      +33 +34 +35

      -
      # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 27
      +      
      # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 24
       
       def each(&block)
      -  return to_enum unless block_given?
      +  return to_enum unless block
       
      -  @enums.each { |e| e.each(&block) }
      +  i = 0
      +  while i < @enums.size
      +    @pos = i
      +    @enums[i].each(&block)
      +    i += 1
      +  end
       
         self
       end
      - - -
      -

      - - #initialize_copy(orig) ⇒ Object - - - - - -

      - - - - -
      -
      -
      -
      -23
      -24
      -25
      -
      -
      # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 23
      -
      -def initialize_copy(orig)
      -  @enums = orig.__copy_enums
      -end
      -

      - #inspectObject + #inspectObject @@ -475,12 +430,12 @@

       
       
      -50
      -51
      -52
      +58 +59 +60

      -
      # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 50
      +      
      # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 58
       
       def inspect
         "#<#{self.class}: #{@enums.inspect}>"
      @@ -493,7 +448,7 @@ 

      - #rewindObject + #rewindObject @@ -505,20 +460,24 @@

       
       
      -42
      -43
       44
       45
       46
       47
      -48
      +48 +49 +50 +51 +52

      -
      # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 42
      +      
      # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 44
       
       def rewind
      -  @enums.reverse_each do |e|
      +  while 0 <= @pos && @pos < @enums.size
      +    e = @enums[@pos]
           e.rewind if e.respond_to?(:rewind)
      +    @pos -= 1
         end
       
         self
      @@ -531,7 +490,7 @@ 

      - #sizeObject + #sizeObject @@ -543,15 +502,15 @@

       
       
      -35
      -36
       37
       38
       39
      -40
      +40 +41 +42

      -
      # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 35
      +      
      # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 37
       
       def size
         @enums.reduce(0) do |a, e|
      @@ -569,9 +528,9 @@ 

      diff --git a/docs/api/Enumerator/Generator.html b/docs/api/Enumerator/Generator.html index 0f7e9b4..f9f5982 100644 --- a/docs/api/Enumerator/Generator.html +++ b/docs/api/Enumerator/Generator.html @@ -6,7 +6,7 @@ Class: Enumerator::Generator - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
      Inherits:
      - Object + Object

      +52
      # File 'src/error.c', line 43
      @@ -365,10 +363,8 @@ 

      exc_initialize(mrb_state *mrb, mrb_value exc) { mrb_value mesg; - mrb_int argc; - mrb_value *argv; - if (mrb_get_args(mrb, "|o*!", &mesg, &argv, &argc) >= 1) { + if (mrb_get_args(mrb, "|o", &mesg) == 1) { mrb_iv_set(mrb, exc, mrb_intern_lit(mrb, "mesg"), mesg); } return exc; @@ -388,7 +384,7 @@

      Instance Method Details

      - #backtraceObject + #backtraceObject @@ -400,7 +396,7 @@

      - #exceptionObject + #exceptionObject @@ -430,6 +426,8 @@

       
       
      +67
      +68
       69
       70
       71
      @@ -442,12 +440,10 @@ 

      78 79 80 -81 -82 -83

      +81

      -
      # File 'src/error.c', line 69
      +      
      # File 'src/error.c', line 67
       
       static mrb_value
       exc_exception(mrb_state *mrb, mrb_value self)
      @@ -526,6 +522,8 @@ 

       
       
      +131
      +132
       133
       134
       135
      @@ -555,12 +553,10 @@ 

      159 160 161 -162 -163 -164

      +162

      -
      # File 'src/error.c', line 133
      +      
      # File 'src/error.c', line 131
       
       static mrb_value
       exc_inspect(mrb_state *mrb, mrb_value exc)
      @@ -583,14 +579,14 @@ 

      str = mrb_str_new_cstr(mrb, cname); if (mrb_string_p(file) && mrb_fixnum_p(line)) { if (append_mesg) { - str = mrb_format(mrb, "%S:%S: %S (%S)", file, line, mesg, str); + str = mrb_format(mrb, "%v:%v: %v (%v)", file, line, mesg, str); } else { - str = mrb_format(mrb, "%S:%S: %S", file, line, str); + str = mrb_format(mrb, "%v:%v: %v", file, line, str); } } else if (append_mesg) { - str = mrb_format(mrb, "%S: %S", str, mesg); + str = mrb_format(mrb, "%v: %v", str, mesg); } return str; }

      @@ -654,14 +650,14 @@

       
       
      +115
      +116
       117
       118
      -119
      -120
      -121
      +119

      -
      # File 'src/error.c', line 117
      +      
      # File 'src/error.c', line 115
       
       static mrb_value
       exc_message(mrb_state *mrb, mrb_value exc)
      @@ -676,7 +672,7 @@ 

      - #set_backtraceObject + #set_backtraceObject @@ -688,18 +684,18 @@

       
       
      +185
      +186
       187
       188
       189
       190
       191
       192
      -193
      -194
      -195
      +193

      -
      # File 'src/error.c', line 187
      +      
      # File 'src/error.c', line 185
       
       static mrb_value
       exc_set_backtrace(mrb_state *mrb, mrb_value exc)
      @@ -770,6 +766,8 @@ 

       
       
      +91
      +92
       93
       94
       95
      @@ -782,12 +780,10 @@ 

      102 103 104 -105 -106 -107

      +105

      -
      # File 'src/error.c', line 93
      +      
      # File 'src/error.c', line 91
       
       static mrb_value
       exc_to_s(mrb_state *mrb, mrb_value exc)
      @@ -814,9 +810,9 @@ 

      diff --git a/docs/api/FalseClass.html b/docs/api/FalseClass.html index 44268ba..df9bfb3 100644 --- a/docs/api/FalseClass.html +++ b/docs/api/FalseClass.html @@ -6,7 +6,7 @@ Class: FalseClass - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
      Inherits:
      - Object + Object
        -
      • Object
      • +
      • Object
      • @@ -489,7 +489,7 @@

        - #to_sObject + #to_sObject @@ -527,7 +527,7 @@

        static mrb_value false_to_s(mrb_state *mrb, mrb_value obj) { - return mrb_str_new_lit(mrb, "false"); + return mrb_str_new_lit_frozen(mrb, "false"); }

      @@ -537,7 +537,7 @@

      - #to_sObject + #to_sObject @@ -575,7 +575,7 @@

      static mrb_value false_to_s(mrb_state *mrb, mrb_value obj) { - return mrb_str_new_lit(mrb, "false"); + return mrb_str_new_lit_frozen(mrb, "false"); }

      @@ -711,9 +711,9 @@

      diff --git a/docs/api/Fiber.html b/docs/api/Fiber.html index 988b99e..f21ca56 100644 --- a/docs/api/Fiber.html +++ b/docs/api/Fiber.html @@ -6,7 +6,7 @@ Class: Fiber - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
      Inherits:
      - Object + Object
        -
      • Object
      • +
      • Object
      • @@ -244,7 +244,7 @@

        Constructor Details

        - #new { ... } ⇒ Object + #new { ... } ⇒ Object @@ -414,10 +414,7 @@

        131 132 133 -134 -135 -136 -137

      +134
      # File 'mrbgems/mruby-fiber/src/fiber.c', line 64
      @@ -433,14 +430,11 @@ 

      mrb_value blk; size_t slen; - mrb_get_args(mrb, "&", &blk); + mrb_get_args(mrb, "&!", &blk); if (f->cxt) { mrb_raise(mrb, E_RUNTIME_ERROR, "cannot initialize twice"); } - if (mrb_nil_p(blk)) { - mrb_raise(mrb, E_ARGUMENT_ERROR, "tried to create Fiber object without a block"); - } p = mrb_proc_ptr(blk); if (MRB_PROC_CFUNC_P(p)) { mrb_raise(mrb, E_FIBER_ERROR, "tried to create Fiber from C defined method"); @@ -511,7 +505,7 @@

      Instance Method Details

      - #==Object + #==Object @@ -523,20 +517,20 @@

       
       
      -287
      -288
      -289
      -290
       291
       292
       293
       294
       295
       296
      -297
      +297 +298 +299 +300 +301

      -
      # File 'mrbgems/mruby-fiber/src/fiber.c', line 287
      +      
      # File 'mrbgems/mruby-fiber/src/fiber.c', line 291
       
       static mrb_value
       fiber_eq(mrb_state *mrb, mrb_value self)
      @@ -544,7 +538,7 @@ 

      mrb_value other; mrb_get_args(mrb, "o", &other); - if (mrb_type(other) != MRB_TT_FIBER) { + if (!mrb_fiber_p(other)) { return mrb_false_value(); } return mrb_bool_value(fiber_ptr(self) == fiber_ptr(other)); @@ -594,7 +588,7 @@

      - #resume(args, ...) ⇒ Object + #resume(args, ...) ⇒ Object @@ -633,7 +627,7 @@

    1500. - (Object) + (Object) @@ -654,10 +648,6 @@

       
       
      -251
      -252
      -253
      -254
       255
       256
       257
      @@ -666,10 +656,14 @@ 

      260 261 262 -263

      +263 +264 +265 +266 +267

    1501. -
      # File 'mrbgems/mruby-fiber/src/fiber.c', line 251
      +      
      # File 'mrbgems/mruby-fiber/src/fiber.c', line 255
       
       static mrb_value
       fiber_resume(mrb_state *mrb, mrb_value self)
      @@ -692,7 +686,7 @@ 

      - #transfer(args, ...) ⇒ Object + #transfer(args, ...) ⇒ Object @@ -728,7 +722,7 @@

    1502. - (Object) + (Object) @@ -749,10 +743,6 @@

       
       
      -311
      -312
      -313
      -314
       315
       316
       317
      @@ -771,10 +761,14 @@ 

      330 331 332 -333

      +333 +334 +335 +336 +337

    1503. -
      # File 'mrbgems/mruby-fiber/src/fiber.c', line 311
      +      
      # File 'mrbgems/mruby-fiber/src/fiber.c', line 315
       
       static mrb_value
       fiber_transfer(mrb_state *mrb, mrb_value self)
      @@ -809,9 +803,9 @@ 

      diff --git a/docs/api/File.html b/docs/api/File.html index b09c55c..98db1b3 100644 --- a/docs/api/File.html +++ b/docs/api/File.html @@ -6,7 +6,7 @@ Class: File - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ IO

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 9
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 4
       
       def initialize(fd_or_path, mode = "r", perm = 0666)
         if fd_or_path.kind_of? Fixnum
      @@ -717,7 +715,7 @@ 

      Instance Attribute Details

      - #pathObject + #pathObject @@ -741,12 +739,12 @@

       
       
      -7
      -8
      -9
      +2 +3 +4

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 7
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 2
       
       def path
         @path
      @@ -803,12 +801,12 @@ 

       
       
      -152
      -153
      -154
      +147 +148 +149

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 152
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 147
       
       def self.directory?(file)
         FileTest.directory?(file)
      @@ -858,12 +856,12 @@ 

       
       
      -156
      -157
      -158
      +151 +152 +153

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 156
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 151
       
       def self.exist?(file)
         FileTest.exist?(file)
      @@ -913,12 +911,12 @@ 

       
       
      -160
      -161
      -162
      +155 +156 +157

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 160
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 155
       
       def self.exists?(file)
         FileTest.exists?(file)
      @@ -931,7 +929,7 @@ 

      - .expand_path(path, default_dir = '.') ⇒ Object + .expand_path(path, default_dir = '.') ⇒ Object @@ -943,6 +941,11 @@

       
       
      +58
      +59
      +60
      +61
      +62
       63
       64
       65
      @@ -1015,15 +1018,10 @@ 

      132 133 134 -135 -136 -137 -138 -139 -140

      +135

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 63
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 58
       
       def self.expand_path(path, default_dir = '.')
         def concat_path(path, base_path)
      @@ -1111,7 +1109,7 @@ 

      - .extname(filename) ⇒ Object + .extname(filename) ⇒ Object @@ -1123,15 +1121,15 @@

       
       
      -192
      -193
      -194
      -195
      -196
      -197
      +187 +188 +189 +190 +191 +192

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 192
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 187
       
       def self.extname(filename)
         fname = self.basename(filename)
      @@ -1184,12 +1182,12 @@ 

       
       
      -164
      -165
      -166
      +159 +160 +161

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 164
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 159
       
       def self.file?(file)
         FileTest.file?(file)
      @@ -1202,7 +1200,7 @@ 

      - .foreach(file) ⇒ Object + .foreach(file) ⇒ Object @@ -1214,18 +1212,18 @@

       
       
      +137
      +138
      +139
      +140
      +141
       142
       143
       144
      -145
      -146
      -147
      -148
      -149
      -150
      +145

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 142
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 137
       
       def self.foreach(file)
         if block_given?
      @@ -1244,7 +1242,7 @@ 

      - .join(*names) ⇒ Object + .join(*names) ⇒ Object @@ -1256,6 +1254,11 @@

       
       
      +14
      +15
      +16
      +17
      +18
       19
       20
       21
      @@ -1293,15 +1296,10 @@ 

      53 54 55 -56 -57 -58 -59 -60 -61

      +56

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 19
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 14
       
       def self.join(*names)
         return "" if names.empty?
      @@ -1354,7 +1352,7 @@ 

      - .path(filename) ⇒ Object + .path(filename) ⇒ Object @@ -1366,18 +1364,18 @@

       
       
      +194
      +195
      +196
      +197
      +198
       199
       200
       201
      -202
      -203
      -204
      -205
      -206
      -207
      +202

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 199
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 194
       
       def self.path(filename)
         if filename.kind_of?(String)
      @@ -1433,12 +1431,12 @@ 

       
       
      -168
      -169
      -170
      +163 +164 +165

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 168
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 163
       
       def self.pipe?(file)
         FileTest.pipe?(file)
      @@ -1451,7 +1449,7 @@ 

      - .size(file) ⇒ Object + .size(file) ⇒ Object @@ -1463,12 +1461,12 @@

       
       
      -172
      -173
      -174
      +167 +168 +169

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 172
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 167
       
       def self.size(file)
         FileTest.size(file)
      @@ -1518,12 +1516,12 @@ 

       
       
      -176
      -177
      -178
      +171 +172 +173

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 176
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 171
       
       def self.size?(file)
         FileTest.size?(file)
      @@ -1573,12 +1571,12 @@ 

       
       
      -180
      -181
      -182
      +175 +176 +177

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 180
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 175
       
       def self.socket?(file)
         FileTest.socket?(file)
      @@ -1628,12 +1626,12 @@ 

       
       
      -184
      -185
      -186
      +179 +180 +181

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 184
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 179
       
       def self.symlink?(file)
         FileTest.symlink?(file)
      @@ -1683,12 +1681,12 @@ 

       
       
      -188
      -189
      -190
      +183 +184 +185

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 188
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 183
       
       def self.zero?(file)
         FileTest.zero?(file)
      @@ -1707,7 +1705,7 @@ 

      Instance Method Details

      - #concat_path(path, base_path) ⇒ Object + #concat_path(path, base_path) ⇒ Object @@ -1719,6 +1717,11 @@

       
       
      +59
      +60
      +61
      +62
      +63
       64
       65
       66
      @@ -1750,15 +1753,10 @@ 

      92 93 94 -95 -96 -97 -98 -99 -100

      +95

      -
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 64
      +      
      # File 'mrbgems/mruby-io/mrblib/file.rb', line 59
       
       def concat_path(path, base_path)
         if path[0] == "/" || path[1] == ':' # Windows root!
      @@ -1805,7 +1803,7 @@ 

      - #flockObject + #flockObject @@ -1817,8 +1815,6 @@

       
       
      -351
      -352
       353
       354
       355
      @@ -1849,10 +1845,12 @@ 

      380 381 382 -383

      +383 +384 +385

      -
      # File 'mrbgems/mruby-io/src/file.c', line 351
      +      
      # File 'mrbgems/mruby-io/src/file.c', line 353
       
       mrb_value
       mrb_file_flock(mrb_state *mrb, mrb_value self)
      @@ -1895,7 +1893,7 @@ 

      - #mtimeObject + #mtimeObject @@ -1907,8 +1905,6 @@

       
       
      -337
      -338
       339
       340
       341
      @@ -1919,10 +1915,12 @@ 

      346 347 348 -349

      +349 +350 +351

      -
      # File 'mrbgems/mruby-io/src/file.c', line 337
      +      
      # File 'mrbgems/mruby-io/src/file.c', line 339
       
       static mrb_value
       mrb_file_mtime(mrb_state *mrb, mrb_value self)
      @@ -1947,9 +1945,9 @@ 

      diff --git a/docs/api/File/Constants.html b/docs/api/File/Constants.html index 475a81e..23a593f 100644 --- a/docs/api/File/Constants.html +++ b/docs/api/File/Constants.html @@ -6,7 +6,7 @@ Module: File::Constants - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -207,9 +207,9 @@

      diff --git a/docs/api/File/FileError.html b/docs/api/File/FileError.html deleted file mode 100644 index dd7b087..0000000 --- a/docs/api/File/FileError.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - Exception: File::FileError - - — Documentation by YARD 0.9.19 - - - - - - - - - - - - - - - - - - - - - - - -
      - - -

      Exception: File::FileError - - - -

      -
      - -
      -
      Inherits:
      -
      - Exception - - - show all - -
      -
      - - - - - - - - - - - -
      -
      Defined in:
      -
      mrbgems/mruby-io/mrblib/file.rb
      -
      - -
      - -
      -

      Direct Known Subclasses

      -

      NoFileError, PermissionError, UnableToStat

      -
      - - - - - - - - - - - - - - -

      Method Summary

      - -

      Methods inherited from Exception

      -

      #backtrace, #exception, #initialize, #inspect, #message, #set_backtrace, #to_s

      -
      -

      Constructor Details

      - -

      This class inherits a constructor from Exception

      - -
      - - -
      - - - -
      - - \ No newline at end of file diff --git a/docs/api/File/NoFileError.html b/docs/api/File/NoFileError.html deleted file mode 100644 index a09ab1d..0000000 --- a/docs/api/File/NoFileError.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - Exception: File::NoFileError - - — Documentation by YARD 0.9.19 - - - - - - - - - - - - - - - - - - - - - - - -
      - - -

      Exception: File::NoFileError - - - -

      -
      - -
      -
      Inherits:
      -
      - FileError - - - show all - -
      -
      - - - - - - - - - - - -
      -
      Defined in:
      -
      mrbgems/mruby-io/mrblib/file.rb
      -
      - -
      - - - - - - - - - - - - - - - - - - - - - -

      Method Summary

      - -

      Methods inherited from Exception

      -

      #backtrace, #exception, #initialize, #inspect, #message, #set_backtrace, #to_s

      -
      -

      Constructor Details

      - -

      This class inherits a constructor from Exception

      - -
      - - -
      - - - -
      - - \ No newline at end of file diff --git a/docs/api/File/PermissionError.html b/docs/api/File/PermissionError.html deleted file mode 100644 index 5ad6d50..0000000 --- a/docs/api/File/PermissionError.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - Exception: File::PermissionError - - — Documentation by YARD 0.9.19 - - - - - - - - - - - - - - - - - - - - - - - -
      - - -

      Exception: File::PermissionError - - - -

      -
      - -
      -
      Inherits:
      -
      - FileError - - - show all - -
      -
      - - - - - - - - - - - -
      -
      Defined in:
      -
      mrbgems/mruby-io/mrblib/file.rb
      -
      - -
      - - - - - - - - - - - - - - - - - - - - - -

      Method Summary

      - -

      Methods inherited from Exception

      -

      #backtrace, #exception, #initialize, #inspect, #message, #set_backtrace, #to_s

      -
      -

      Constructor Details

      - -

      This class inherits a constructor from Exception

      - -
      - - -
      - - - -
      - - \ No newline at end of file diff --git a/docs/api/File/UnableToStat.html b/docs/api/File/UnableToStat.html deleted file mode 100644 index 7c64bf4..0000000 --- a/docs/api/File/UnableToStat.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - Exception: File::UnableToStat - - — Documentation by YARD 0.9.19 - - - - - - - - - - - - - - - - - - - - - - - -
      - - -

      Exception: File::UnableToStat - - - -

      -
      - -
      -
      Inherits:
      -
      - FileError - - - show all - -
      -
      - - - - - - - - - - - -
      -
      Defined in:
      -
      mrbgems/mruby-io/mrblib/file.rb
      -
      - -
      - - - - - - - - - - - - - - - - - - - - - -

      Method Summary

      - -

      Methods inherited from Exception

      -

      #backtrace, #exception, #initialize, #inspect, #message, #set_backtrace, #to_s

      -
      -

      Constructor Details

      - -

      This class inherits a constructor from Exception

      - -
      - - -
      - - - -
      - - \ No newline at end of file diff --git a/docs/api/FileTest.html b/docs/api/FileTest.html index 92028e5..8971ed1 100644 --- a/docs/api/FileTest.html +++ b/docs/api/FileTest.html @@ -6,7 +6,7 @@ Class: FileTest - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
      Inherits:
      - Object + Object

      -
      # File 'src/numeric.c', line 865
      +      
      # File 'src/numeric.c', line 886
       
       static mrb_value
       fix_mod(mrb_state *mrb, mrb_value x)
       {
         mrb_value y;
      -  mrb_int a;
      +  mrb_int a, b;
       
         mrb_get_args(mrb, "o", &y);
         a = mrb_fixnum(x);
      -  if (mrb_fixnum_p(y)) {
      -    mrb_int b, mod;
      +   if (mrb_fixnum_p(y) && a != MRB_INT_MIN && (b=mrb_fixnum(y)) != MRB_INT_MIN) {
      +    mrb_int mod;
       
      -    if ((b=mrb_fixnum(y)) == 0) {
      +    if (b == 0) {
       #ifdef MRB_WITHOUT_FLOAT
             /* ZeroDivisionError */
             return mrb_fixnum_value(0);
       #else
      +      if (a > 0) return mrb_float_value(mrb, INFINITY);
      +      if (a < 0) return mrb_float_value(mrb, INFINITY);
             return mrb_float_value(mrb, NAN);
       #endif
           }
      -    fixdivmod(mrb, a, b, 0, &mod);
      +    fixdivmod(mrb, a, b, NULL, &mod);
           return mrb_fixnum_value(mod);
         }
       #ifdef MRB_WITHOUT_FLOAT
      @@ -652,7 +656,7 @@ 

      else { mrb_float mod; - flodivmod(mrb, (mrb_float)a, mrb_to_flo(mrb, y), 0, &mod); + flodivmod(mrb, (mrb_float)a, mrb_to_flo(mrb, y), NULL, &mod); return mrb_float_value(mrb, mod); } #endif @@ -665,7 +669,7 @@

      - #&(integer) ⇒ Object + #&(integer) ⇒ Object @@ -691,17 +695,17 @@

       
       
      -1031
      -1032
      -1033
      -1034
      -1035
      -1036
      -1037
      -1038
      +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061

      -
      # File 'src/numeric.c', line 1031
      +      
      # File 'src/numeric.c', line 1054
       
       static mrb_value
       fix_and(mrb_state *mrb, mrb_value x)
      @@ -719,7 +723,7 @@ 

      - #*(numeric) ⇒ Object + #*(numeric) ⇒ Object @@ -747,17 +751,17 @@

       
       
      -818
      -819
      -820
      -821
      -822
      -823
      -824
      -825
      +839 +840 +841 +842 +843 +844 +845 +846

      -
      # File 'src/numeric.c', line 818
      +      
      # File 'src/numeric.c', line 839
       
       static mrb_value
       fix_mul(mrb_state *mrb, mrb_value x)
      @@ -765,7 +769,7 @@ 

      mrb_value y; mrb_get_args(mrb, "o", &y); - return mrb_fixnum_mul(mrb, x, y); + return fixnum_mul(mrb, x, y); }

      @@ -775,7 +779,7 @@

      - #+(numeric) ⇒ Object + #+(numeric) ⇒ Object @@ -803,17 +807,17 @@

       
       
      -1274
      -1275
      -1276
      -1277
      -1278
      -1279
      -1280
      -1281
      +1312 +1313 +1314 +1315 +1316 +1317 +1318 +1319

      -
      # File 'src/numeric.c', line 1274
      +      
      # File 'src/numeric.c', line 1312
       
       static mrb_value
       fix_plus(mrb_state *mrb, mrb_value self)
      @@ -821,7 +825,7 @@ 

      mrb_value other; mrb_get_args(mrb, "o", &other); - return mrb_fixnum_plus(mrb, self, other); + return fixnum_plus(mrb, self, other); }

      @@ -831,7 +835,7 @@

      - #-(numeric) ⇒ Object + #-(numeric) ⇒ Object @@ -859,17 +863,17 @@

       
       
      -1317
      -1318
      -1319
      -1320
      -1321
      -1322
      -1323
      -1324
      +1370 +1371 +1372 +1373 +1374 +1375 +1376 +1377

      -
      # File 'src/numeric.c', line 1317
      +      
      # File 'src/numeric.c', line 1370
       
       static mrb_value
       fix_minus(mrb_state *mrb, mrb_value self)
      @@ -877,7 +881,7 @@ 

      mrb_value other; mrb_get_args(mrb, "o", &other); - return mrb_fixnum_minus(mrb, self, other); + return fixnum_minus(mrb, self, other); }

      @@ -938,25 +942,25 @@

       
       
      -1144
      -1145
      -1146
      -1147
      -1148
      -1149
      -1150
      -1151
      -1152
      -1153
      -1154
      -1155
      -1156
      -1157
      -1158
      -1159
      +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182

      -
      # File 'src/numeric.c', line 1144
      +      
      # File 'src/numeric.c', line 1167
       
       static mrb_value
       fix_lshift(mrb_state *mrb, mrb_value x)
      @@ -1037,26 +1041,26 @@ 

       
       
      -972
      -973
      -974
      -975
      -976
      -977
      -978
      -979
      -980
      -981
      -982
      -983
      -984
      -985
      -986
      -987
      -988
      +995 +996 +997 +998 +999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011

      -
      # File 'src/numeric.c', line 972
      +      
      # File 'src/numeric.c', line 995
       
       static mrb_value
       fix_equal(mrb_state *mrb, mrb_value x)
      @@ -1134,25 +1138,25 @@ 

       
       
      -1169
      -1170
      -1171
      -1172
      -1173
      -1174
      -1175
      -1176
      -1177
      -1178
      -1179
      -1180
      -1181
      -1182
      -1183
      -1184
      +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207

      -
      # File 'src/numeric.c', line 1169
      +      
      # File 'src/numeric.c', line 1192
       
       static mrb_value
       fix_rshift(mrb_state *mrb, mrb_value x)
      @@ -1178,7 +1182,7 @@ 

      - #^(integer) ⇒ Object + #^(integer) ⇒ Object @@ -1204,17 +1208,17 @@

       
       
      -1065
      -1066
      -1067
      -1068
      -1069
      -1070
      -1071
      -1072
      +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095

      -
      # File 'src/numeric.c', line 1065
      +      
      # File 'src/numeric.c', line 1088
       
       static mrb_value
       fix_xor(mrb_state *mrb, mrb_value x)
      @@ -1283,29 +1287,6 @@ 

       
       
      -905
      -906
      -907
      -908
      -909
      -910
      -911
      -912
      -913
      -914
      -915
      -916
      -917
      -918
      -919
      -920
      -921
      -922
      -923
      -924
      -925
      -926
      -927
       928
       929
       930
      @@ -1319,10 +1300,33 @@ 

      938 939 940 -941

      +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964

      -
      # File 'src/numeric.c', line 905
      +      
      # File 'src/numeric.c', line 928
       
       static mrb_value
       fix_divmod(mrb_state *mrb, mrb_value x)
      @@ -1355,7 +1359,7 @@ 

      mrb_value a, b; flodivmod(mrb, (mrb_float)mrb_fixnum(x), mrb_to_flo(mrb, y), &div, &mod); - a = mrb_float_value(mrb, div); + a = mrb_int_value(mrb, div); b = mrb_float_value(mrb, mod); return mrb_assoc_new(mrb, a, b); } @@ -1425,18 +1429,18 @@

       
       
      -354
      -355
      -356
      -357
      -358
      -359
      -360
      -361
      -362
      +368 +369 +370 +371 +372 +373 +374 +375 +376

      -
      # File 'src/numeric.c', line 354
      +      
      # File 'src/numeric.c', line 368
       
       static mrb_value
       fix_eql(mrb_state *mrb, mrb_value x)
      @@ -1514,17 +1518,17 @@ 

       
       
      -1372
      -1373
      -1374
      -1375
      -1376
      -1377
      -1378
      -1379
      +1425 +1426 +1427 +1428 +1429 +1430 +1431 +1432

      -
      # File 'src/numeric.c', line 1372
      +      
      # File 'src/numeric.c', line 1425
       
       static mrb_value
       fix_to_s(mrb_state *mrb, mrb_value self)
      @@ -1542,7 +1546,7 @@ 

      - #to_fObject + #to_fObject @@ -1566,14 +1570,14 @@

       
       
      -1196
      -1197
      -1198
      -1199
      -1200
      +1219 +1220 +1221 +1222 +1223

      -
      # File 'src/numeric.c', line 1196
      +      
      # File 'src/numeric.c', line 1219
       
       static mrb_value
       fix_to_f(mrb_state *mrb, mrb_value num)
      @@ -1647,17 +1651,17 @@ 

       
       
      -1372
      -1373
      -1374
      -1375
      -1376
      -1377
      -1378
      -1379
      +1425 +1426 +1427 +1428 +1429 +1430 +1431 +1432

      -
      # File 'src/numeric.c', line 1372
      +      
      # File 'src/numeric.c', line 1425
       
       static mrb_value
       fix_to_s(mrb_state *mrb, mrb_value self)
      @@ -1675,7 +1679,7 @@ 

      - #|(integer) ⇒ Object + #|(integer) ⇒ Object @@ -1701,17 +1705,17 @@

       
       
      -1048
      -1049
      -1050
      -1051
      -1052
      -1053
      -1054
      -1055
      +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078

      -
      # File 'src/numeric.c', line 1048
      +      
      # File 'src/numeric.c', line 1071
       
       static mrb_value
       fix_or(mrb_state *mrb, mrb_value x)
      @@ -1783,16 +1787,16 @@ 

       
       
      -1001
      -1002
      -1003
      -1004
      -1005
      -1006
      -1007
      +1024 +1025 +1026 +1027 +1028 +1029 +1030

      -
      # File 'src/numeric.c', line 1001
      +      
      # File 'src/numeric.c', line 1024
       
       static mrb_value
       fix_rev(mrb_state *mrb, mrb_value num)
      @@ -1811,9 +1815,9 @@ 

      diff --git a/docs/api/Float.html b/docs/api/Float.html index ee58eac..0e8efb2 100644 --- a/docs/api/Float.html +++ b/docs/api/Float.html @@ -6,7 +6,7 @@ Class: Float - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ Numeric

      -
      # File 'src/numeric.c', line 329
      +      
      # File 'src/numeric.c', line 343
       
       static mrb_value
       flo_mod(mrb_state *mrb, mrb_value x)
      @@ -873,7 +873,7 @@ 

      - #&Object + #&Object @@ -885,10 +885,10 @@

       
       
      -1014
      +1037

      -
      # File 'src/numeric.c', line 1014
      +      
      # File 'src/numeric.c', line 1037
       
       static mrb_value flo_and(mrb_state *mrb, mrb_value x);
      @@ -951,17 +951,17 @@

       
       
      -269
      -270
      -271
      -272
      -273
      -274
      -275
      -276
      +281 +282 +283 +284 +285 +286 +287 +288

      -
      # File 'src/numeric.c', line 269
      +      
      # File 'src/numeric.c', line 281
       
       static mrb_value
       flo_mul(mrb_state *mrb, mrb_value x)
      @@ -979,7 +979,7 @@ 

      - #+Object + #+Object @@ -1003,17 +1003,17 @@

       
       
      -1527
      -1528
      -1529
      -1530
      -1531
      -1532
      -1533
      -1534
      +1597 +1598 +1599 +1600 +1601 +1602 +1603 +1604

      -
      # File 'src/numeric.c', line 1527
      +      
      # File 'src/numeric.c', line 1597
       
       static mrb_value
       flo_plus(mrb_state *mrb, mrb_value x)
      @@ -1083,17 +1083,17 @@ 

       
       
      -251
      -252
      -253
      -254
      -255
      -256
      -257
      -258
      +263 +264 +265 +266 +267 +268 +269 +270

      -
      # File 'src/numeric.c', line 251
      +      
      # File 'src/numeric.c', line 263
       
       static mrb_value
       flo_minus(mrb_state *mrb, mrb_value x)
      @@ -1111,7 +1111,7 @@ 

      - #<<Object + #<<Object @@ -1123,20 +1123,20 @@

       
       
      -521
      -522
      -523
      -524
      -525
      -526
      -527
      -528
      +535 +536 +537 +538 +539 +540 +541 +542

      -
      # File 'src/numeric.c', line 521
      +      
      # File 'src/numeric.c', line 535
       
       static mrb_value
      -flo_rshift(mrb_state *mrb, mrb_value x)
      +flo_lshift(mrb_state *mrb, mrb_value x)
       {
         mrb_int width;
       
      @@ -1206,24 +1206,24 @@ 

       
       
      -388
      -389
      -390
      -391
      -392
      -393
      -394
      -395
      -396
      -397
      -398
      -399
      -400
      -401
      -402
      +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416

      -
      # File 'src/numeric.c', line 388
      +      
      # File 'src/numeric.c', line 402
       
       static mrb_value
       flo_eq(mrb_state *mrb, mrb_value x)
      @@ -1248,7 +1248,7 @@ 

      - #>>Object + #>>Object @@ -1260,20 +1260,20 @@

       
       
      -512
      -513
      -514
      -515
      -516
      -517
      -518
      -519
      +526 +527 +528 +529 +530 +531 +532 +533

      -
      # File 'src/numeric.c', line 512
      +      
      # File 'src/numeric.c', line 526
       
       static mrb_value
      -flo_lshift(mrb_state *mrb, mrb_value x)
      +flo_rshift(mrb_state *mrb, mrb_value x)
       {
         mrb_int width;
       
      @@ -1288,7 +1288,7 @@ 

      - #^Object + #^Object @@ -1300,10 +1300,10 @@

       
       
      -1016
      +1039

      -
      # File 'src/numeric.c', line 1016
      +      
      # File 'src/numeric.c', line 1039
       
       static mrb_value flo_xor(mrb_state *mrb, mrb_value x);
      @@ -1371,20 +1371,17 @@

       
       
      -635
      -636
      -637
      -638
      -639
      -640
      -641
      -642
      -643
      -644
      -645
      +646 +647 +648 +649 +650 +651 +652 +653

      -
      # File 'src/numeric.c', line 635
      +      
      # File 'src/numeric.c', line 646
       
       static mrb_value
       flo_ceil(mrb_state *mrb, mrb_value num)
      @@ -1392,10 +1389,7 @@ 

      mrb_float f = ceil(mrb_float(num)); mrb_check_num_exact(mrb, f); - if (!FIXABLE_FLOAT(f)) { - return mrb_float_value(mrb, f); - } - return mrb_fixnum_value((mrb_int)f); + return mrb_int_value(mrb, f); }

      @@ -1405,7 +1399,7 @@

      - #divmodObject + #divmodObject @@ -1429,23 +1423,23 @@

       
       
      -944
      -945
      -946
      -947
      -948
      -949
      -950
      -951
      -952
      -953
      -954
      -955
      -956
      -957
      +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 +980

      -
      # File 'src/numeric.c', line 944
      +      
      # File 'src/numeric.c', line 967
       
       static mrb_value
       flo_divmod(mrb_state *mrb, mrb_value x)
      @@ -1457,7 +1451,7 @@ 

      mrb_get_args(mrb, "o", &y); flodivmod(mrb, mrb_float(x), mrb_to_flo(mrb, y), &div, &mod); - a = mrb_float_value(mrb, div); + a = mrb_int_value(mrb, div); b = mrb_float_value(mrb, mod); return mrb_assoc_new(mrb, a, b); }

      @@ -1506,18 +1500,18 @@

       
       
      -365
      -366
      -367
      -368
      -369
      -370
      -371
      -372
      -373
      +379 +380 +381 +382 +383 +384 +385 +386 +387

      -
      # File 'src/numeric.c', line 365
      +      
      # File 'src/numeric.c', line 379
       
       static mrb_value
       flo_eql(mrb_state *mrb, mrb_value x)
      @@ -1589,14 +1583,14 @@ 

       
       
      -579
      -580
      -581
      -582
      -583
      +593 +594 +595 +596 +597

      -
      # File 'src/numeric.c', line 579
      +      
      # File 'src/numeric.c', line 593
       
       static mrb_value
       flo_finite_p(mrb_state *mrb, mrb_value num)
      @@ -1667,20 +1661,17 @@ 

       
       
      -609
      -610
      -611
      -612
      -613
      -614
      -615
      -616
      -617
      -618
      -619
      +623 +624 +625 +626 +627 +628 +629 +630

      -
      # File 'src/numeric.c', line 609
      +      
      # File 'src/numeric.c', line 623
       
       static mrb_value
       flo_floor(mrb_state *mrb, mrb_value num)
      @@ -1688,10 +1679,7 @@ 

      mrb_float f = floor(mrb_float(num)); mrb_check_num_exact(mrb, f); - if (!FIXABLE_FLOAT(f)) { - return mrb_float_value(mrb, f); - } - return mrb_fixnum_value((mrb_int)f); + return mrb_int_value(mrb, f); }

      @@ -1757,19 +1745,19 @@

       
       
      -557
      -558
      -559
      -560
      -561
      -562
      -563
      -564
      -565
      -566
      +571 +572 +573 +574 +575 +576 +577 +578 +579 +580

      -
      # File 'src/numeric.c', line 557
      +      
      # File 'src/numeric.c', line 571
       
       static mrb_value
       flo_infinite_p(mrb_state *mrb, mrb_value num)
      @@ -1843,21 +1831,6 @@ 

       
       
      -194
      -195
      -196
      -197
      -198
      -199
      -200
      -201
      -202
      -203
      -204
      -205
      -206
      -207
      -208
       209
       210
       211
      @@ -1889,10 +1862,22 @@ 

      237 238 239 -240

      +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252

      -
      # File 'src/numeric.c', line 194
      +      
      # File 'src/numeric.c', line 209
       
       static mrb_value
       flo_to_s(mrb_state *mrb, mrb_value flt)
      @@ -1910,12 +1895,12 @@ 

      char fmt[] = "%." MRB_STRINGIZE(FLO_TO_STR_PREC) "g"; mrb_value str = mrb_float_to_str(mrb, flt, fmt); mrb_int len; - char *begp; + char *begp, *p, *endp; insert_dot_zero: begp = RSTRING_PTR(str); len = RSTRING_LEN(str); - for (char *p = begp, *endp = p + len; p < endp; ++p) { + for (p = begp, endp = p + len; p < endp; ++p) { if (*p == '.') { return str; } @@ -1934,9 +1919,6 @@

      str = mrb_float_to_str(mrb, flt, fmt); goto insert_dot_zero; } - else { - mrb_str_cat(mrb, str, ".0", 2); - } return str; } @@ -1986,14 +1968,14 @@

       
       
      -753
      -754
      -755
      -756
      -757
      +759 +760 +761 +762 +763

      -
      # File 'src/numeric.c', line 753
      +      
      # File 'src/numeric.c', line 759
       
       static mrb_value
       flo_nan_p(mrb_state *mrb, mrb_value num)
      @@ -2081,14 +2063,6 @@ 

       
       
      -678
      -679
      -680
      -681
      -682
      -683
      -684
      -685
       686
       687
       688
      @@ -2129,10 +2103,19 @@ 

      723 724 725 -726

      +726 +727 +728 +729 +730 +731 +732 +733 +734 +735

      -
      # File 'src/numeric.c', line 678
      +      
      # File 'src/numeric.c', line 686
       
       static mrb_value
       flo_round(mrb_state *mrb, mrb_value num)
      @@ -2151,6 +2134,7 @@ 

      f = 1.0; i = ndigits >= 0 ? ndigits : -ndigits; + if (ndigits > DBL_DIG+2) return num; while (--i >= 0) f = f*10.0; @@ -2181,7 +2165,7 @@

      if (!isfinite(number)) return num; return mrb_float_value(mrb, number); } - return mrb_fixnum_value((mrb_int)number); + return mrb_int_value(mrb, number); }

      @@ -2242,14 +2226,14 @@

       
       
      -538
      -539
      -540
      -541
      -542
      +552 +553 +554 +555 +556

      -
      # File 'src/numeric.c', line 538
      +      
      # File 'src/numeric.c', line 552
       
       static mrb_value
       flo_to_f(mrb_state *mrb, mrb_value num)
      @@ -2359,23 +2343,20 @@ 

       
       
      -738
      -739
      -740
      -741
      -742
      -743
      -744
      -745
      -746
       747
       748
       749
       750
      -751
      +751 +752 +753 +754 +755 +756 +757

      -
      # File 'src/numeric.c', line 738
      +      
      # File 'src/numeric.c', line 747
       
       static mrb_value
       flo_truncate(mrb_state *mrb, mrb_value num)
      @@ -2386,10 +2367,7 @@ 

      if (f < 0.0) f = ceil(f); mrb_check_num_exact(mrb, f); - if (!FIXABLE_FLOAT(f)) { - return mrb_float_value(mrb, f); - } - return mrb_fixnum_value((mrb_int)f); + return mrb_int_value(mrb, f); }

      @@ -2494,23 +2472,20 @@

       
       
      -738
      -739
      -740
      -741
      -742
      -743
      -744
      -745
      -746
       747
       748
       749
       750
      -751
      +751 +752 +753 +754 +755 +756 +757

      -
      # File 'src/numeric.c', line 738
      +      
      # File 'src/numeric.c', line 747
       
       static mrb_value
       flo_truncate(mrb_state *mrb, mrb_value num)
      @@ -2521,10 +2496,7 @@ 

      if (f < 0.0) f = ceil(f); mrb_check_num_exact(mrb, f); - if (!FIXABLE_FLOAT(f)) { - return mrb_float_value(mrb, f); - } - return mrb_fixnum_value((mrb_int)f); + return mrb_int_value(mrb, f); }

      @@ -2588,21 +2560,6 @@

       
       
      -194
      -195
      -196
      -197
      -198
      -199
      -200
      -201
      -202
      -203
      -204
      -205
      -206
      -207
      -208
       209
       210
       211
      @@ -2634,10 +2591,22 @@ 

      237 238 239 -240

      +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252

      -
      # File 'src/numeric.c', line 194
      +      
      # File 'src/numeric.c', line 209
       
       static mrb_value
       flo_to_s(mrb_state *mrb, mrb_value flt)
      @@ -2655,12 +2624,12 @@ 

      char fmt[] = "%." MRB_STRINGIZE(FLO_TO_STR_PREC) "g"; mrb_value str = mrb_float_to_str(mrb, flt, fmt); mrb_int len; - char *begp; + char *begp, *p, *endp; insert_dot_zero: begp = RSTRING_PTR(str); len = RSTRING_LEN(str); - for (char *p = begp, *endp = p + len; p < endp; ++p) { + for (p = begp, endp = p + len; p < endp; ++p) { if (*p == '.') { return str; } @@ -2679,9 +2648,6 @@

      str = mrb_float_to_str(mrb, flt, fmt); goto insert_dot_zero; } - else { - mrb_str_cat(mrb, str, ".0", 2); - } return str; } @@ -2789,23 +2755,20 @@

       
       
      -738
      -739
      -740
      -741
      -742
      -743
      -744
      -745
      -746
       747
       748
       749
       750
      -751
      +751 +752 +753 +754 +755 +756 +757

      -
      # File 'src/numeric.c', line 738
      +      
      # File 'src/numeric.c', line 747
       
       static mrb_value
       flo_truncate(mrb_state *mrb, mrb_value num)
      @@ -2816,10 +2779,7 @@ 

      if (f < 0.0) f = ceil(f); mrb_check_num_exact(mrb, f); - if (!FIXABLE_FLOAT(f)) { - return mrb_float_value(mrb, f); - } - return mrb_fixnum_value((mrb_int)f); + return mrb_int_value(mrb, f); }

      @@ -2829,7 +2789,7 @@

      - #|Object + #|Object @@ -2841,10 +2801,10 @@

       
       
      -1015
      +1038

      -
      # File 'src/numeric.c', line 1015
      +      
      # File 'src/numeric.c', line 1038
       
       static mrb_value flo_or(mrb_state *mrb, mrb_value x);
      @@ -2855,7 +2815,7 @@

      - #~Object + #~Object @@ -2879,23 +2839,21 @@

       
       
      -430
      -431
      -432
      -433
      -434
      -435
      -436
      -437
      +444 +445 +446 +447 +448 +449 +450

      -
      # File 'src/numeric.c', line 430
      +      
      # File 'src/numeric.c', line 444
       
       static mrb_value
       flo_rev(mrb_state *mrb, mrb_value x)
       {
         int64_t v1;
      -  mrb_get_args(mrb, "");
         v1 = (int64_t)mrb_float(x);
         return int64_value(mrb, ~v1);
       }
      @@ -2909,9 +2867,9 @@

      diff --git a/docs/api/FloatDomainError.html b/docs/api/FloatDomainError.html index fbe92e2..cb7fa5a 100644 --- a/docs/api/FloatDomainError.html +++ b/docs/api/FloatDomainError.html @@ -6,7 +6,7 @@ Exception: FloatDomainError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ RangeError

      -
      # File 'src/hash.c', line 794
      +      
      # File 'src/hash.c', line 792
       
       static mrb_value
       mrb_hash_init(mrb_state *mrb, mrb_value hash)
      @@ -1845,7 +1849,7 @@ 

      Class Method Details

      - .[](*object) ⇒ Object + .[](*object) ⇒ Object @@ -1976,7 +1980,7 @@

      Instance Method Details

      - #<(hash) ⇒ Object + #<(hash) ⇒ Object @@ -2048,7 +2052,7 @@

      - #<=(hash) ⇒ Object + #<=(hash) ⇒ Object @@ -2120,7 +2124,7 @@

      - #==(hash) ⇒ Object + #==(hash) ⇒ Object @@ -2185,7 +2189,7 @@

      - #>(hash) ⇒ Object + #>(hash) ⇒ Object @@ -2257,7 +2261,7 @@

      - #>=(hash) ⇒ Object + #>=(hash) ⇒ Object @@ -2329,7 +2333,7 @@

      - #[](key) ⇒ Object + #[](key) ⇒ Object @@ -2361,17 +2365,17 @@

       
       
      +829
      +830
       831
       832
       833
       834
       835
      -836
      -837
      -838
      +836

      -
      # File 'src/hash.c', line 831
      +      
      # File 'src/hash.c', line 829
       
       static mrb_value
       mrb_hash_aget(mrb_state *mrb, mrb_value self)
      @@ -2390,9 +2394,9 @@ 

      - #[]=(key) ⇒ Object + #[]=(key) ⇒ Object - #store(key, value) ⇒ Object + #store(key, value) ⇒ Object @@ -2427,18 +2431,18 @@

       
       
      +1125
      +1126
       1127
       1128
       1129
       1130
       1131
       1132
      -1133
      -1134
      -1135
      +1133

      -
      # File 'src/hash.c', line 1127
      +      
      # File 'src/hash.c', line 1125
       
       static mrb_value
       mrb_hash_aset(mrb_state *mrb, mrb_value self)
      @@ -2457,7 +2461,7 @@ 

      - #__deleteObject + #__deleteObject @@ -2481,18 +2485,18 @@

       
       
      +1004
      +1005
       1006
       1007
       1008
       1009
       1010
       1011
      -1012
      -1013
      -1014
      +1012

      -
      # File 'src/hash.c', line 1006
      +      
      # File 'src/hash.c', line 1004
       
       static mrb_value
       mrb_hash_delete(mrb_state *mrb, mrb_value self)
      @@ -2511,7 +2515,7 @@ 

      - #_inspectObject + #_inspect(recur_list) ⇒ Object @@ -2547,20 +2551,24 @@

      198 199 200 -201

      +201 +202 +203
      # File 'mrblib/hash.rb', line 189
       
      -def _inspect
      +def _inspect(recur_list)
         return "{}" if self.size == 0
      +  return "{...}" if recur_list[self.object_id]
      +  recur_list[self.object_id] = true
         ary=[]
         keys=self.keys
         size=keys.size
         i=0
         while i<size
           k=keys[i]
      -    ary<<(k._inspect + "=>" + self[k]._inspect)
      +    ary<<(k._inspect(recur_list) + "=>" + self[k]._inspect(recur_list))
           i+=1
         end
         "{"+ary.join(", ")+"}"
      @@ -2628,6 +2636,8 @@ 

       
       
      +1093
      +1094
       1095
       1096
       1097
      @@ -2637,12 +2647,10 @@ 

      1101 1102 1103 -1104 -1105 -1106

      +1104

      -
      # File 'src/hash.c', line 1095
      +      
      # File 'src/hash.c', line 1093
       
       MRB_API mrb_value
       mrb_hash_clear(mrb_state *mrb, mrb_value hash)
      @@ -2664,7 +2672,7 @@ 

      - #compactObject + #compactObject @@ -2725,7 +2733,7 @@

      - #compact!Object + #compact!Object @@ -2794,7 +2802,7 @@

      - #default(key = nil) ⇒ Object + #default(key = nil) ⇒ Object @@ -2838,7 +2846,7 @@

    1504. - (Object) + (Object) @@ -2859,6 +2867,8 @@

       
       
      +874
      +875
       876
       877
       878
      @@ -2874,12 +2884,10 @@ 

      888 889 890 -891 -892 -893

      +891

    1505. -
      # File 'src/hash.c', line 876
      +      
      # File 'src/hash.c', line 874
       
       static mrb_value
       mrb_hash_default(mrb_state *mrb, mrb_value hash)
      @@ -2907,7 +2915,7 @@ 

      - #default=(obj) ⇒ Object + #default=(obj) ⇒ Object @@ -2950,7 +2958,7 @@

    1506. - (Object) + (Object) @@ -2971,6 +2979,8 @@

       
       
      +914
      +915
       916
       917
       918
      @@ -2985,12 +2995,10 @@ 

      927 928 929 -930 -931 -932

      +930

    1507. -
      # File 'src/hash.c', line 916
      +      
      # File 'src/hash.c', line 914
       
       static mrb_value
       mrb_hash_set_default(mrb_state *mrb, mrb_value hash)
      @@ -3017,7 +3025,7 @@ 

      - #default_procObject + #default_procObject @@ -3054,7 +3062,7 @@

    1508. - (Object) + (Object) @@ -3075,17 +3083,17 @@

       
       
      +948
      +949
       950
       951
       952
       953
       954
      -955
      -956
      -957
      +955

    1509. -
      # File 'src/hash.c', line 950
      +      
      # File 'src/hash.c', line 948
       
       static mrb_value
       mrb_hash_default_proc(mrb_state *mrb, mrb_value hash)
      @@ -3160,6 +3168,8 @@ 

       
       
      +970
      +971
       972
       973
       974
      @@ -3176,12 +3186,10 @@ 

      985 986 987 -988 -989 -990

      +988

      -
      # File 'src/hash.c', line 972
      +      
      # File 'src/hash.c', line 970
       
       static mrb_value
       mrb_hash_set_default_proc(mrb_state *mrb, mrb_value hash)
      @@ -3210,7 +3218,7 @@ 

      - #delete(key, &block) ⇒ Object + #delete(key, &block) ⇒ Object @@ -3264,7 +3272,7 @@

      - #delete_if(&block) ⇒ Object + #delete_if(&block) ⇒ Object @@ -3327,7 +3335,7 @@

      - #dig(idx, *args) ⇒ Object + #dig(idx, *args) ⇒ Object @@ -3384,7 +3392,7 @@

      - #each(&block) ⇒ Object + #each(&block) ⇒ Object @@ -3470,7 +3478,7 @@

      - #each_key(&block) ⇒ Object + #each_key(&block) ⇒ Object @@ -3535,7 +3543,7 @@

      - #each_value(&block) ⇒ Object + #each_value(&block) ⇒ Object @@ -3653,14 +3661,14 @@

       
       
      +1184
      +1185
       1186
       1187
      -1188
      -1189
      -1190
      +1188

      -
      # File 'src/hash.c', line 1186
      +      
      # File 'src/hash.c', line 1184
       
       static mrb_value
       mrb_hash_empty_m(mrb_state *mrb, mrb_value self)
      @@ -3751,7 +3759,7 @@ 

      - #fetch(key, none = NONE, &block) ⇒ Object + #fetch(key, none = NONE, &block) ⇒ Object @@ -3840,7 +3848,7 @@

      - #fetch_values(*keys, &block) ⇒ Object + #fetch_values(*keys, &block) ⇒ Object @@ -3898,7 +3906,7 @@

      - #flatten(level = 1) ⇒ Object + #flatten(level = 1) ⇒ Object @@ -3990,6 +3998,8 @@

       
       
      +1289
      +1290
       1291
       1292
       1293
      @@ -3997,12 +4007,10 @@ 

      1295 1296 1297 -1298 -1299 -1300

      +1298

      -
      # File 'src/hash.c', line 1291
      +      
      # File 'src/hash.c', line 1289
       
       static mrb_value
       mrb_hash_has_key(mrb_state *mrb, mrb_value hash)
      @@ -4122,6 +4130,8 @@ 

       
       
      +1332
      +1333
       1334
       1335
       1336
      @@ -4131,12 +4141,10 @@ 

      1340 1341 1342 -1343 -1344 -1345

      +1343

      -
      # File 'src/hash.c', line 1334
      +      
      # File 'src/hash.c', line 1332
       
       static mrb_value
       mrb_hash_has_value(mrb_state *mrb, mrb_value hash)
      @@ -4195,6 +4203,8 @@ 

       
       
      +1289
      +1290
       1291
       1292
       1293
      @@ -4202,12 +4212,10 @@ 

      1295 1296 1297 -1298 -1299 -1300

      +1298

      -
      # File 'src/hash.c', line 1291
      +      
      # File 'src/hash.c', line 1289
       
       static mrb_value
       mrb_hash_has_key(mrb_state *mrb, mrb_value hash)
      @@ -4227,7 +4235,7 @@ 

      - #inspectObject + #inspectObject @@ -4255,23 +4263,15 @@

       
       
      -206
      -207
       208
       209
      -210
      -211
      -212
      +210

      -
      # File 'mrblib/hash.rb', line 206
      +      
      # File 'mrblib/hash.rb', line 208
       
       def inspect
      -  begin
      -    self._inspect
      -  rescue SystemStackError
      -    "{...}"
      -  end
      +  self._inspect({})
       end
      @@ -4281,7 +4281,7 @@

      - #invertObject + #invertObject @@ -4335,7 +4335,7 @@

      - #keep_if(&block) ⇒ Object + #keep_if(&block) ⇒ Object @@ -4400,7 +4400,7 @@

      - #key(val) ⇒ Object + #key(val) ⇒ Object @@ -4495,6 +4495,8 @@

       
       
      +1289
      +1290
       1291
       1292
       1293
      @@ -4502,12 +4504,10 @@ 

      1295 1296 1297 -1298 -1299 -1300

      +1298

      -
      # File 'src/hash.c', line 1291
      +      
      # File 'src/hash.c', line 1289
       
       static mrb_value
       mrb_hash_has_key(mrb_state *mrb, mrb_value hash)
      @@ -4582,6 +4582,8 @@ 

       
       
      +1210
      +1211
       1212
       1213
       1214
      @@ -4592,12 +4594,10 @@ 

      1219 1220 1221 -1222 -1223 -1224

      +1222

      -
      # File 'src/hash.c', line 1212
      +      
      # File 'src/hash.c', line 1210
       
       MRB_API mrb_value
       mrb_hash_keys(mrb_state *mrb, mrb_value hash)
      @@ -4720,15 +4720,15 @@ 

       
       
      +1158
      +1159
       1160
       1161
       1162
      -1163
      -1164
      -1165
      +1163

      -
      # File 'src/hash.c', line 1160
      +      
      # File 'src/hash.c', line 1158
       
       static mrb_value
       mrb_hash_size_m(mrb_state *mrb, mrb_value self)
      @@ -4781,6 +4781,8 @@ 

       
       
      +1289
      +1290
       1291
       1292
       1293
      @@ -4788,12 +4790,10 @@ 

      1295 1296 1297 -1298 -1299 -1300

      +1298

      -
      # File 'src/hash.c', line 1291
      +      
      # File 'src/hash.c', line 1289
       
       static mrb_value
       mrb_hash_has_key(mrb_state *mrb, mrb_value hash)
      @@ -4813,7 +4813,7 @@ 

      - #merge(other, &block) ⇒ Object + #merge(other, &block) ⇒ Object @@ -4892,7 +4892,7 @@

      - #merge!(other, &block) ⇒ Object + #merge!(other, &block) ⇒ Object @@ -4997,10 +4997,21 @@

      values of key objects have changed since they were inserted, this method will reindex hsh.

      -

      h = => “b” - h.keys[0].chop! - h.rehash #=> “AA”=>”b” - h[“AA”] #=> “b”

      +

      keys = (1..17).map{|n| [n]} + k = keys[0] + h = {} + keys.each{|key| h[key] = key[0]} + h #=> { [1]=> 1, [2]=> 2, [3]=> 3, [4]=> 4, [5]=> 5, [6]=> 6, [7]=> 7, + [8]=> 8, [9]=> 9,[10]=>10,[11]=>11,[12]=>12,[13]=>13,[14]=>14, + [15]=>15,[16]=>16,[17]=>17} + h[k] #=> 1 + k[0] = keys.size + 1 + h #=> 1, [2]=> 2, [3]=> 3, [4]=> 4, [5]=> 5, [6]=> 6, [7]=> 7, + [8]=> 8, [9]=> 9,[10]=>10,[11]=>11,[12]=>12,[13]=>13,[14]=>14, + [15]=>15,[16]=>16,[17]=>17 + h[k] #=> nil + h.rehash + h[k] #=> 1

      @@ -5043,15 +5054,15 @@

       
       
      -1389
      -1390
      -1391
      -1392
      -1393
      -1394
      +1398 +1399 +1400 +1401 +1402 +1403

      -
      # File 'src/hash.c', line 1389
      +      
      # File 'src/hash.c', line 1398
       
       static mrb_value
       mrb_hash_rehash(mrb_state *mrb, mrb_value self)
      @@ -5067,7 +5078,7 @@ 

      - #reject(&block) ⇒ Object + #reject(&block) ⇒ Object @@ -5104,6 +5115,8 @@

       
       
      +255
      +256
       257
       258
       259
      @@ -5112,12 +5125,10 @@ 

      262 263 264 -265 -266 -267

      +265

      -
      # File 'mrblib/hash.rb', line 257
      +      
      # File 'mrblib/hash.rb', line 255
       
       def reject(&block)
         return to_enum :reject unless block
      @@ -5138,7 +5149,7 @@ 

      - #reject!(&block) ⇒ Object + #reject!(&block) ⇒ Object @@ -5169,6 +5180,8 @@

       
       
      +224
      +225
       226
       227
       228
      @@ -5181,12 +5194,10 @@ 

      235 236 237 -238 -239 -240

      +238

      -
      # File 'mrblib/hash.rb', line 226
      +      
      # File 'mrblib/hash.rb', line 224
       
       def reject!(&block)
         return to_enum :reject! unless block
      @@ -5211,7 +5222,7 @@ 

      - #replace(hash) ⇒ Object + #replace(hash) ⇒ Object @@ -5292,10 +5303,14 @@

      - #select(&block) ⇒ Object + #select(&block) ⇒ Object + Also known as: + filter + +

      @@ -5329,6 +5344,8 @@

       
       
      +308
      +309
       310
       311
       312
      @@ -5337,12 +5354,10 @@ 

      315 316 317 -318 -319 -320

      +318

      -
      # File 'mrblib/hash.rb', line 310
      +      
      # File 'mrblib/hash.rb', line 308
       
       def select(&block)
         return to_enum :select unless block
      @@ -5363,10 +5378,14 @@ 

      - #select!(&block) ⇒ Object + #select!(&block) ⇒ Object + Also known as: + filter! + +

      @@ -5394,6 +5413,8 @@

       
       
      +277
      +278
       279
       280
       281
      @@ -5406,12 +5427,10 @@ 

      288 289 290 -291 -292 -293

      +291

      -
      # File 'mrblib/hash.rb', line 279
      +      
      # File 'mrblib/hash.rb', line 277
       
       def select!(&block)
         return to_enum :select! unless block
      @@ -5436,7 +5455,7 @@ 

      - #shiftArray, Object + #shiftArray, Object @@ -5473,7 +5492,7 @@

    1510. - (Array, Object) + (Array, Object) @@ -5494,6 +5513,8 @@

       
       
      +1055
      +1056
       1057
       1058
       1059
      @@ -5516,12 +5537,10 @@ 

      1076 1077 1078 -1079 -1080 -1081

      +1079

    1511. -
      # File 'src/hash.c', line 1057
      +      
      # File 'src/hash.c', line 1055
       
       static mrb_value
       mrb_hash_shift(mrb_state *mrb, mrb_value hash)
      @@ -5656,15 +5675,15 @@ 

       
       
      +1158
      +1159
       1160
       1161
       1162
      -1163
      -1164
      -1165
      +1163

      -
      # File 'src/hash.c', line 1160
      +      
      # File 'src/hash.c', line 1158
       
       static mrb_value
       mrb_hash_size_m(mrb_state *mrb, mrb_value self)
      @@ -5792,9 +5811,9 @@ 

      - #[]=(key) ⇒ Object + #[]=(key) ⇒ Object - #store(key, value) ⇒ Object + #store(key, value) ⇒ Object @@ -5829,18 +5848,18 @@

       
       
      +1125
      +1126
       1127
       1128
       1129
       1130
       1131
       1132
      -1133
      -1134
      -1135
      +1133

      -
      # File 'src/hash.c', line 1127
      +      
      # File 'src/hash.c', line 1125
       
       static mrb_value
       mrb_hash_aset(mrb_state *mrb, mrb_value self)
      @@ -5859,7 +5878,7 @@ 

      - #to_hObject + #to_hObject @@ -5905,7 +5924,7 @@

      - #to_procObject + #to_procObject @@ -5935,7 +5954,7 @@

      - #transform_keys(&block) ⇒ Object + #transform_keys(&block) ⇒ Object @@ -5996,7 +6015,7 @@

      - #transform_keys!(&block) ⇒ Object + #transform_keys!(&block) ⇒ Object @@ -6059,7 +6078,7 @@

      - #transform_values(&b) ⇒ Object + #transform_values(&b) ⇒ Object @@ -6119,7 +6138,7 @@

      - #transform_values!(&b) ⇒ Object + #transform_values!(&b) ⇒ Object @@ -6276,6 +6295,8 @@

       
       
      +1332
      +1333
       1334
       1335
       1336
      @@ -6285,12 +6306,10 @@ 

      1340 1341 1342 -1343 -1344 -1345

      +1343

      -
      # File 'src/hash.c', line 1334
      +      
      # File 'src/hash.c', line 1332
       
       static mrb_value
       mrb_hash_has_value(mrb_state *mrb, mrb_value hash)
      @@ -6367,6 +6386,8 @@ 

       
       
      +1244
      +1245
       1246
       1247
       1248
      @@ -6377,12 +6398,10 @@ 

      1253 1254 1255 -1256 -1257 -1258

      +1256

      -
      # File 'src/hash.c', line 1246
      +      
      # File 'src/hash.c', line 1244
       
       MRB_API mrb_value
       mrb_hash_values(mrb_state *mrb, mrb_value hash)
      @@ -6506,9 +6525,9 @@ 

      diff --git a/docs/api/IO.html b/docs/api/IO.html index 2c281f1..e51fbe7 100644 --- a/docs/api/IO.html +++ b/docs/api/IO.html @@ -6,7 +6,7 @@ Class: IO - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
      Inherits:
      - Object + Object

      -
      # File 'mrbgems/mruby-io/src/io.c', line 613
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 612
       
       mrb_value
       mrb_io_initialize(mrb_state *mrb, mrb_value io)
      @@ -1237,7 +1237,7 @@ 

      opt = mrb_hash_new(mrb); } - flags = mrb_io_modestr_to_flags(mrb, mrb_string_value_cstr(mrb, &mode)); + flags = mrb_io_modestr_to_flags(mrb, RSTRING_CSTR(mrb, mode)); mrb_iv_set(mrb, io, mrb_intern_cstr(mrb, "@buf"), mrb_str_new_cstr(mrb, "")); @@ -1272,7 +1272,7 @@

      Class Method Details

      - .open(*args, &block) ⇒ Object + .open(*args, &block) ⇒ Object @@ -1324,7 +1324,7 @@

      - .pipe(&block) ⇒ Object + .pipe(&block) ⇒ Object @@ -1380,7 +1380,7 @@

      - .popen(command, mode = 'r', opts = {}, &block) ⇒ Object + .popen(command, mode = 'r', opts = {}, &block) ⇒ Object @@ -1438,7 +1438,7 @@

      - .read(path, length = nil, offset = nil, opt = nil) ⇒ Object + .read(path, length = nil, offset = nil, opt = nil) ⇒ Object @@ -1562,7 +1562,7 @@

      Instance Method Details

      - #<<(str) ⇒ Object + #<<(str) ⇒ Object @@ -1594,7 +1594,7 @@

      - #_check_readableObject + #_check_readableObject @@ -1606,6 +1606,7 @@

       
       
      +714
       715
       716
       717
      @@ -1613,11 +1614,10 @@ 

      719 720 721 -722 -723

      +722

      -
      # File 'mrbgems/mruby-io/src/io.c', line 715
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 714
       
       mrb_value
       mrb_io_check_readable(mrb_state *mrb, mrb_value self)
      @@ -1636,7 +1636,7 @@ 

      - #_read_bufObject + #_read_bufObject @@ -1651,14 +1651,24 @@

      172 173 174 -175

      +175 +176 +177 +178 +179 +180
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 172
       
       def _read_buf
      -  return @buf if @buf && @buf.size > 0
      -  @buf = sysread(BUF_SIZE)
      +  return @buf if @buf && @buf.bytesize >= 4 # maximum UTF-8 character is 4 bytes
      +  @buf ||= ""
      +  begin
      +    @buf += sysread(BUF_SIZE)
      +  rescue EOFError => e
      +    raise e if @buf.empty?
      +  end
       end
      @@ -1668,7 +1678,7 @@

      - #closeObject + #closeObject @@ -1692,17 +1702,17 @@

       
       
      -934
      -935
      -936
      -937
      -938
      -939
      -940
      -941
      +926 +927 +928 +929 +930 +931 +932 +933

      -
      # File 'mrbgems/mruby-io/src/io.c', line 934
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 926
       
       mrb_value
       mrb_io_close(mrb_state *mrb, mrb_value self)
      @@ -1720,7 +1730,7 @@ 

      - #close_on_exec=Object + #close_on_exec=Object @@ -1732,6 +1742,14 @@

       
       
      +1238
      +1239
      +1240
      +1241
      +1242
      +1243
      +1244
      +1245
       1246
       1247
       1248
      @@ -1758,18 +1776,10 @@ 

      1269 1270 1271 -1272 -1273 -1274 -1275 -1276 -1277 -1278 -1279 -1280

      +1272

      -
      # File 'mrbgems/mruby-io/src/io.c', line 1246
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 1238
       
       mrb_value
       mrb_io_set_close_on_exec(mrb_state *mrb, mrb_value self)
      @@ -1851,6 +1861,14 @@ 

       
       
      +1214
      +1215
      +1216
      +1217
      +1218
      +1219
      +1220
      +1221
       1222
       1223
       1224
      @@ -1865,18 +1883,10 @@ 

      1233 1234 1235 -1236 -1237 -1238 -1239 -1240 -1241 -1242 -1243 -1244

      +1236

      -
      # File 'mrbgems/mruby-io/src/io.c', line 1222
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 1214
       
       mrb_value
       mrb_io_close_on_exec_p(mrb_state *mrb, mrb_value self)
      @@ -1909,7 +1919,7 @@ 

      - #close_writeObject + #close_writeObject @@ -1933,19 +1943,19 @@

       
       
      +935
      +936
      +937
      +938
      +939
      +940
      +941
      +942
       943
      -944
      -945
      -946
      -947
      -948
      -949
      -950
      -951
      -952
      +944

      -
      # File 'mrbgems/mruby-io/src/io.c', line 943
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 935
       
       mrb_value
       mrb_io_close_write(mrb_state *mrb, mrb_value self)
      @@ -2002,26 +2012,26 @@ 

       
       
      +946
      +947
      +948
      +949
      +950
      +951
      +952
      +953
       954
       955
      -956
      -957
      -958
      -959
      -960
      -961
      -962
      -963
      -964
      +956

      -
      # File 'mrbgems/mruby-io/src/io.c', line 954
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 946
       
       mrb_value
       mrb_io_closed(mrb_state *mrb, mrb_value io)
       {
         struct mrb_io *fptr;
      -  fptr = (struct mrb_io *)mrb_get_datatype(mrb, io, &mrb_io_type);
      +  fptr = (struct mrb_io *)mrb_data_get_ptr(mrb, io, &mrb_io_type);
         if (fptr == NULL || fptr->fd >= 0) {
           return mrb_false_value();
         }
      @@ -2036,7 +2046,7 @@ 

      - #each(&block) ⇒ Object + #each(&block) ⇒ Object @@ -2064,17 +2074,21 @@

       
       
      -301
      -302
      -303
      -304
       305
      -306
      +306 +307 +308 +309 +310 +311 +312

      -
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 301
      +      
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 305
       
       def each(&block)
      +  return to_enum unless block
      +
         while line = self.gets
           block.call(line)
         end
      @@ -2088,7 +2102,7 @@ 

      - #each_byte(&block) ⇒ Object + #each_byte(&block) ⇒ Object @@ -2116,17 +2130,21 @@

       
       
      -309
      -310
      -311
      -312
      -313
      -314
      +315 +316 +317 +318 +319 +320 +321 +322

      -
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 309
      +      
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 315
       
       def each_byte(&block)
      +  return to_enum(:each_byte) unless block
      +
         while char = self.getc
           block.call(char)
         end
      @@ -2197,8 +2215,8 @@ 

      def eof? _check_readable begin - buf = _read_buf - return buf.size == 0 + _read_buf + return @buf.empty? rescue EOFError return true end @@ -2211,7 +2229,7 @@

      - #filenoObject + #filenoObject @@ -2239,16 +2257,16 @@

       
       
      -1214
      -1215
      -1216
      -1217
      -1218
      -1219
      -1220
      +1206 +1207 +1208 +1209 +1210 +1211 +1212

      -
      # File 'mrbgems/mruby-io/src/io.c', line 1214
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 1206
       
       mrb_value
       mrb_io_fileno(mrb_state *mrb, mrb_value io)
      @@ -2265,7 +2283,7 @@ 

      - #flushObject + #flushObject @@ -2324,7 +2342,7 @@

      - #getcObject + #getcObject @@ -2336,16 +2354,16 @@

       
       
      -292
      -293
      -294
      -295
       296
       297
      -298
      +298 +299 +300 +301 +302

      -
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 292
      +      
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 296
       
       def getc
         begin
      @@ -2362,7 +2380,7 @@ 

      - #gets(*args) ⇒ Object + #gets(*args) ⇒ Object @@ -2374,16 +2392,16 @@

       
       
      -277
      -278
      -279
      -280
       281
       282
      -283
      +283 +284 +285 +286 +287

      -
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 277
      +      
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 281
       
       def gets(*args)
         begin
      @@ -2400,7 +2418,7 @@ 

      - #hashObject + #hashObject @@ -2434,7 +2452,7 @@

      - #initialize_copyObject + #initialize_copyObject @@ -2458,6 +2476,7 @@

       
       
      +563
       564
       565
       566
      @@ -2504,11 +2523,10 @@ 

      607 608 609 -610 -611

      +610

      -
      # File 'mrbgems/mruby-io/src/io.c', line 564
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 563
       
       mrb_value
       mrb_io_initialize_copy(mrb_state *mrb, mrb_value copy)
      @@ -2566,7 +2584,7 @@ 

      - #isattyObject + #isattyObject @@ -2582,6 +2600,7 @@

       
       
      +724
       725
       726
       727
      @@ -2590,11 +2609,10 @@ 

      730 731 732 -733 -734

      +733

      -
      # File 'mrbgems/mruby-io/src/io.c', line 725
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 724
       
       mrb_value
       mrb_io_isatty(mrb_state *mrb, mrb_value self)
      @@ -2614,7 +2632,7 @@ 

      - #pidObject + #pidObject @@ -2638,21 +2656,21 @@

       
       
      +958
      +959
      +960
      +961
      +962
      +963
      +964
      +965
       966
       967
       968
      -969
      -970
      -971
      -972
      -973
      -974
      -975
      -976
      -977
      +969

      -
      # File 'mrbgems/mruby-io/src/io.c', line 966
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 958
       
       mrb_value
       mrb_io_pid(mrb_state *mrb, mrb_value io)
      @@ -2674,7 +2692,7 @@ 

      - #posObject + #posObject @@ -2725,7 +2743,7 @@

      def pos raise IOError if closed? - sysseek(0, SEEK_CUR) - @buf.length + sysseek(0, SEEK_CUR) - @buf.bytesize end

      @@ -2735,7 +2753,7 @@

      - #pos=(i) ⇒ Object + #pos=(i) ⇒ Object @@ -2765,7 +2783,7 @@

      -
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 342
      +      
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 350
       
       def print(*args)
         i = 0
      @@ -2805,7 +2823,7 @@ 
      -
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 351
      +      
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 359
       
       def printf(*args)
         write sprintf(*args)
      @@ -2837,7 +2855,7 @@ 

      - #puts(*args) ⇒ Object + #puts(*args) ⇒ Object @@ -2849,21 +2867,21 @@

       
       
      -329
      -330
      -331
      -332
      -333
      -334
      -335
      -336
       337
       338
       339
      -340
      +340 +341 +342 +343 +344 +345 +346 +347 +348

      -
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 329
      +      
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 337
       
       def puts(*args)
         i = 0
      @@ -2885,7 +2903,7 @@ 

      - #read(length = nil, outbuf = "") ⇒ Object + #read(length = nil, outbuf = "") ⇒ Object @@ -2897,11 +2915,6 @@

       
       
      -187
      -188
      -189
      -190
      -191
       192
       193
       194
      @@ -2937,10 +2950,14 @@ 

      224 225 226 -227

      +227 +228 +229 +230 +231

      -
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 187
      +      
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 192
       
       def read(length = nil, outbuf = "")
         unless length.nil?
      @@ -2965,9 +2982,8 @@ 

      end if length - consume = (length <= @buf.size) ? length : @buf.size - array.push @buf[0, consume] - @buf = @buf[consume, @buf.size - consume] + consume = (length <= @buf.bytesize) ? length : @buf.bytesize + array.push IO._bufread(@buf, consume) length -= consume break if length == 0 else @@ -2991,7 +3007,7 @@

      - #readcharObject + #readcharObject @@ -3003,20 +3019,20 @@

       
       
      -285
      -286
      -287
      -288
       289
      -290
      +290 +291 +292 +293 +294

      -
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 285
      +      
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 289
       
       def readchar
         _read_buf
         c = @buf[0]
      -  @buf = @buf[1, @buf.size]
      +  @buf[0] = ""
         c
       end
      @@ -3027,7 +3043,7 @@

      - #readline(arg = $/, limit = nil) ⇒ Object + #readline(arg = "\n", limit = nil) ⇒ Object @@ -3039,10 +3055,6 @@

       
       
      -229
      -230
      -231
      -232
       233
       234
       235
      @@ -3085,17 +3097,21 @@ 

      272 273 274 -275

      +275 +276 +277 +278 +279

      -
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 229
      +      
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 233
       
      -def readline(arg = $/, limit = nil)
      +def readline(arg = "\n", limit = nil)
         case arg
         when String
           rs = arg
         when Fixnum
      -    rs = $/
      +    rs = "\n"
           limit = arg
         else
           raise ArgumentError
      @@ -3106,7 +3122,7 @@ 

      end if rs == "" - rs = $/ + $/ + rs = "\n\n" end array = [] @@ -3120,12 +3136,12 @@

      if limit && limit <= @buf.size array.push @buf[0, limit] - @buf = @buf[limit, @buf.size - limit] + @buf[0, limit] = "" break elsif idx = @buf.index(rs) len = idx + rs.size array.push @buf[0, len] - @buf = @buf[len, @buf.size - len] + @buf[0, len] = "" break else array.push @buf @@ -3145,7 +3161,7 @@

      - #readlinesObject + #readlinesObject @@ -3157,16 +3173,16 @@

       
       
      -321
      -322
      -323
      -324
      -325
      -326
      -327
      +329 +330 +331 +332 +333 +334 +335

      -
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 321
      +      
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 329
       
       def readlines
         ary = []
      @@ -3183,7 +3199,7 @@ 

      - #rewindObject + #rewindObject @@ -3213,7 +3229,7 @@

      - #seek(i, whence = SEEK_SET) ⇒ Object + #seek(i, whence = SEEK_SET) ⇒ Object @@ -3274,7 +3290,7 @@

      - #syncObject + #syncObject @@ -3286,16 +3302,16 @@

       
       
      -1294
      -1295
      -1296
      -1297
      -1298
      -1299
      -1300
      +1286 +1287 +1288 +1289 +1290 +1291 +1292

      -
      # File 'mrbgems/mruby-io/src/io.c', line 1294
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 1286
       
       mrb_value
       mrb_io_sync(mrb_state *mrb, mrb_value self)
      @@ -3312,7 +3328,7 @@ 

      - #sync=Object + #sync=Object @@ -3324,20 +3340,20 @@

       
       
      +1274
      +1275
      +1276
      +1277
      +1278
      +1279
      +1280
      +1281
       1282
       1283
      -1284
      -1285
      -1286
      -1287
      -1288
      -1289
      -1290
      -1291
      -1292
      +1284

      -
      # File 'mrbgems/mruby-io/src/io.c', line 1282
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 1274
       
       mrb_value
       mrb_io_set_sync(mrb_state *mrb, mrb_value self)
      @@ -3358,7 +3374,7 @@ 

      - #sysreadObject + #sysreadObject @@ -3370,6 +3386,10 @@

       
       
      +818
      +819
      +820
      +821
       822
       823
       824
      @@ -3416,14 +3436,10 @@ 

      865 866 867 -868 -869 -870 -871 -872

      +868

      -
      # File 'mrbgems/mruby-io/src/io.c', line 822
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 818
       
       mrb_value
       mrb_io_sysread(mrb_state *mrb, mrb_value io)
      @@ -3484,7 +3500,7 @@ 

      - #sysseekObject + #sysseekObject @@ -3496,6 +3512,10 @@

       
       
      +870
      +871
      +872
      +873
       874
       875
       876
      @@ -3518,14 +3538,10 @@ 

      893 894 895 -896 -897 -898 -899 -900

      +896

      -
      # File 'mrbgems/mruby-io/src/io.c', line 874
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 870
       
       mrb_value
       mrb_io_sysseek(mrb_state *mrb, mrb_value io)
      @@ -3562,7 +3578,7 @@ 

      - #syswriteObject + #syswriteObject @@ -3574,6 +3590,10 @@

       
       
      +898
      +899
      +900
      +901
       902
       903
       904
      @@ -3596,18 +3616,10 @@ 

      921 922 923 -924 -925 -926 -927 -928 -929 -930 -931 -932

      +924

      -
      # File 'mrbgems/mruby-io/src/io.c', line 902
      +      
      # File 'mrbgems/mruby-io/src/io.c', line 898
       
       mrb_value
       mrb_io_syswrite(mrb_state *mrb, mrb_value io)
      @@ -3622,11 +3634,7 @@ 

      } mrb_get_args(mrb, "S", &str); - if (mrb_type(str) != MRB_TT_STRING) { - buf = mrb_funcall(mrb, str, "to_s", 0); - } else { - buf = str; - } + buf = str; if (fptr->fd2 == -1) { fd = fptr->fd; @@ -3648,7 +3656,7 @@

      - #ungetc(substr) ⇒ Object + #ungetc(substr) ⇒ Object @@ -3660,18 +3668,18 @@

       
       
      -177
      -178
      -179
      -180
      -181
       182
       183
       184
      -185
      +185 +186 +187 +188 +189 +190

      -
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 177
      +      
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 182
       
       def ungetc(substr)
         raise TypeError.new "expect String, got #{substr.class}" unless substr.is_a?(String)
      @@ -3690,7 +3698,7 @@ 

      - #write(string) ⇒ Object + #write(string) ⇒ Object @@ -3718,8 +3726,8 @@

      def write(string) str = string.is_a?(String) ? string : string.to_s - return str.size unless str.size > 0 - if 0 < @buf.length + return 0 if str.empty? + unless @buf.empty? # reset real pos ignore buf seek(pos, SEEK_SET) end @@ -3736,9 +3744,9 @@

      diff --git a/docs/api/IOError.html b/docs/api/IOError.html index a45f331..bc9d354 100644 --- a/docs/api/IOError.html +++ b/docs/api/IOError.html @@ -6,7 +6,7 @@ Exception: IOError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ StandardError
        -
      • Object
      • +
      • Object
      • @@ -158,9 +158,9 @@

        Constructor Details

        diff --git a/docs/api/IPSocket.html b/docs/api/IPSocket.html index dc38e9b..625be9b 100644 --- a/docs/api/IPSocket.html +++ b/docs/api/IPSocket.html @@ -6,7 +6,7 @@ Class: IPSocket - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ BasicSocket
          -
        • Object
        • +
        • Object
        • @@ -280,7 +280,7 @@

          Class Method Details

          - .getaddress(host) ⇒ Object + .getaddress(host) ⇒ Object @@ -316,7 +316,7 @@

          Instance Method Details

          - #addrObject + #addrObject @@ -346,7 +346,7 @@

          - #peeraddrObject + #peeraddrObject @@ -376,7 +376,7 @@

          - #recvfrom(maxlen, flags = 0) ⇒ Object + #recvfrom(maxlen, flags = 0) ⇒ Object @@ -400,7 +400,6 @@

           
           
          -557
           558
           559
           560
          @@ -426,10 +425,11 @@ 

          580 581 582 -583

          +583 +584

      -
      # File 'mrbgems/mruby-socket/src/socket.c', line 557
      +      
      # File 'mrbgems/mruby-socket/src/socket.c', line 558
       
       static mrb_value
       mrb_ipsocket_recvfrom(mrb_state *mrb, mrb_value self)
      @@ -468,9 +468,9 @@ 

      diff --git a/docs/api/IndexError.html b/docs/api/IndexError.html index d4d530a..b9c9847 100644 --- a/docs/api/IndexError.html +++ b/docs/api/IndexError.html @@ -6,7 +6,7 @@ Exception: IndexError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ StandardError

      -
      # File 'src/numeric.c', line 777
      +      
      # File 'src/numeric.c', line 783
       
       static mrb_value
       int_to_i(mrb_state *mrb, mrb_value num)
      @@ -332,7 +332,7 @@ 

      - #floorObject + #floorObject @@ -362,14 +362,14 @@

       
       
      -777
      -778
      -779
      -780
      -781
      +783 +784 +785 +786 +787

      -
      # File 'src/numeric.c', line 777
      +      
      # File 'src/numeric.c', line 783
       
       static mrb_value
       int_to_i(mrb_state *mrb, mrb_value num)
      @@ -436,14 +436,14 @@ 

       
       
      -777
      -778
      -779
      -780
      -781
      +783 +784 +785 +786 +787

      -
      # File 'src/numeric.c', line 777
      +      
      # File 'src/numeric.c', line 783
       
       static mrb_value
       int_to_i(mrb_state *mrb, mrb_value num)
      @@ -510,14 +510,14 @@ 

       
       
      -777
      -778
      -779
      -780
      -781
      +783 +784 +785 +786 +787

      -
      # File 'src/numeric.c', line 777
      +      
      # File 'src/numeric.c', line 783
       
       static mrb_value
       int_to_i(mrb_state *mrb, mrb_value num)
      @@ -534,9 +534,9 @@ 

      diff --git a/docs/api/Integral.html b/docs/api/Integral.html index 4685f92..1890d87 100644 --- a/docs/api/Integral.html +++ b/docs/api/Integral.html @@ -6,7 +6,7 @@ Module: Integral - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -88,7 +88,7 @@
      Defined in:
      mrblib/numeric.rb,
      - src/numeric.c,
      mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb
      + src/numeric.c
      @@ -127,7 +127,7 @@

    1512. - #div(other) ⇒ Object + #**(other) ⇒ Numeric @@ -141,7 +141,7 @@

      -
      +

      Raises num the other power.

    1513. @@ -150,7 +150,7 @@

    1514. - #downto(num, &block) ⇒ Object + #quo(numeric) ⇒ Object @@ -164,7 +164,30 @@

      -

      Calls the given block once for each Integer from +self+ downto +num+.

      +

      Returns most exact division.

      +
      + +

    1515. + + +
    1516. + + + #< ⇒ Object + + + + + + + + + + + + + +

      15.2.8,9.3.1.

    1517. @@ -173,7 +196,7 @@

    1518. - #negative? ⇒ Boolean + #<= ⇒ Object @@ -196,11 +219,34 @@

    1519. - #next ⇒ Object + #<=> ⇒ Object - (also: #succ) + + + + + + + + + + +
      +

      => +1 Comparison—Returns -1, 0, or +1 depending on whether fix is less than, equal to, or greater than numeric.

      +
      +
      + +
    1520. + + +
    1521. + + + #> ⇒ Object + + @@ -212,7 +258,7 @@

      -

      Returns self + 1.

      +

    1522. @@ -221,7 +267,7 @@

    1523. - #nonzero? ⇒ Boolean + #>= ⇒ Object @@ -244,7 +290,7 @@

    1524. - #positive? ⇒ Boolean + #__coerce_step_counter ⇒ Object @@ -261,6 +307,100 @@

      +

    1525. + + +
    1526. + + + #div ⇒ Object + + + + + + + + + + + + + +

      15.2.7.4.5 (x).

      +
      + +
    1527. + + +
    1528. + + + #downto(num, &block) ⇒ Object + + + + + + + + + + + + + +

      Calls the given block once for each Integer from +self+ downto +num+.

      +
      + +
    1529. + + +
    1530. + + + #next ⇒ Object + + + + (also: #succ) + + + + + + + + + + + +

      Returns self + 1.

      +
      + +
    1531. + + +
    1532. + + + #quo(numeric) ⇒ Object + + + + + + + + + + + + + +

      Returns most exact division.

      +
      +
    1533. @@ -333,42 +473,494 @@

    1534. -
    1535. - + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #**(other) ⇒ Numeric + + + + + +

      +
      +

      Raises num the other power.

      + +

      2.0**3 #=> 8.0

      + + +
      +
      +
      + +
      +
      + + + +
      +
      +
      + +

      Returns:

      + + +
      + + + + +
      + + + + + + +
      +
      +
      +
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +108
      +109
      +110
      +111
      +112
      +113
      +
      +
      # File 'src/numeric.c', line 67
      +
      +static mrb_value
      +integral_pow(mrb_state *mrb, mrb_value x)
      +{
      +  mrb_value y;
      +#ifndef MRB_WITHOUT_FLOAT
      +  mrb_float d;
      +#endif
      +
      +  mrb_get_args(mrb, "o", &y);
      +  if (mrb_fixnum_p(x) && mrb_fixnum_p(y)) {
      +    /* try ipow() */
      +    mrb_int base = mrb_fixnum(x);
      +    mrb_int exp = mrb_fixnum(y);
      +    mrb_int result = 1;
      +
      +    if (exp < 0)
      +#ifdef MRB_WITHOUT_FLOAT
      +      return mrb_fixnum_value(0);
      +#else
      +      goto float_pow;
      +#endif
      +    for (;;) {
      +      if (exp & 1) {
      +        if (mrb_int_mul_overflow(result, base, &result)) {
      +#ifndef MRB_WITHOUT_FLOAT
      +          goto float_pow;
      +#endif
      +        }
      +      }
      +      exp >>= 1;
      +      if (exp == 0) break;
      +      if (mrb_int_mul_overflow(base, base, &base)) {
      +#ifndef MRB_WITHOUT_FLOAT
      +        goto float_pow;
      +#endif
      +      }
      +    }
      +    return mrb_fixnum_value(result);
      +  }
      +#ifdef MRB_WITHOUT_FLOAT
      +  mrb_raise(mrb, E_TYPE_ERROR, "non fixnum value");
      +#else
      + float_pow:
      +  d = pow(mrb_to_flo(mrb, x), mrb_to_flo(mrb, y));
      +  return mrb_float_value(mrb, d);
      +#endif
      +}
      +
      +
      + +
      +

      + + #quo(numeric) ⇒ Object + + + + + +

      +
      +

      Returns most exact division.

      + + +
      +
      +
      + + + + +
      + + + + + + +
      +
      +
      +
      +153
      +154
      +155
      +156
      +157
      +158
      +159
      +160
      +161
      +162
      +163
      +164
      +165
      +166
      +167
      +168
      +169
      +170
      +
      +
      # File 'src/numeric.c', line 153
      +
      +static mrb_value
      +integral_div(mrb_state *mrb, mrb_value x)
      +{
      +#ifdef MRB_WITHOUT_FLOAT
      +  mrb_value y;
      +
      +  mrb_get_args(mrb, "o", &y);
      +  if (!mrb_fixnum_p(y)) {
      +    mrb_raise(mrb, E_TYPE_ERROR, "non fixnum value");
      +  }
      +  return mrb_fixnum_value(mrb_fixnum(x) / mrb_fixnum(y));
      +#else
      +  mrb_float y;
      +
      +  mrb_get_args(mrb, "f", &y);
      +  return mrb_float_value(mrb, mrb_to_flo(mrb, x) / y);
      +#endif
      +}
      +
      +
      + +
      +

      + + #<Object + + + + + +

      +
      +

      15.2.8,9.3.1

      + + +
      +
      +
      + + +
      + + + + + + +
      +
      +
      +
      +1503
      +1504
      +1505
      +1506
      +1507
      +1508
      +1509
      +1510
      +1511
      +1512
      +1513
      +1514
      +
      +
      # File 'src/numeric.c', line 1503
      +
      +static mrb_value
      +integral_lt(mrb_state *mrb, mrb_value self)
      +{
      +  mrb_value other;
      +  mrb_int n;
      +
      +  mrb_get_args(mrb, "o", &other);
      +  n = cmpnum(mrb, self, other);
      +  if (n == -2) cmperr(mrb, self, other);
      +  if (n < 0) return mrb_true_value();
      +  return mrb_false_value();
      +}
      +
      +
      + +
      +

      + + #<=Object + + + + + +

      + + + + +
      +
      +
      +
      +1516
      +1517
      +1518
      +1519
      +1520
      +1521
      +1522
      +1523
      +1524
      +1525
      +1526
      +1527
      +
      +
      # File 'src/numeric.c', line 1516
      +
      +static mrb_value
      +integral_le(mrb_state *mrb, mrb_value self)
      +{
      +  mrb_value other;
      +  mrb_int n;
      +
      +  mrb_get_args(mrb, "o", &other);
      +  n = cmpnum(mrb, self, other);
      +  if (n == -2) cmperr(mrb, self, other);
      +  if (n <= 0) return mrb_true_value();
      +  return mrb_false_value();
      +}
      +
      +
      + +
      +

      + + + #<=>(other.f) ⇒ -1, ... + + #<-1 + + + + + + +

      +
      +
      +

      => +1 + Comparison—Returns -1, 0, or +1 depending on whether fix is + less than, equal to, or greater than numeric. This is the + basis for the tests in Comparable.

      +
      + + +
      +
      +
      + +

      Overloads:

      +
        + + +
      • + #<=>(other.f) ⇒ -1, ... +
        +
        + + + +
        +
        +
        + +

        Returns:

        +
          + +
        • + + + (-1, 0, +1) + + + +
        • + +
        + +
        + + +
      • - #zero? ⇒ Boolean + +
      • + #<-1 +
        +
        - - - - - - - - - +
        +
        +
        -
        -
        +

        Returns:

        +
          - - +
        • -
        + + (-1) + + + +
      • +
      +
      + +
    1536. + + -
      -

      Instance Method Details

      +
      + + + + + + +
      +
      +
      +
      +1485
      +1486
      +1487
      +1488
      +1489
      +1490
      +1491
      +1492
      +1493
      +1494
      +1495
      +
      +
      # File 'src/numeric.c', line 1485
      +
      +static mrb_value
      +integral_cmp(mrb_state *mrb, mrb_value self)
      +{
      +  mrb_value other;
      +  mrb_int n;
      +
      +  mrb_get_args(mrb, "o", &other);
      +  n = cmpnum(mrb, self, other);
      +  if (n == -2) return mrb_nil_value();
      +  return mrb_fixnum_value(n);
      +}
      +
      + -
      -

      +
      +

      - #div(other) ⇒ Object + #>Object @@ -380,84 +972,145 @@

       
       
      -2
      -3
      -4
      +1529 +1530 +1531 +1532 +1533 +1534 +1535 +1536 +1537 +1538 +1539 +1540

    1537. -
      # File 'mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb', line 2
      -
      -def div(other)
      -  self.divmod(other)[0]
      -end
      +
      # File 'src/numeric.c', line 1529
      +
      +static mrb_value
      +integral_gt(mrb_state *mrb, mrb_value self)
      +{
      +  mrb_value other;
      +  mrb_int n;
      +
      +  mrb_get_args(mrb, "o", &other);
      +  n = cmpnum(mrb, self, other);
      +  if (n == -2) cmperr(mrb, self, other);
      +  if (n > 0) return mrb_true_value();
      +  return mrb_false_value();
      +}
      -

      +

      - #downto(num, &block) ⇒ Object + #>=Object -

      -
      -

      Calls the given block once for each Integer -from +self+ downto +num+.

      - -

      ISO 15.2.8.3.15

      +

      + + + + +
      +
       
       
      -  
      +1542
      +1543
      +1544
      +1545
      +1546
      +1547
      +1548
      +1549
      +1550
      +1551
      +1552
      +1553
      +
      +
      # File 'src/numeric.c', line 1542
      +
      +static mrb_value
      +integral_ge(mrb_state *mrb, mrb_value self)
      +{
      +  mrb_value other;
      +  mrb_int n;
      +
      +  mrb_get_args(mrb, "o", &other);
      +  n = cmpnum(mrb, self, other);
      +  if (n == -2) cmperr(mrb, self, other);
      +  if (n >= 0) return mrb_true_value();
      +  return mrb_false_value();
      +}
      +
      -
      + +
      +

      + + #__coerce_step_counterObject -

      - - + + + +
       
       
      -47
      -48
      -49
      -50
      -51
      -52
      -53
      -54
      -55
      -56
      +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186
      -
      # File 'mrblib/numeric.rb', line 47
      +      
      # File 'src/numeric.c', line 172
       
      -def downto(num, &block)
      -  return to_enum(:downto, num) unless block
      +static mrb_value
      +integral_coerce_step_counter(mrb_state *mrb, mrb_value self)
      +{
      +  mrb_value num, step;
       
      -  i = self.to_i
      -  while i >= num
      -    block.call(i)
      -    i -= 1
      -  end
      -  self
      -end
      + mrb_get_args(mrb, "oo", &num, &step); + +#ifndef MRB_WITHOUT_FLOAT + if (mrb_float_p(self) || mrb_float_p(num) || mrb_float_p(step)) { + return mrb_Float(mrb, self); + } +#endif + + return self; +}
      -

      +

      - #negative?Boolean + #divObject @@ -465,26 +1118,13 @@

      - +

      15.2.7.4.5 (x)

      -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      @@ -494,39 +1134,66 @@

       
       
      -22
      -23
      -24
      +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132

      -
      # File 'mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb', line 22
      -
      -def negative?
      -  self < 0
      -end
      +
      # File 'src/numeric.c', line 115
      +
      +static mrb_value
      +integral_idiv(mrb_state *mrb, mrb_value x)
      +{
      +#ifdef MRB_WITHOUT_FLOAT
      +  mrb_value y;
      +
      +  mrb_get_args(mrb, "o", &y);
      +  if (!mrb_fixnum_p(y)) {
      +    mrb_raise(mrb, E_TYPE_ERROR, "non fixnum value");
      +  }
      +  return mrb_fixnum_value(mrb_fixnum(x) / mrb_fixnum(y));
      +#else
      +  mrb_float y;
      +
      +  mrb_get_args(mrb, "f", &y);
      +  return mrb_int_value(mrb, mrb_to_flo(mrb, x) / y);
      +#endif
      +}
      -

      +

      - #nextObject + #downto(num, &block) ⇒ Object - Also known as: - succ - -

      -

      Returns self + 1

      +

      Calls the given block once for each Integer +from +self+ downto +num+.

      -

      ISO 15.2.8.3.19

      +

      ISO 15.2.8.3.15

      @@ -542,15 +1209,29 @@

       
       
      -62
      -63
      -64
      +47 +48 +49 +50 +51 +52 +53 +54 +55 +56

      -
      # File 'mrblib/numeric.rb', line 62
      +      
      # File 'mrblib/numeric.rb', line 47
       
      -def next
      -  self + 1
      +def downto(num, &block)
      +  return to_enum(:downto, num) unless block
      +
      +  i = self.to_i
      +  while i >= num
      +    block.call(i)
      +    i -= 1
      +  end
      +  self
       end
      @@ -558,36 +1239,29 @@

      -

      +

      - #nonzero?Boolean + #nextObject + Also known as: + succ + +

      - +

      Returns self + 1

      + +

      ISO 15.2.8.3.19

      -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      @@ -597,23 +1271,15 @@

       
       
      -10
      -11
      -12
      -13
      -14
      -15
      -16
      +62 +63 +64

      -
      # File 'mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb', line 10
      +      
      # File 'mrblib/numeric.rb', line 62
       
      -def nonzero?
      -  if self == 0
      -    nil
      -  else
      -    self
      -  end
      +def next
      +  self + 1
       end
      @@ -621,9 +1287,9 @@

      -

      +

      - #positive?Boolean + #quo(numeric) ⇒ Object @@ -631,26 +1297,15 @@

      - +

      Returns most exact division.

      -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • -
      +
      @@ -660,16 +1315,46 @@

       
       
      -18
      -19
      -20
      +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170

      -
      # File 'mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb', line 18
      -
      -def positive?
      -  self > 0
      -end
      +
      # File 'src/numeric.c', line 153
      +
      +static mrb_value
      +integral_div(mrb_state *mrb, mrb_value x)
      +{
      +#ifdef MRB_WITHOUT_FLOAT
      +  mrb_value y;
      +
      +  mrb_get_args(mrb, "o", &y);
      +  if (!mrb_fixnum_p(y)) {
      +    mrb_raise(mrb, E_TYPE_ERROR, "non fixnum value");
      +  }
      +  return mrb_fixnum_value(mrb_fixnum(x) / mrb_fixnum(y));
      +#else
      +  mrb_float y;
      +
      +  mrb_get_args(mrb, "f", &y);
      +  return mrb_float_value(mrb, mrb_to_flo(mrb, x) / y);
      +#endif
      +}
      @@ -678,7 +1363,7 @@

      - #step(num = nil, step = 1, &block) ⇒ Object + #step(num = nil, step = 1, &block) ⇒ Object @@ -750,14 +1435,14 @@

      return to_enum(:step, num, step) unless block i = __coerce_step_counter(num, step) - if num == nil + if num == self || step.infinite? + block.call(i) if step > 0 && i <= (num||i) || step < 0 && i >= (num||-i) + elsif num == nil while true block.call(i) i += step end - return self - end - if step > 0 + elsif step > 0 while i <= num block.call(i) i += step @@ -778,7 +1463,7 @@

      - #times(&block) ⇒ Object + #times(&block) ⇒ Object @@ -836,7 +1521,7 @@

      - #upto(num, &block) ⇒ Object + #upto(num, &block) ⇒ Object @@ -890,61 +1575,6 @@

      -

      - -
      -

      - - #zero?Boolean - - - - - -

      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - - - - - -
      -
      -
      -
      -6
      -7
      -8
      -
      -
      # File 'mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb', line 6
      -
      -def zero?
      -  self == 0
      -end
      -

      @@ -952,9 +1582,9 @@

      diff --git a/docs/api/Kernel.html b/docs/api/Kernel.html index bb0b872..385885d 100644 --- a/docs/api/Kernel.html +++ b/docs/api/Kernel.html @@ -6,7 +6,7 @@ Module: Kernel - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -83,7 +83,7 @@
      Defined in:
      mrblib/kernel.rb,
      - src/kernel.c,
      mrbgems/mruby-sprintf/src/kernel.c,
      mrbgems/mruby-io/mrblib/io.rb,
      mrbgems/mruby-io/mrblib/kernel.rb,
      mrbgems/mruby-print/mrblib/print.rb,
      mrbgems/mruby-method/mrblib/kernel.rb,
      mrbgems/mruby-kernel-ext/mrblib/kernel.rb,
      mrbgems/mruby-enumerator/mrblib/enumerator.rb
      + src/kernel.c,
      mrbgems/mruby-sprintf/src/kernel.c,
      mrbgems/mruby-io/mrblib/kernel.rb,
      mrbgems/mruby-print/mrblib/print.rb,
      mrbgems/mruby-method/mrblib/kernel.rb,
      mrbgems/mruby-object-ext/mrblib/object.rb,
      mrbgems/mruby-rational/mrblib/rational.rb,
      mrbgems/mruby-enumerator/mrblib/enumerator.rb
      @@ -253,29 +253,6 @@

      Converts arg to a Fixnum.

      - - - -
    1538. - - - .itself ⇒ Object - - - - - - - - - - - - - -

      Returns obj.

      -
      -
    1539. @@ -475,7 +452,7 @@

    1540. - #_inspect ⇒ Object + #_inspect(_recur_list) ⇒ Object @@ -650,29 +627,6 @@

      -

      Equality—At the Object level, == returns true only if obj and other are the same object.

      -
      - -

    1541. - - -
    1542. - - - #equal? ⇒ Object - - - - - - - - - - - - -

      Equality—At the Object level, == returns true only if obj and other are the same object.

      @@ -765,29 +719,6 @@

      -
      -
      - -

    1543. - - -
    1544. - - - #getc(*args) ⇒ Object - - - - - - - - - - - - -
      @@ -1435,6 +1366,29 @@

      With no arguments, raises a RuntimeError With a single +String+ argument, raises a +RuntimeError+ with the string as a message.

      +

    1545. + + +
    1546. + + + #Rational(numerator, denominator = 1) ⇒ Object + + + + + + + + + + + + + +
      +
      +
    1547. @@ -1524,7 +1478,7 @@

      -

      15.3.1.3.28.

      +

      15.3.1.3.28 (15.3.1.2.7).

      @@ -1602,12 +1556,10 @@

    1548. - #to_enum(meth = :each, *args) ⇒ Object + #tap {|_self| ... } ⇒ Object - (also: #enum_for) - @@ -1621,14 +1573,38 @@

      - - - + +
      call-seq: obj.to_enum(method = :each, *args) -> enum obj.enum_for(method = :each, *args) -> enum obj.to_enum(method = :each, *args) *argsblock -> enum obj.enum_for(method = :each, *args) *argsblock -> enum.call-seq: obj.tap x… -> obj.
      +

    1549. + + +
    1550. + + + #to_enum(meth = :each, *args) ⇒ Object + + + + (also: #enum_for) + + + + + + + + + + + +

      call-seq: obj.to_enum(method = :each, *args) -> enum obj.enum_for(method = :each, *args) -> enum.

      +
      +
    1551. @@ -1701,7 +1677,7 @@

      Dynamic Method Handling

      - #method_missingObject + #method_missingObject @@ -1725,21 +1701,21 @@

       
       
      -720
      -721
      -722
      -723
      -724
      -725
      -726
      -727
      -728
      -729
      -730
      -731
      +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700

      -
      # File 'src/kernel.c', line 720
      +      
      # File 'src/kernel.c', line 689
       
       static mrb_value
       mrb_obj_missing(mrb_state *mrb, mrb_value mod)
      @@ -1821,6 +1797,7 @@ 

       
       
      +168
       169
       170
       171
      @@ -1832,11 +1809,10 @@ 

      177 178 179 -180 -181

      +180

      -
      # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 169
      +      
      # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 168
       
       static mrb_value
       mrb_f_array(mrb_state *mrb, mrb_value self)
      @@ -1859,7 +1835,7 @@ 

      - .callerObject + .callerObject @@ -1925,8 +1901,7 @@

      58 59 60 -61 -62

      +61
      # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 7
      @@ -1947,9 +1922,9 @@ 

      n = bt_len - lev; break; case 1: - if (mrb_type(v) == MRB_TT_RANGE) { + if (mrb_range_p(v)) { mrb_int beg, len; - if (mrb_range_beg_len(mrb, v, &beg, &len, bt_len, TRUE) == 1) { + if (mrb_range_beg_len(mrb, v, &beg, &len, bt_len, TRUE) == MRB_RANGE_OK) { lev = beg; n = len; } @@ -1958,22 +1933,21 @@

      } } else { - v = mrb_to_int(mrb, v); - lev = mrb_fixnum(v); + lev = mrb_int(mrb, v); if (lev < 0) { - mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative level (%S)", v); + mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative level (%v)", v); } n = bt_len - lev; } break; case 2: - lev = mrb_fixnum(mrb_to_int(mrb, v)); - n = mrb_fixnum(mrb_to_int(mrb, length)); + lev = mrb_int(mrb, v); + n = mrb_int(mrb, length); if (lev < 0) { - mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative level (%S)", v); + mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative level (%v)", v); } if (n < 0) { - mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative size (%S)", length); + mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative size (%v)", length); } break; default: @@ -1996,11 +1970,11 @@

      - .raiseObject + .raiseObject - .raise(string) ⇒ Object + .raise(string) ⇒ Object - .raise(exception[, string]) ⇒ Object + .raise(exception[, string]) ⇒ Object @@ -2036,35 +2010,35 @@

       
       
      -616
      -617
      -618
      -619
      -620
      -621
      -622
      -623
      -624
      -625
      -626
      -627
      -628
      -629
      -630
      -631
      -632
      -633
      -634
      -635
      -636
      -637
      -638
      -639
      -640
      -641
      +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610

      -
      # File 'src/kernel.c', line 616
      +      
      # File 'src/kernel.c', line 585
       
       MRB_API mrb_value
       mrb_f_raise(mrb_state *mrb, mrb_value self)
      @@ -2157,17 +2131,17 @@ 

       
       
      +128
       129
       130
       131
       132
       133
       134
      -135
      -136
      +135

      -
      # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 129
      +      
      # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 128
       
       static mrb_value
       mrb_f_float(mrb_state *mrb, mrb_value self)
      @@ -2244,6 +2218,7 @@ 

       
       
      +196
       197
       198
       199
      @@ -2253,11 +2228,10 @@ 

      203 204 205 -206 -207

      +206

      -
      # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 197
      +      
      # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 196
       
       static mrb_value
       mrb_f_hash(mrb_state *mrb, mrb_value self)
      @@ -2345,6 +2319,7 @@ 

       
       
      +105
       106
       107
       108
      @@ -2352,11 +2327,10 @@ 

      110 111 112 -113 -114

      +113

      -
      # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 106
      +      
      # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 105
       
       static mrb_value
       mrb_f_integer(mrb_state *mrb, mrb_value self)
      @@ -2370,83 +2344,6 @@ 

      - - -
      -

      - - .itselfObject - - - - - -

      -
      -

      Returns obj.

      - -
      string = 'my string' #=> "my string"
      -string.itself.object_id == string.object_id #=> true
      -
      - - -
      -
      -
      - -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object) - - - -
      • - -
      - -
      - - - - -
      - - - - - - -
      -
      -
      -
      -219
      -220
      -221
      -222
      -223
      -
      -
      # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 219
      -
      -static mrb_value
      -mrb_f_itself(mrb_state *mrb, mrb_value self)
      -{
      -  return self;
      -}
      -
      @@ -2508,6 +2405,7 @@

       
       
      +149
       150
       151
       152
      @@ -2515,11 +2413,10 @@ 

      154 155 156 -157 -158

      +157

      -
      # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 150
      +      
      # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 149
       
       static mrb_value
       mrb_f_string(mrb_state *mrb, mrb_value self)
      @@ -2544,7 +2441,7 @@ 

      Instance Method Details

      - #!~(y) ⇒ Object + #!~(y) ⇒ Object @@ -2667,7 +2564,7 @@

      - #__case_eqqObject + #__case_eqqObject @@ -2691,25 +2588,25 @@

       
       
      -777
      -778
      -779
      -780
      -781
      -782
      -783
      -784
      -785
      -786
      -787
      -788
      -789
      -790
      -791
      -792
      +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761

      -
      # File 'src/kernel.c', line 777
      +      
      # File 'src/kernel.c', line 746
       
       static mrb_value
       mrb_obj_ceqq(mrb_state *mrb, mrb_value self)
      @@ -2735,7 +2632,7 @@ 

      - #__method__Object + #__method__Object @@ -2763,6 +2660,7 @@

       
       
      +72
       73
       74
       75
      @@ -2771,11 +2669,10 @@ 

      78 79 80 -81 -82

      +81

      -
      # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 73
      +      
      # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 72
       
       static mrb_value
       mrb_f_method(mrb_state *mrb, mrb_value self)
      @@ -2795,7 +2692,7 @@ 

      - #__printstr__Object + #__printstr__Object @@ -2851,7 +2748,7 @@

      - #__to_intObject + #__to_intObject @@ -2875,7 +2772,7 @@

      - #__to_strObject + #__to_strObject @@ -2899,7 +2796,7 @@

      - #_inspectObject + #_inspect(_recur_list) ⇒ Object @@ -2930,7 +2827,7 @@

      # File 'mrblib/kernel.rb', line 43
       
      -def _inspect
      +def _inspect(_recur_list)
         self.inspect
       end
      @@ -2941,7 +2838,7 @@

      - #`(cmd) ⇒ Object + #`(cmd) ⇒ Object @@ -3304,7 +3201,7 @@

      - #cloneObject + #cloneObject @@ -3353,7 +3250,7 @@

    1552. - (Object) + (Object) @@ -3406,9 +3303,9 @@

      mrb_value clone; if (mrb_immediate_p(self)) { - mrb_raisef(mrb, E_TYPE_ERROR, "can't clone %S", self); + mrb_raisef(mrb, E_TYPE_ERROR, "can't clone %v", self); } - if (mrb_type(self) == MRB_TT_SCLASS) { + if (mrb_sclass_p(self)) { mrb_raise(mrb, E_TYPE_ERROR, "can't clone singleton class"); } p = (struct RObject*)mrb_obj_alloc(mrb, mrb_type(self), mrb_obj_class(mrb, self)); @@ -3428,7 +3325,7 @@

      - #define_singleton_methodObject + #define_singleton_methodObject @@ -3452,7 +3349,6 @@

       
       
      -383
       384
       385
       386
      @@ -3468,12 +3364,10 @@ 

      396 397 398 -399 -400 -401

      +399

    1553. -
      # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 383
      +      
      # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 384
       
       static mrb_value
       mod_define_singleton_method(mrb_state *mrb, mrb_value self)
      @@ -3483,10 +3377,7 @@ 

      mrb_sym mid; mrb_value blk = mrb_nil_value(); - mrb_get_args(mrb, "n&", &mid, &blk); - if (mrb_nil_p(blk)) { - mrb_raise(mrb, E_ARGUMENT_ERROR, "no block given"); - } + mrb_get_args(mrb, "n&!", &mid, &blk); p = (struct RProc*)mrb_obj_alloc(mrb, MRB_TT_PROC, mrb->proc_class); mrb_proc_copy(p, mrb_proc_ptr(blk)); p->flags |= MRB_PROC_STRICT; @@ -3502,7 +3393,7 @@

      - #dupObject + #dupObject @@ -3543,7 +3434,7 @@

    1554. - (Object) + (Object) @@ -3593,9 +3484,9 @@

      mrb_value dup; if (mrb_immediate_p(obj)) { - mrb_raisef(mrb, E_TYPE_ERROR, "can't dup %S", obj); + mrb_raisef(mrb, E_TYPE_ERROR, "can't dup %v", obj); } - if (mrb_type(obj) == MRB_TT_SCLASS) { + if (mrb_sclass_p(obj)) { mrb_raise(mrb, E_TYPE_ERROR, "can't dup singleton class"); } p = mrb_obj_alloc(mrb, mrb_type(obj), mrb_obj_class(mrb, obj)); @@ -3760,17 +3651,17 @@

       
       
      -1636
      -1637
      -1638
      -1639
      -1640
      -1641
      -1642
      -1643
      +1670 +1671 +1672 +1673 +1674 +1675 +1676 +1677

    1555. -
      # File 'src/class.c', line 1636
      +      
      # File 'src/class.c', line 1670
       
       mrb_value
       mrb_obj_equal_m(mrb_state *mrb, mrb_value self)
      @@ -3786,185 +3677,9 @@ 

      -

      +

      - - #==(other) ⇒ Boolean - - #equal?(other) ⇒ Boolean - - #eql?(other) ⇒ Boolean - - - - - - -

      -
      -

      Equality—At the Object level, == returns -true only if obj and other are the -same object. Typically, this method is overridden in descendant -classes to provide class-specific meaning.

      - -

      Unlike ==, the equal? method should never be -overridden by subclasses: it is used to determine object identity -(that is, a.equal?(b) iff a is the same -object as b).

      - -

      The eql? method returns true if -obj and anObject have the same value. Used by -Hash to test members for equality. For objects of -class Object, eql? is synonymous with -==. Subclasses normally continue this tradition, but -there are exceptions. Numeric types, for example, -perform type conversion across ==, but not across -eql?, so:

      - -

      1 == 1.0 #=> true - 1.eql? 1.0 #=> false

      - - -
      -
      -
      - -

      Overloads:

      -
        - - -
      • - #==(other) ⇒ Boolean -
        -
        - - - -
        -
        -
        - -

        Returns:

        -
          - -
        • - - - (Boolean) - - - -
        • - -
        - -
        - - -
      • - - -
      • - #equal?(other) ⇒ Boolean -
        -
        - - - -
        -
        -
        - -

        Returns:

        -
          - -
        • - - - (Boolean) - - - -
        • - -
        - -
        - - -
      • - - -
      • - #eql?(other) ⇒ Boolean -
        -
        - - - -
        -
        -
        - -

        Returns:

        -
          - -
        • - - - (Boolean) - - - -
        • - -
        - -
        - - -
      • - -
      - - -
      - - - - - - -
      -
      -
      -
      -1636
      -1637
      -1638
      -1639
      -1640
      -1641
      -1642
      -1643
      -
      -
      # File 'src/class.c', line 1636
      -
      -mrb_value
      -mrb_obj_equal_m(mrb_state *mrb, mrb_value self)
      -{
      -  mrb_value arg;
      -
      -  mrb_get_args(mrb, "o", &arg);
      -  return mrb_bool_value(mrb_obj_equal(mrb, self, arg));
      -}
      -
      -
      - -
      -

      - - #extendObject + #extendObject @@ -4012,7 +3727,7 @@

    1556. - (Object) + (Object) @@ -4063,7 +3778,7 @@

      - #formatObject + #formatObject @@ -4101,7 +3816,7 @@

      - #freezeObject + #freezeObject @@ -4136,44 +3851,20 @@

      442 443 444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457

    1557. +445
      # File 'src/kernel.c', line 434
       
      -static mrb_value
      +MRB_API mrb_value
       mrb_obj_freeze(mrb_state *mrb, mrb_value self)
       {
      -  struct RBasic *b;
      -
      -  switch (mrb_type(self)) {
      -    case MRB_TT_FALSE:
      -    case MRB_TT_TRUE:
      -    case MRB_TT_FIXNUM:
      -    case MRB_TT_SYMBOL:
      -#ifndef MRB_WITHOUT_FLOAT
      -    case MRB_TT_FLOAT:
      -#endif
      -      return self;
      -    default:
      -      break;
      -  }
      -
      -  b = mrb_basic_ptr(self);
      -  if (!MRB_FROZEN_P(b)) {
      -    MRB_SET_FROZEN_FLAG(b);
      +  if (!mrb_immediate_p(self)) {
      +    struct RBasic *b = mrb_basic_ptr(self);
      +    if (!mrb_frozen_p(b)) {
      +      MRB_SET_FROZEN_FLAG(b);
      +      if (b->c->tt == MRB_TT_SCLASS) MRB_SET_FROZEN_FLAG(b->c);
      +    }
         }
         return self;
       }
      @@ -4222,97 +3913,29 @@

       
       
      -459
      -460
      -461
      -462
      -463
      -464
      -465
      -466
      -467
      -468
      -469
      -470
      -471
      -472
      -473
      -474
      -475
      -476
      -477
      -478
      -479
      -480
      -481
      -482
      +447 +448 +449 +450 +451

      -
      # File 'src/kernel.c', line 459
      +      
      # File 'src/kernel.c', line 447
       
       static mrb_value
       mrb_obj_frozen(mrb_state *mrb, mrb_value self)
       {
      -  struct RBasic *b;
      -
      -  switch (mrb_type(self)) {
      -    case MRB_TT_FALSE:
      -    case MRB_TT_TRUE:
      -    case MRB_TT_FIXNUM:
      -    case MRB_TT_SYMBOL:
      -#ifndef MRB_WITHOUT_FLOAT
      -    case MRB_TT_FLOAT:
      -#endif
      -      return mrb_true_value();
      -    default:
      -      break;
      -  }
      -
      -  b = mrb_basic_ptr(self);
      -  if (!MRB_FROZEN_P(b)) {
      -    return mrb_false_value();
      -  }
      -  return mrb_true_value();
      +  return mrb_bool_value(mrb_immediate_p(self) || mrb_frozen_p(mrb_basic_ptr(self)));
       }
      - - -
      -

      - - #getc(*args) ⇒ Object - - - - - -

      - - - - -
      -
      -
      -
      -385
      -386
      -387
      -
      -
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 385
      -
      -def getc(*args)
      -  $stdin.getc(*args)
      -end
      -

      - #gets(*args) ⇒ Object + #gets(*args) ⇒ Object @@ -4324,12 +3947,12 @@

       
       
      -381
      -382
      -383
      +28 +29 +30

      -
      # File 'mrbgems/mruby-io/mrblib/io.rb', line 381
      +      
      # File 'mrbgems/mruby-io/mrblib/kernel.rb', line 28
       
       def gets(*args)
         $stdin.gets(*args)
      @@ -4395,42 +4018,26 @@ 

       
       
      -960
      -961
      -962
      -963
      -964
      -965
      -966
      -967
      -968
      -969
      -970
      -971
      -972
      -973
      -974
      -975
      -976
      +985 +986 +987 +988 +989 +990 +991 +992 +993

      -
      # File 'src/variable.c', line 960
      +      
      # File 'src/variable.c', line 985
       
       mrb_value
       mrb_f_global_variables(mrb_state *mrb, mrb_value self)
       {
         iv_tbl *t = mrb->globals;
         mrb_value ary = mrb_ary_new(mrb);
      -  size_t i;
      -  char buf[3];
       
         iv_foreach(mrb, t, gv_i, &ary);
      -  buf[0] = '$';
      -  buf[2] = 0;
      -  for (i = 1; i <= 9; ++i) {
      -    buf[1] = (char)(i + '0');
      -    mrb_ary_push(mrb, ary, mrb_symbol_value(mrb_intern(mrb, buf, 2)));
      -  }
         return ary;
       }
      @@ -4496,14 +4103,14 @@

       
       
      -495
      -496
      -497
      -498
      -499
      +464 +465 +466 +467 +468

      -
      # File 'src/kernel.c', line 495
      +      
      # File 'src/kernel.c', line 464
       
       static mrb_value
       mrb_obj_hash(mrb_state *mrb, mrb_value self)
      @@ -4518,7 +4125,7 @@ 

      - #initialize_copyObject + #initialize_copyObject @@ -4542,21 +4149,21 @@

       
       
      -502
      -503
      -504
      -505
      -506
      -507
      -508
      -509
      -510
      -511
      -512
      -513
      +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482

      -
      # File 'src/kernel.c', line 502
      +      
      # File 'src/kernel.c', line 471
       
       static mrb_value
       mrb_obj_init_copy(mrb_state *mrb, mrb_value self)
      @@ -4651,7 +4258,7 @@ 

      MRB_API mrb_value mrb_obj_inspect(mrb_state *mrb, mrb_value obj) { - if ((mrb_type(obj) == MRB_TT_OBJECT) && mrb_obj_basic_to_s_p(mrb, obj)) { + if (mrb_object_p(obj) && mrb_obj_basic_to_s_p(mrb, obj)) { return mrb_obj_iv_inspect(mrb, mrb_obj_ptr(obj)); } return mrb_any_to_s(mrb, obj); @@ -4716,18 +4323,18 @@

       
       
      -531
      -532
      -533
      -534
      -535
      -536
      -537
      -538
      -539
      +500 +501 +502 +503 +504 +505 +506 +507 +508

      -
      # File 'src/kernel.c', line 531
      +      
      # File 'src/kernel.c', line 500
       
       static mrb_value
       obj_is_instance_of(mrb_state *mrb, mrb_value self)
      @@ -4838,7 +4445,7 @@ 

      - #instance_variable_get(symbol) ⇒ Object + #instance_variable_get(symbol) ⇒ Object @@ -4881,7 +4488,7 @@

    1558. - (Object) + (Object) @@ -4932,7 +4539,7 @@

      - #instance_variable_set(symbol, obj) ⇒ Object + #instance_variable_set(symbol, obj) ⇒ Object @@ -4975,7 +4582,7 @@

    1559. - (Object) + (Object) @@ -5091,8 +4698,6 @@

       
       
      -566
      -567
       568
       569
       570
      @@ -5101,10 +4706,12 @@ 

      573 574 575 -576

      +576 +577 +578

    1560. -
      # File 'src/variable.c', line 566
      +      
      # File 'src/variable.c', line 568
       
       mrb_value
       mrb_obj_instance_variables(mrb_state *mrb, mrb_value self)
      @@ -5238,18 +4845,18 @@ 

       
       
      -568
      -569
      -570
      -571
      -572
      -573
      -574
      -575
      -576
      +537 +538 +539 +540 +541 +542 +543 +544 +545

      -
      # File 'src/kernel.c', line 568
      +      
      # File 'src/kernel.c', line 537
       
       static mrb_value
       mrb_obj_is_kind_of_m(mrb_state *mrb, mrb_value self)
      @@ -5609,18 +5216,18 @@ 

       
       
      -568
      -569
      -570
      -571
      -572
      -573
      -574
      -575
      -576
      +537 +538 +539 +540 +541 +542 +543 +544 +545

      -
      # File 'src/kernel.c', line 568
      +      
      # File 'src/kernel.c', line 537
       
       static mrb_value
       mrb_obj_is_kind_of_m(mrb_state *mrb, mrb_value self)
      @@ -5695,7 +5302,6 @@ 

       
       
      -131
       132
       133
       134
      @@ -5733,10 +5339,11 @@ 

      166 167 168 -169

      +169 +170

      -
      # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 131
      +      
      # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 132
       
       static mrb_value
       mrb_local_variables(mrb_state *mrb, mrb_value self)
      @@ -5759,7 +5366,7 @@ 

      for (i = 0; i + 1 < irep->nlocals; ++i) { if (irep->lv[i].name) { mrb_sym sym = irep->lv[i].name; - const char *name = mrb_sym2name(mrb, sym); + const char *name = mrb_sym_name(mrb, sym); switch (name[0]) { case '*': case '&': break; @@ -5785,7 +5392,7 @@

      - #loop(&block) ⇒ Object + #loop(&block) ⇒ Object @@ -5904,16 +5511,16 @@

       
       
      -251
       252
       253
       254
       255
       256
      -257
      +257 +258

      -
      # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 251
      +      
      # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 252
       
       static mrb_value
       mrb_obj_methods_m(mrb_state *mrb, mrb_value self)
      @@ -5972,25 +5579,25 @@ 

       
       
      -578
      -579
      -580
      -581
      -582
      -583
      -584
      -585
      -586
      -587
      -588
      -589
      -590
      -591
      -592
      -593
      +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562

      -
      # File 'src/kernel.c', line 578
      +      
      # File 'src/kernel.c', line 547
       
       KHASH_DECLARE(st, mrb_sym, char, FALSE)
       KHASH_DEFINE(st, mrb_sym, char, FALSE, kh_int_hash_func, kh_int_hash_equal)
      @@ -6016,7 +5623,7 @@ 

      - #object_idObject + #object_idObject @@ -6071,7 +5678,7 @@

      - #open(file, *rest, &block) ⇒ Object + #open(file, *rest, &block) ⇒ Object @@ -6138,7 +5745,7 @@

      - #p(*args) ⇒ Object + #p(*args) ⇒ Object @@ -6196,7 +5803,7 @@

      -
      # File 'src/kernel.c', line 665
      +      
      # File 'src/kernel.c', line 634
       
       static mrb_value
       mrb_obj_remove_instance_variable(mrb_state *mrb, mrb_value self)
      @@ -6775,7 +6393,7 @@ 

      mrb_iv_name_sym_check(mrb, sym); val = mrb_iv_remove(mrb, self, sym); if (mrb_undef_p(val)) { - mrb_name_error(mrb, sym, "instance variable %S not defined", mrb_sym2str(mrb, sym)); + mrb_name_error(mrb, sym, "instance variable %n not defined", sym); } return val; }

      @@ -6847,29 +6465,29 @@

       
       
      -756
      -757
      -758
      -759
      -760
      -761
      -762
      -763
      -764
      -765
      -766
      -767
      -768
      -769
      -770
      -771
      -772
      -773
      -774
      -775
      - - -
      # File 'src/kernel.c', line 756
      +725
      +726
      +727
      +728
      +729
      +730
      +731
      +732
      +733
      +734
      +735
      +736
      +737
      +738
      +739
      +740
      +741
      +742
      +743
      +744
      + + +
      # File 'src/kernel.c', line 725
       
       static mrb_value
       obj_respond_to(mrb_state *mrb, mrb_value self)
      @@ -6900,9 +6518,9 @@ 

      - #send(symbol[, args...]) ⇒ Object + #send(symbol[, args...]) ⇒ Object - #__send__(symbol[, args...]) ⇒ Object + #__send__(symbol[, args...]) ⇒ Object @@ -6933,7 +6551,7 @@

    1561. - #send(symbol[, args...]) ⇒ Object + #send(symbol[, args...]) ⇒ Object
      @@ -6949,7 +6567,7 @@

    1562. - (Object) + (Object) @@ -6964,7 +6582,7 @@

    1563. - #__send__(symbol[, args...]) ⇒ Object + #__send__(symbol[, args...]) ⇒ Object
      @@ -6980,7 +6598,7 @@

    1564. - (Object) + (Object) @@ -7004,6 +6622,10 @@

       
       
      +592
      +593
      +594
      +595
       596
       597
       598
      @@ -7044,14 +6666,10 @@ 

      633 634 635 -636 -637 -638 -639 -640

      +636

    1565. -
      # File 'src/vm.c', line 596
      +      
      # File 'src/vm.c', line 592
       
       mrb_value
       mrb_f_send(mrb_state *mrb, mrb_value self)
      @@ -7106,7 +6724,7 @@ 

      - #singleton_classObject + #singleton_classObject @@ -7114,7 +6732,7 @@

      -

      15.3.1.3.28

      +

      15.3.1.3.28 (15.3.1.2.7)

      @@ -7130,37 +6748,37 @@

       
       
      -1232
      -1233
      -1234
      -1235
      -1236
      -1237
      -1238
      -1239
      -1240
      -1241
      -1242
      -1243
      -1244
      -1245
      -1246
      -1247
      -1248
      -1249
      -1250
      -1251
      -1252
      -1253
      -1254
      -1255
      -1256
      -1257
      -1258
      -1259
      - - -
      # File 'src/class.c', line 1232
      +1264
      +1265
      +1266
      +1267
      +1268
      +1269
      +1270
      +1271
      +1272
      +1273
      +1274
      +1275
      +1276
      +1277
      +1278
      +1279
      +1280
      +1281
      +1282
      +1283
      +1284
      +1285
      +1286
      +1287
      +1288
      +1289
      +1290
      +1291
      + + +
      # File 'src/class.c', line 1264
       
       MRB_API mrb_value
       mrb_singleton_class(mrb_state *mrb, mrb_value v)
      @@ -7198,7 +6816,7 @@ 

      - #singleton_method(name) ⇒ Object + #singleton_method(name) ⇒ Object @@ -7315,16 +6933,16 @@

       
       
      -375
       376
       377
       378
       379
       380
      -381
      +381 +382

      -
      # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 375
      +      
      # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 376
       
       static mrb_value
       mrb_obj_singleton_methods_m(mrb_state *mrb, mrb_value self)
      @@ -7341,7 +6959,7 @@ 

      - #sprintfObject + #sprintfObject @@ -7374,12 +6992,121 @@

      +

      + +
      +

      + + #tap {|_self| ... } ⇒ Object + + + + + +

      +
      +

      call-seq: + obj.tap{|x|…} -> obj

      + +

      Yields x to the block, and then returns x. + The primary purpose of this method is to “tap into” a method chain, + in order to perform operations on intermediate results within the chain.

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      (1..10) .tap xputs “original: #{x.inspect”}  
      .to_a .tap xputs “array: #{x.inspect”}  
      .select xx%2==0 .tap xputs “evens: #{x.inspect”}
      .map {xx*x } .tap xputs “squares: #{x.inspect”}
      + + +
      +
      +
      + +

      Yields:

      +
        + +
      • + + + (_self) + + + +
      • + +
      +

      Yield Parameters:

      +
        + +
      • + + _self + + + (Kernel) + + + + — +

        the object that the method was called on

        +
        + +
      • + +
      + +
      + + + + + + +
      +
      +
      +
      +29
      +30
      +31
      +32
      +
      +
      # File 'mrbgems/mruby-object-ext/mrblib/object.rb', line 29
      +
      +def tap
      +  yield self
      +  self
      +end
      +

      - #to_enum(meth = :each, *args) ⇒ Object + #to_enum(meth = :each, *args) ⇒ Object @@ -7392,17 +7119,12 @@

      call-seq: - obj.to_enum(method = :each, args) -> enum - obj.enum_for(method = :each, *args) -> enum - obj.to_enum(method = :each, *args) {|args| block} -> enum - obj.enum_for(method = :each, args){|args| block} -> enum

      + obj.to_enum(method = :each, *args) -> enum + obj.enum_for(method = :each, *args) -> enum

      Creates a new Enumerator which will enumerate by calling +method+ on +obj+, passing +args+ if any.

      -

      If a block is given, it will be used to calculate the size of -the enumerator without the need to iterate it (see Enumerator#size).

      -

      === Examples

      str = “xyz”

      @@ -7420,17 +7142,14 @@

      It is typical to call to_enum when defining methods for a generic Enumerable, in case no block is passed.

      -

      Here is such an example, with parameter passing and a sizing block:

      +

      Here is such an example with parameter passing:

      module Enumerable
         # a generic method to repeat the values of any enumerable
         def repeat(n)
           raise ArgumentError, "#{n} is negative!" if n < 0
           unless block_given?
      -      return to_enum(__method__, n) do # __method__ is :repeat here
      -        sz = size     # Call size and multiply by n...
      -        sz * n if sz  # but return nil if size itself is nil
      -      end
      +      return to_enum(__method__, n) # __method__ is :repeat here
           end
           each do |*val|
             n.times { yield *val }
      @@ -7459,12 +7178,12 @@ 

       
       
      -615
      -616
      -617
      +647 +648 +649

      -
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 615
      +      
      # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 647
       
       def to_enum(*a)
         raise NotImplementedError.new("fiber required for enumerator")
      @@ -7477,7 +7196,7 @@ 

      - #to_sObject + #to_sObject @@ -7501,7 +7220,7 @@

      - #yield_self(&block) ⇒ Object + #yield_self(&block) ⇒ Object @@ -7548,7 +7267,7 @@

      13

      -
      # File 'mrbgems/mruby-kernel-ext/mrblib/kernel.rb', line 10
      +      
      # File 'mrbgems/mruby-object-ext/mrblib/object.rb', line 10
       
       def yield_self(&block)
         return to_enum :yield_self unless block
      @@ -7564,9 +7283,9 @@ 

      diff --git a/docs/api/KeyError.html b/docs/api/KeyError.html index 2d4e0e7..cf9d964 100644 --- a/docs/api/KeyError.html +++ b/docs/api/KeyError.html @@ -6,7 +6,7 @@ Exception: KeyError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ IndexError

      diff --git a/docs/api/LocalJumpError.html b/docs/api/LocalJumpError.html index 7c9d790..b9f1f44 100644 --- a/docs/api/LocalJumpError.html +++ b/docs/api/LocalJumpError.html @@ -6,7 +6,7 @@ Exception: LocalJumpError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ ScriptError
      diff --git a/docs/api/Math.html b/docs/api/Math.html index bfcb186..e44bfdb 100644 --- a/docs/api/Math.html +++ b/docs/api/Math.html @@ -6,7 +6,7 @@ Module: Math - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -717,9 +717,6 @@

       
       
      -265
      -266
      -267
       268
       269
       270
      @@ -729,10 +726,13 @@ 

      274 275 276 -277

      +277 +278 +279 +280

      -
      # File 'mrbgems/mruby-math/src/math.c', line 265
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 268
       
       static mrb_value
       math_acos(mrb_state *mrb, mrb_value obj)
      @@ -806,9 +806,6 @@ 

       
       
      -413
      -414
      -415
       416
       417
       418
      @@ -818,10 +815,13 @@ 

      422 423 424 -425

      +425 +426 +427 +428

      -
      # File 'mrbgems/mruby-math/src/math.c', line 413
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 416
       
       static mrb_value
       math_acosh(mrb_state *mrb, mrb_value obj)
      @@ -912,9 +912,6 @@ 

       
       
      -245
      -246
      -247
       248
       249
       250
      @@ -924,10 +921,13 @@ 

      254 255 256 -257

      +257 +258 +259 +260

      -
      # File 'mrbgems/mruby-math/src/math.c', line 245
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 248
       
       static mrb_value
       math_asin(mrb_state *mrb, mrb_value obj)
      @@ -1001,9 +1001,6 @@ 

       
       
      -395
      -396
      -397
       398
       399
       400
      @@ -1011,10 +1008,13 @@ 

      402 403 404 -405

      +405 +406 +407 +408

      -
      # File 'mrbgems/mruby-math/src/math.c', line 395
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 398
       
       static mrb_value
       math_asinh(mrb_state *mrb, mrb_value obj)
      @@ -1086,19 +1086,19 @@ 

       
       
      -285
      -286
      -287
       288
       289
       290
       291
       292
       293
      -294
      +294 +295 +296 +297

      -
      # File 'mrbgems/mruby-math/src/math.c', line 285
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 288
       
       static mrb_value
       math_atan(mrb_state *mrb, mrb_value obj)
      @@ -1181,19 +1181,19 @@ 

       
       
      -315
      -316
      -317
       318
       319
       320
       321
       322
       323
      -324
      +324 +325 +326 +327

      -
      # File 'mrbgems/mruby-math/src/math.c', line 315
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 318
       
       static mrb_value
       math_atan2(mrb_state *mrb, mrb_value obj)
      @@ -1264,9 +1264,6 @@ 

       
       
      -433
      -434
      -435
       436
       437
       438
      @@ -1276,10 +1273,13 @@ 

      442 443 444 -445

      +445 +446 +447 +448

      -
      # File 'mrbgems/mruby-math/src/math.c', line 433
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 436
       
       static mrb_value
       math_atanh(mrb_state *mrb, mrb_value obj)
      @@ -1377,19 +1377,19 @@ 

       
       
      -612
      -613
      -614
       615
       616
       617
       618
       619
       620
      -621
      +621 +622 +623 +624

      -
      # File 'mrbgems/mruby-math/src/math.c', line 612
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 615
       
       static mrb_value
       math_cbrt(mrb_state *mrb, mrb_value obj)
      @@ -1461,19 +1461,19 @@ 

       
       
      -206
      -207
      -208
       209
       210
       211
       212
       213
       214
      -215
      +215 +216 +217 +218

      -
      # File 'mrbgems/mruby-math/src/math.c', line 206
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 209
       
       static mrb_value
       math_cos(mrb_state *mrb, mrb_value obj)
      @@ -1544,19 +1544,19 @@ 

       
       
      -355
      -356
      -357
       358
       359
       360
       361
       362
       363
      -364
      +364 +365 +366 +367

      -
      # File 'mrbgems/mruby-math/src/math.c', line 355
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 358
       
       static mrb_value
       math_cosh(mrb_state *mrb, mrb_value obj)
      @@ -1627,19 +1627,19 @@ 

       
       
      -694
      -695
      -696
       697
       698
       699
       700
       701
       702
      -703
      +703 +704 +705 +706

      -
      # File 'mrbgems/mruby-math/src/math.c', line 694
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 697
       
       static mrb_value
       math_erf(mrb_state *mrb, mrb_value obj)
      @@ -1710,19 +1710,19 @@ 

       
       
      -712
      -713
      -714
       715
       716
       717
       718
       719
       720
      -721
      +721 +722 +723 +724

      -
      # File 'mrbgems/mruby-math/src/math.c', line 712
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 715
       
       static mrb_value
       math_erfc(mrb_state *mrb, mrb_value obj)
      @@ -1797,19 +1797,19 @@ 

       
       
      -462
      -463
      -464
       465
       466
       467
       468
       469
       470
      -471
      +471 +472 +473 +474

      -
      # File 'mrbgems/mruby-math/src/math.c', line 462
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 465
       
       static mrb_value
       math_exp(mrb_state *mrb, mrb_value obj)
      @@ -1885,9 +1885,6 @@ 

       
       
      -635
      -636
      -637
       638
       639
       640
      @@ -1895,10 +1892,13 @@ 

      642 643 644 -645

      +645 +646 +647 +648

      -
      # File 'mrbgems/mruby-math/src/math.c', line 635
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 638
       
       static mrb_value
       math_frexp(mrb_state *mrb, mrb_value obj)
      @@ -1973,19 +1973,19 @@ 

       
       
      -677
      -678
      -679
       680
       681
       682
       683
       684
       685
      -686
      +686 +687 +688 +689

      -
      # File 'mrbgems/mruby-math/src/math.c', line 677
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 680
       
       static mrb_value
       math_hypot(mrb_state *mrb, mrb_value obj)
      @@ -2059,9 +2059,6 @@ 

       
       
      -656
      -657
      -658
       659
       660
       661
      @@ -2069,10 +2066,13 @@ 

      663 664 665 -666

      +666 +667 +668 +669

      -
      # File 'mrbgems/mruby-math/src/math.c', line 656
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 659
       
       static mrb_value
       math_ldexp(mrb_state *mrb, mrb_value obj)
      @@ -2195,9 +2195,6 @@ 

       
       
      -488
      -489
      -490
       491
       492
       493
      @@ -2213,10 +2210,13 @@ 

      503 504 505 -506

      +506 +507 +508 +509

      -
      # File 'mrbgems/mruby-math/src/math.c', line 488
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 491
       
       static mrb_value
       math_log(mrb_state *mrb, mrb_value obj)
      @@ -2300,9 +2300,6 @@ 

       
       
      -545
      -546
      -547
       548
       549
       550
      @@ -2312,10 +2309,13 @@ 

      554 555 556 -557

      +557 +558 +559 +560

      -
      # File 'mrbgems/mruby-math/src/math.c', line 545
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 548
       
       static mrb_value
       math_log10(mrb_state *mrb, mrb_value obj)
      @@ -2394,9 +2394,6 @@ 

       
       
      -520
      -521
      -522
       523
       524
       525
      @@ -2406,10 +2403,13 @@ 

      529 530 531 -532

      +532 +533 +534 +535

      -
      # File 'mrbgems/mruby-math/src/math.c', line 520
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 523
       
       static mrb_value
       math_log2(mrb_state *mrb, mrb_value obj)
      @@ -2484,19 +2484,19 @@ 

       
       
      -188
      -189
      -190
       191
       192
       193
       194
       195
       196
      -197
      +197 +198 +199 +200

      -
      # File 'mrbgems/mruby-math/src/math.c', line 188
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 191
       
       static mrb_value
       math_sin(mrb_state *mrb, mrb_value obj)
      @@ -2568,19 +2568,19 @@ 

       
       
      -338
      -339
      -340
       341
       342
       343
       344
       345
       346
      -347
      +347 +348 +349 +350

      -
      # File 'mrbgems/mruby-math/src/math.c', line 338
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 341
       
       static mrb_value
       math_sinh(mrb_state *mrb, mrb_value obj)
      @@ -2651,9 +2651,6 @@ 

       
       
      -566
      -567
      -568
       569
       570
       571
      @@ -2663,10 +2660,13 @@ 

      575 576 577 -578

      +578 +579 +580 +581

      -
      # File 'mrbgems/mruby-math/src/math.c', line 566
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 569
       
       static mrb_value
       math_sqrt(mrb_state *mrb, mrb_value obj)
      @@ -2740,19 +2740,19 @@ 

       
       
      -223
      -224
      -225
       226
       227
       228
       229
       230
       231
      -232
      +232 +233 +234 +235

      -
      # File 'mrbgems/mruby-math/src/math.c', line 223
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 226
       
       static mrb_value
       math_tan(mrb_state *mrb, mrb_value obj)
      @@ -2824,19 +2824,19 @@ 

       
       
      -373
      -374
      -375
       376
       377
       378
       379
       380
       381
      -382
      +382 +383 +384 +385

      -
      # File 'mrbgems/mruby-math/src/math.c', line 373
      +      
      # File 'mrbgems/mruby-math/src/math.c', line 376
       
       static mrb_value
       math_tanh(mrb_state *mrb, mrb_value obj)
      @@ -2858,9 +2858,9 @@ 

      diff --git a/docs/api/Method.html b/docs/api/Method.html index 934e3b9..916e4e2 100644 --- a/docs/api/Method.html +++ b/docs/api/Method.html @@ -6,7 +6,7 @@ Class: Method - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
      Inherits:
      - Object + Object
        -
      • Object
      • +
      • Object
      • @@ -183,6 +183,29 @@

        +
        +
        + + + + +
      • + + + #[] ⇒ Object + + + + + + + + + + + + +
        @@ -229,6 +252,29 @@

        +
        +
        + +

      • + + +
      • + + + #eql? ⇒ Boolean + + + + + + + + + + + + +
        @@ -477,7 +523,7 @@

        Instance Method Details

        - #<<(other) ⇒ Object + #<<(other) ⇒ Object @@ -489,12 +535,12 @@

         
         
        -21
        -22
        -23
        +9 +10 +11

      -
      # File 'mrbgems/mruby-method/mrblib/method.rb', line 21
      +      
      # File 'mrbgems/mruby-method/mrblib/method.rb', line 9
       
       def <<(other)
         ->(*args, &block) { call(other.call(*args, &block)) }
      @@ -507,7 +553,7 @@ 

      - #==Object + #==Object @@ -519,10 +565,6 @@

       
       
      -47
      -48
      -49
      -50
       51
       52
       53
      @@ -575,10 +617,14 @@ 

      100 101 102 -103

      +103 +104 +105 +106 +107

      -
      # File 'mrbgems/mruby-method/src/method.c', line 47
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 51
       
       static mrb_value
       method_eql(mrb_state *mrb, mrb_value self)
      @@ -594,22 +640,22 @@ 

      if (mrb_class(mrb, self) != mrb_class(mrb, other)) return mrb_false_value(); - klass = mrb_class_ptr(IV_GET(self, "@klass")); - if (klass != mrb_class_ptr(IV_GET(other, "@klass"))) + klass = mrb_class_ptr(IV_GET(self, "_klass")); + if (klass != mrb_class_ptr(IV_GET(other, "_klass"))) return mrb_false_value(); - owner = mrb_class_ptr(IV_GET(self, "@owner")); - if (owner != mrb_class_ptr(IV_GET(other, "@owner"))) + owner = mrb_class_ptr(IV_GET(self, "_owner")); + if (owner != mrb_class_ptr(IV_GET(other, "_owner"))) return mrb_false_value(); - receiver = IV_GET(self, "@recv"); - if (!mrb_obj_equal(mrb, receiver, IV_GET(other, "@recv"))) + receiver = IV_GET(self, "_recv"); + if (!mrb_obj_equal(mrb, receiver, IV_GET(other, "_recv"))) return mrb_false_value(); - orig_proc = IV_GET(self, "proc"); - other_proc = IV_GET(other, "proc"); + orig_proc = IV_GET(self, "_proc"); + other_proc = IV_GET(other, "_proc"); if (mrb_nil_p(orig_proc) && mrb_nil_p(other_proc)) { - if (mrb_symbol(IV_GET(self, "@name")) == mrb_symbol(IV_GET(other, "@name"))) + if (mrb_symbol(IV_GET(self, "_name")) == mrb_symbol(IV_GET(other, "_name"))) return mrb_true_value(); else return mrb_false_value(); @@ -645,7 +691,7 @@

      - #>>(other) ⇒ Object + #>>(other) ⇒ Object @@ -657,12 +703,12 @@

       
       
      -25
      -26
      -27
      +13 +14 +15

      -
      # File 'mrbgems/mruby-method/mrblib/method.rb', line 25
      +      
      # File 'mrbgems/mruby-method/mrblib/method.rb', line 13
       
       def >>(other)
         ->(*args, &block) { other.call(call(*args, &block)) }
      @@ -673,9 +719,9 @@ 

      -

      +

      - #arityObject + #[]Object @@ -687,45 +733,73 @@

       
       
      -211
      -212
      -213
      -214
      -215
      -216
      -217
      -218
      -219
      -220
      -221
      -222
      -223
      -224
      -225
      -226
      -227
      -228
      +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150

      -
      # File 'mrbgems/mruby-method/src/method.c', line 211
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 138
       
       static mrb_value
      -method_arity(mrb_state *mrb, mrb_value self)
      +method_call(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "proc"));
      -  struct RProc *rproc;
      -  struct RClass *orig;
      -  mrb_value ret;
      +  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_proc"));
      +  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name"));
      +  mrb_value recv = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_recv"));
      +  struct RClass *owner = mrb_class_ptr(mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner")));
      +  mrb_int argc;
      +  mrb_value *argv, block;
       
      -  if (mrb_nil_p(proc))
      -    return mrb_fixnum_value(-1);
      +  mrb_get_args(mrb, "*&", &argv, &argc, &block);
      +  return mcall(mrb, recv, proc, name, owner, argc, argv, block);
      +}
      + + + + + +
      +

      + + #arityObject + - rproc = mrb_proc_ptr(proc); - orig = rproc->c; - rproc->c = mrb->proc_class; - ret = mrb_funcall(mrb, proc, "arity", 0); - rproc->c = orig; - return ret; + + + +

      + + + @@ -735,7 +809,7 @@

      - #callObject + #callObject @@ -747,73 +821,198 @@

       
       
      -107
      -108
      -109
      -110
      -111
      -112
      -113
      -114
      -115
      -116
      -117
      -118
      -119
      -120
      -121
      -122
      -123
      -124
      -125
      -126
      -127
      -128
      -129
      -130
      -131
      -132
      -133
      -134
      -135
      -136
      -137
      -138
      +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150

      + +
      +
      +
      +
      +238
      +239
      +240
      +241
      +242
      +243
      +244
      +
      +
      # File 'mrbgems/mruby-method/src/method.c', line 238
      +
      +static mrb_value
      +method_arity(mrb_state *mrb, mrb_value self)
      +{
      +  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_proc"));
      +  mrb_int arity = mrb_nil_p(proc) ? -1 : mrb_proc_arity(mrb_proc_ptr(proc));
      +  return mrb_fixnum_value(arity);
       }
      -
      # File 'mrbgems/mruby-method/src/method.c', line 107
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 138
       
       static mrb_value
       method_call(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "proc"));
      -  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@name"));
      -  mrb_value recv = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@recv"));
      -  struct RClass *owner = mrb_class_ptr(mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@owner")));
      +  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_proc"));
      +  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name"));
      +  mrb_value recv = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_recv"));
      +  struct RClass *owner = mrb_class_ptr(mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner")));
         mrb_int argc;
      -  mrb_value *argv, ret, block;
      -  mrb_sym orig_mid;
      +  mrb_value *argv, block;
       
         mrb_get_args(mrb, "*&", &argv, &argc, &block);
      -  orig_mid = mrb->c->ci->mid;
      -  mrb->c->ci->mid = mrb_symbol(name);
      -  if (mrb_nil_p(proc)) {
      -    mrb_value missing_argv = mrb_ary_new_from_values(mrb, argc, argv);
      -    mrb_ary_unshift(mrb, missing_argv, name);
      -    ret = mrb_funcall_argv(mrb, recv, mrb_intern_lit(mrb, "method_missing"), argc + 1, RARRAY_PTR(missing_argv));
      +  return mcall(mrb, recv, proc, name, owner, argc, argv, block);
      +}
      +
      +
      + +
      +

      + + #eql?Boolean + + + + + +

      +
      + + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + + @@ -823,7 +1022,7 @@

      - #inspectObject + #inspectObject @@ -835,22 +1034,6 @@

       
       
      -271
      -272
      -273
      -274
      -275
      -276
      -277
      -278
      -279
      -280
      -281
      -282
      -283
      -284
      -285
      -286
       287
       288
       289
      @@ -861,17 +1044,33 @@ 

      294 295 296 -297

      +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313

      +
      +
      +
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +
      +
      # File 'mrbgems/mruby-method/src/method.c', line 51
      +
      +static mrb_value
      +method_eql(mrb_state *mrb, mrb_value self)
      +{
      +  mrb_value other, receiver, orig_proc, other_proc;
      +  struct RClass *owner, *klass;
      +  struct RProc *orig_rproc, *other_rproc;
      +
      +  mrb_get_args(mrb, "o", &other);
      +  if (!mrb_obj_is_instance_of(mrb, other, mrb_class(mrb, self)))
      +    return mrb_false_value();
      +
      +  if (mrb_class(mrb, self) != mrb_class(mrb, other))
      +    return mrb_false_value();
      +
      +  klass = mrb_class_ptr(IV_GET(self, "_klass"));
      +  if (klass != mrb_class_ptr(IV_GET(other, "_klass")))
      +    return mrb_false_value();
      +
      +  owner = mrb_class_ptr(IV_GET(self, "_owner"));
      +  if (owner != mrb_class_ptr(IV_GET(other, "_owner")))
      +    return mrb_false_value();
      +
      +  receiver = IV_GET(self, "_recv");
      +  if (!mrb_obj_equal(mrb, receiver, IV_GET(other, "_recv")))
      +    return mrb_false_value();
      +
      +  orig_proc = IV_GET(self, "_proc");
      +  other_proc = IV_GET(other, "_proc");
      +  if (mrb_nil_p(orig_proc) && mrb_nil_p(other_proc)) {
      +    if (mrb_symbol(IV_GET(self, "_name")) == mrb_symbol(IV_GET(other, "_name")))
      +      return mrb_true_value();
      +    else
      +      return mrb_false_value();
         }
      -  else if (!mrb_nil_p(block)) {
      -    /*
      -      workaround since `mrb_yield_with_class` does not support passing block as parameter
      -      need new API that initializes `mrb->c->stack[argc+1]` with block passed by argument
      -    */
      -    ret = mrb_funcall_with_block(mrb, recv, mrb_symbol(name), argc, argv, block);
      +
      +  if (mrb_nil_p(orig_proc))
      +    return mrb_false_value();
      +  if (mrb_nil_p(other_proc))
      +    return mrb_false_value();
      +
      +  orig_rproc = mrb_proc_ptr(orig_proc);
      +  other_rproc = mrb_proc_ptr(other_proc);
      +  if (MRB_PROC_CFUNC_P(orig_rproc)) {
      +    if (!MRB_PROC_CFUNC_P(other_rproc))
      +      return mrb_false_value();
      +    if (orig_rproc->body.func != other_rproc->body.func)
      +      return mrb_false_value();
         }
         else {
      -    ret = mrb_yield_with_class(mrb, proc, argc, argv, recv, owner);
      +    if (MRB_PROC_CFUNC_P(other_rproc))
      +      return mrb_false_value();
      +    if (orig_rproc->body.irep != other_rproc->body.irep)
      +      return mrb_false_value();
         }
      -  mrb->c->ci->mid = orig_mid;
      -  return ret;
      +
      +  return mrb_true_value();
       }
      -
      # File 'mrbgems/mruby-method/src/method.c', line 271
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 287
       
       static mrb_value
       method_to_s(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@owner"));
      -  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@klass"));
      -  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@name"));
      +  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner"));
      +  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_klass"));
      +  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name"));
         mrb_value str = mrb_str_new_lit(mrb, "#<");
         struct RClass *rklass;
       
      @@ -879,16 +1078,16 @@ 

      mrb_str_cat_lit(mrb, str, ": "); rklass = mrb_class_ptr(klass); if (mrb_class_ptr(owner) == rklass) { - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, owner, "to_s", 0)); + mrb_str_concat(mrb, str, owner); mrb_str_cat_lit(mrb, str, "#"); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, name, "to_s", 0)); + mrb_str_concat(mrb, str, name); } else { mrb_str_cat_cstr(mrb, str, mrb_class_name(mrb, rklass)); mrb_str_cat_lit(mrb, str, "("); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, owner, "to_s", 0)); + mrb_str_concat(mrb, str, owner); mrb_str_cat_lit(mrb, str, ")#"); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, name, "to_s", 0)); + mrb_str_concat(mrb, str, name); } mrb_str_cat_lit(mrb, str, ">"); return str; @@ -901,7 +1100,7 @@

      - #nameObject + #nameObject @@ -913,16 +1112,20 @@

       
       
      -17
      -18
      -19
      +401 +402 +403 +404 +405

      -
      # File 'mrbgems/mruby-method/mrblib/method.rb', line 17
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 401
       
      -def name
      -  @name
      -end
      +static mrb_value +method_name(mrb_state *mrb, mrb_value self) +{ + return mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name")); +}
      @@ -931,7 +1134,7 @@

      - #ownerObject + #ownerObject @@ -943,16 +1146,20 @@

       
       
      -9
      -10
      -11
      +389 +390 +391 +392 +393

      -
      # File 'mrbgems/mruby-method/mrblib/method.rb', line 9
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 389
       
      -def owner
      -  @owner
      -end
      +static mrb_value +method_owner(mrb_state *mrb, mrb_value self) +{ + return mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner")); +}
      @@ -961,7 +1168,7 @@

      - #parametersObject + #parametersObject @@ -973,35 +1180,35 @@

       
       
      -249
      -250
      -251
      -252
      -253
      -254
      -255
      -256
      -257
      -258
      -259
      -260
      -261
      -262
      -263
      -264
       265
       266
       267
       268
      -269
      +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285

      -
      # File 'mrbgems/mruby-method/src/method.c', line 249
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 265
       
       static mrb_value
       method_parameters(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "proc"));
      +  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_proc"));
         struct RProc *rproc;
         struct RClass *orig;
         mrb_value ret;
      @@ -1027,7 +1234,7 @@ 

      - #receiverObject + #receiverObject @@ -1039,16 +1246,20 @@

       
       
      -13
      -14
      -15
      +395 +396 +397 +398 +399

      -
      # File 'mrbgems/mruby-method/mrblib/method.rb', line 13
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 395
       
      -def receiver
      -  @recv
      -end
      +static mrb_value +method_receiver(mrb_state *mrb, mrb_value self) +{ + return mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_recv")); +}
      @@ -1057,7 +1268,7 @@

      - #source_locationObject + #source_locationObject @@ -1069,32 +1280,32 @@

       
       
      -230
      -231
      -232
      -233
      -234
      -235
      -236
      -237
      -238
      -239
      -240
      -241
      -242
      -243
      -244
      -245
       246
      -247
      +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263

      -
      # File 'mrbgems/mruby-method/src/method.c', line 230
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 246
       
       static mrb_value
       method_source_location(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "proc"));
      +  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_proc"));
         struct RProc *rproc;
         struct RClass *orig;
         mrb_value ret;
      @@ -1117,7 +1328,7 @@ 

      - #super_methodObject + #super_methodObject @@ -1129,33 +1340,6 @@

       
       
      -170
      -171
      -172
      -173
      -174
      -175
      -176
      -177
      -178
      -179
      -180
      -181
      -182
      -183
      -184
      -185
      -186
      -187
      -188
      -189
      -190
      -191
      -192
      -193
      -194
      -195
      -196
       197
       198
       199
      @@ -1168,18 +1352,45 @@ 

      206 207 208 -209

      +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236

      -
      # File 'mrbgems/mruby-method/src/method.c', line 170
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 197
       
       static mrb_value
       method_super_method(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value recv = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@recv"));
      -  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@klass"));
      -  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@owner"));
      -  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@name"));
      +  mrb_value recv = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_recv"));
      +  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_klass"));
      +  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner"));
      +  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name"));
         struct RClass *super, *rklass;
         struct RProc *proc;
         struct RObject *me;
      @@ -1205,11 +1416,11 @@ 

      super = super->c; me = method_object_alloc(mrb, mrb_obj_class(mrb, self)); - mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "@owner"), mrb_obj_value(super)); - mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "@recv"), recv); - mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "@name"), name); - mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "proc"), mrb_obj_value(proc)); - mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "@klass"), mrb_obj_value(rklass)); + mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_owner"), mrb_obj_value(super)); + mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_recv"), recv); + mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_name"), name); + mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_proc"), mrb_obj_value(proc)); + mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_klass"), mrb_obj_value(rklass)); return mrb_obj_value(me); }

      @@ -1221,7 +1432,7 @@

      - #to_procObject + #to_procObject @@ -1257,7 +1468,7 @@

      - #to_sObject + #to_sObject @@ -1269,22 +1480,6 @@

       
       
      -271
      -272
      -273
      -274
      -275
      -276
      -277
      -278
      -279
      -280
      -281
      -282
      -283
      -284
      -285
      -286
       287
       288
       289
      @@ -1295,17 +1490,33 @@ 

      294 295 296 -297

      +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313

      -
      # File 'mrbgems/mruby-method/src/method.c', line 271
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 287
       
       static mrb_value
       method_to_s(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@owner"));
      -  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@klass"));
      -  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@name"));
      +  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner"));
      +  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_klass"));
      +  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name"));
         mrb_value str = mrb_str_new_lit(mrb, "#<");
         struct RClass *rklass;
       
      @@ -1313,16 +1524,16 @@ 

      mrb_str_cat_lit(mrb, str, ": "); rklass = mrb_class_ptr(klass); if (mrb_class_ptr(owner) == rklass) { - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, owner, "to_s", 0)); + mrb_str_concat(mrb, str, owner); mrb_str_cat_lit(mrb, str, "#"); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, name, "to_s", 0)); + mrb_str_concat(mrb, str, name); } else { mrb_str_cat_cstr(mrb, str, mrb_class_name(mrb, rklass)); mrb_str_cat_lit(mrb, str, "("); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, owner, "to_s", 0)); + mrb_str_concat(mrb, str, owner); mrb_str_cat_lit(mrb, str, ")#"); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, name, "to_s", 0)); + mrb_str_concat(mrb, str, name); } mrb_str_cat_lit(mrb, str, ">"); return str; @@ -1335,7 +1546,7 @@

      - #unbindObject + #unbindObject @@ -1347,43 +1558,43 @@

       
       
      -140
      -141
      -142
      -143
      -144
      -145
      -146
      -147
      -148
      -149
      -150
      -151
      -152
      -153
      -154
      -155
      -156
      -157
      +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184

      -
      # File 'mrbgems/mruby-method/src/method.c', line 140
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 167
       
       static mrb_value
       method_unbind(mrb_state *mrb, mrb_value self)
       {
         struct RObject *ume;
      -  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@owner"));
      -  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@name"));
      -  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "proc"));
      -  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@klass"));
      +  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner"));
      +  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name"));
      +  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_proc"));
      +  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_klass"));
       
         ume = method_object_alloc(mrb, mrb_class_get(mrb, "UnboundMethod"));
      -  mrb_obj_iv_set(mrb, ume, mrb_intern_lit(mrb, "@owner"), owner);
      -  mrb_obj_iv_set(mrb, ume, mrb_intern_lit(mrb, "@recv"), mrb_nil_value());
      -  mrb_obj_iv_set(mrb, ume, mrb_intern_lit(mrb, "@name"), name);
      -  mrb_obj_iv_set(mrb, ume, mrb_intern_lit(mrb, "proc"), proc);
      -  mrb_obj_iv_set(mrb, ume, mrb_intern_lit(mrb, "@klass"), klass);
      +  mrb_obj_iv_set(mrb, ume, mrb_intern_lit(mrb, "_owner"), owner);
      +  mrb_obj_iv_set(mrb, ume, mrb_intern_lit(mrb, "_recv"), mrb_nil_value());
      +  mrb_obj_iv_set(mrb, ume, mrb_intern_lit(mrb, "_name"), name);
      +  mrb_obj_iv_set(mrb, ume, mrb_intern_lit(mrb, "_proc"), proc);
      +  mrb_obj_iv_set(mrb, ume, mrb_intern_lit(mrb, "_klass"), klass);
       
         return mrb_obj_value(ume);
       }
      @@ -1397,9 +1608,9 @@

      diff --git a/docs/api/Module.html b/docs/api/Module.html index 893f97a..914cf08 100644 --- a/docs/api/Module.html +++ b/docs/api/Module.html @@ -6,7 +6,7 @@ Class: Module - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
      Inherits:
      - Object + Object
        -
      • Object
      • +
      • Object
      • @@ -316,7 +316,7 @@

        Instance Method Details

        - #<(other) ⇒ Object + #<(other) ⇒ Object @@ -372,7 +372,7 @@

        - #<=(other) ⇒ Object + #<=(other) ⇒ Object @@ -444,7 +444,7 @@

        - #<=>(other) ⇒ Object + #<=>(other) ⇒ Object @@ -504,7 +504,7 @@

        - #>(other) ⇒ Object + #>(other) ⇒ Object @@ -560,7 +560,7 @@

        - #>=(other) ⇒ Object + #>=(other) ⇒ Object @@ -624,7 +624,7 @@

        - #attr_accessor(*names) ⇒ Object + #attr_accessor(*names) ⇒ Object @@ -668,7 +668,7 @@

        - #include(*args) ⇒ Object + #include(*args) ⇒ Object @@ -718,7 +718,7 @@

        - #prepend(*args) ⇒ Object + #prepend(*args) ⇒ Object @@ -758,9 +758,9 @@

        diff --git a/docs/api/NameError.html b/docs/api/NameError.html index e7e310a..d7ae47f 100644 --- a/docs/api/NameError.html +++ b/docs/api/NameError.html @@ -6,7 +6,7 @@ Exception: NameError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ StandardError
          -
        • Object
        • +
        • Object
        • @@ -271,7 +271,7 @@

          Instance Attribute Details

          - #nameObject + #nameObject @@ -316,9 +316,9 @@

        diff --git a/docs/api/NilClass.html b/docs/api/NilClass.html index 6d1bb59..3e378b4 100644 --- a/docs/api/NilClass.html +++ b/docs/api/NilClass.html @@ -6,7 +6,7 @@ Class: NilClass - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
        Inherits:
        - Object + Object
          -
        • Object
        • +
        • Object
        • @@ -253,6 +253,29 @@

          Always returns zero.

          + + + +
        • + + + #to_h ⇒ Object + + + + + + + + + + + + + +

          Always returns an empty hash.

          +
          +
        • @@ -581,7 +604,7 @@

          - #inspectObject + #inspectObject @@ -617,7 +640,7 @@

          static mrb_value nil_inspect(mrb_state *mrb, mrb_value obj) { - return mrb_str_new_lit(mrb, "nil"); + return mrb_str_new_lit_frozen(mrb, "nil"); }

      @@ -740,14 +763,14 @@

       
       
      -13
       14
       15
       16
      -17
      +17 +18

      -
      # File 'mrbgems/mruby-object-ext/src/object.c', line 13
      +      
      # File 'mrbgems/mruby-object-ext/src/object.c', line 14
       
       static mrb_value
       nil_to_a(mrb_state *mrb, mrb_value obj)
      @@ -813,14 +836,14 @@ 

       
       
      -27
       28
       29
       30
      -31
      +31 +32

      -
      # File 'mrbgems/mruby-object-ext/src/object.c', line 27
      +      
      # File 'mrbgems/mruby-object-ext/src/object.c', line 28
       
       static mrb_value
       nil_to_f(mrb_state *mrb, mrb_value obj)
      @@ -830,6 +853,54 @@ 

      + + +
      +

      + + #to_hObject + + + + + +

      +
      +

      Always returns an empty hash.

      + + +
      +
      +
      + + + + +
      + + + + + + +
      +
      +
      +
      +42
      +43
      +44
      +45
      +46
      +
      +
      # File 'mrbgems/mruby-object-ext/src/object.c', line 42
      +
      +static mrb_value
      +nil_to_h(mrb_state *mrb, mrb_value obj)
      +{
      +  return mrb_hash_new(mrb);
      +}
      +
      @@ -886,14 +957,14 @@

       
       
      -41
      -42
      -43
      -44
      -45
      +55 +56 +57 +58 +59

      -
      # File 'mrbgems/mruby-object-ext/src/object.c', line 41
      +      
      # File 'mrbgems/mruby-object-ext/src/object.c', line 55
       
       static mrb_value
       nil_to_i(mrb_state *mrb, mrb_value obj)
      @@ -908,7 +979,7 @@ 

      - #to_sObject + #to_sObject @@ -946,7 +1017,7 @@

      static mrb_value nil_to_s(mrb_state *mrb, mrb_value obj) { - return mrb_str_new(mrb, 0, 0); + return mrb_str_new_frozen(mrb, 0, 0); }

      @@ -1082,9 +1153,9 @@

      diff --git a/docs/api/NoMemoryError.html b/docs/api/NoMemoryError.html index 1467638..d310684 100644 --- a/docs/api/NoMemoryError.html +++ b/docs/api/NoMemoryError.html @@ -6,7 +6,7 @@ Exception: NoMemoryError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ Exception
        -
      • Object
      • +
      • Object
      • @@ -134,9 +134,9 @@

        Constructor Details

        diff --git a/docs/api/NoMethodError.html b/docs/api/NoMethodError.html index 50529e7..f23b1e6 100644 --- a/docs/api/NoMethodError.html +++ b/docs/api/NoMethodError.html @@ -6,7 +6,7 @@ Exception: NoMethodError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ NameError
          -
        • Object
        • +
        • Object
        • @@ -282,7 +282,7 @@

          Instance Attribute Details

          - #argsObject (readonly) + #argsObject (readonly) @@ -327,9 +327,9 @@

          diff --git a/docs/api/NotImplementedError.html b/docs/api/NotImplementedError.html index 7a81919..9a53b48 100644 --- a/docs/api/NotImplementedError.html +++ b/docs/api/NotImplementedError.html @@ -6,7 +6,7 @@ Exception: NotImplementedError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ ScriptError
            -
          • Object
          • +
          • Object
          • @@ -142,9 +142,9 @@

            Constructor Details

            diff --git a/docs/api/Numeric.html b/docs/api/Numeric.html index 1a7691e..ee37454 100644 --- a/docs/api/Numeric.html +++ b/docs/api/Numeric.html @@ -6,7 +6,7 @@ Class: Numeric - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
            Inherits:
            - Object + Object
              -
            • Object
            • +
            • Object
            • @@ -104,7 +104,7 @@
              Defined in:
              mrblib/numeric.rb,
              - src/numeric.c
              + src/numeric.c,
              mrbgems/mruby-rational/mrblib/rational.rb,
              mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb
              @@ -126,7 +126,7 @@

              Overview

              Direct Known Subclasses

              -

              Float, Integer

              +

              Complex, Float, Integer, Rational

              @@ -146,29 +146,6 @@

            • - #**(other) ⇒ Numeric - - - - - - - - - - - - - -

              Raises num the other power.

              -
              - -
            • - - -
            • - - #+@ ⇒ Object @@ -215,7 +192,7 @@

            • - #quo(numeric) ⇒ Object + #abs ⇒ Object @@ -229,7 +206,7 @@

              -

              Returns most exact division.

              +

              Returns the absolute value of the receiver.

            • @@ -238,7 +215,7 @@

            • - #< ⇒ Object + #finite? ⇒ Boolean @@ -252,7 +229,7 @@

              -

              15.2.9.3.6.

              +

              15.2.7.

            • @@ -261,7 +238,7 @@

            • - #<= ⇒ Object + #infinite? ⇒ Boolean @@ -284,32 +261,7 @@

            • - #<=> ⇒ Object - - - - - - - - - - - - - -
              -

              => +1 Comparison—Returns -1, 0, or +1 depending on whether fix is less than, equal to, or greater than numeric.

              -
              -
              - -
            • - - -
            • - - - #> ⇒ Object + #negative? ⇒ Boolean @@ -332,7 +284,7 @@

            • - #>= ⇒ Object + #nonzero? ⇒ Boolean @@ -355,7 +307,7 @@

            • - #__coerce_step_counter ⇒ Object + #positive? ⇒ Boolean @@ -378,30 +330,7 @@

            • - #abs ⇒ Object - - - - - - - - - - - - - -

              Returns the absolute value of the receiver.

              -
              - -
            • - - -
            • - - - #finite? ⇒ Boolean + #to_r ⇒ Object @@ -424,7 +353,7 @@

            • - #infinite? ⇒ Boolean + #zero? ⇒ Boolean @@ -441,29 +370,6 @@

              -

            • - - -
            • - - - #quo(numeric) ⇒ Object - - - - - - - - - - - - - -

              Returns most exact division.

              -
              -
            • @@ -480,7 +386,7 @@

              Methods included from Comparable

              -

              #==, #between?, #clamp

              +

              #<, #<=, #==, #>, #>=, #between?, #clamp

              @@ -488,168 +394,9 @@

              Instance Method Details

              -

              +

              - #**(other) ⇒ Numeric - - - - - -

              -
              -

              Raises num the other power.

              - -

              2.0**3 #=> 8.0

              - - -
              -
              -
              - -
              -
              - - - -
              -
              -
              - -

              Returns:

              - - -
              - - - - -
              - - - - - - -
              -
              -
              -
              -58
              -59
              -60
              -61
              -62
              -63
              -64
              -65
              -66
              -67
              -68
              -69
              -70
              -71
              -72
              -73
              -74
              -75
              -76
              -77
              -78
              -79
              -80
              -81
              -82
              -83
              -84
              -85
              -86
              -87
              -88
              -89
              -90
              -91
              -92
              -93
              -94
              -95
              -96
              -97
              -98
              -99
              -100
              -101
              -102
              -103
              -104
              -
              -
              # File 'src/numeric.c', line 58
              -
              -static mrb_value
              -num_pow(mrb_state *mrb, mrb_value x)
              -{
              -  mrb_value y;
              -#ifndef MRB_WITHOUT_FLOAT
              -  mrb_float d;
              -#endif
              -
              -  mrb_get_args(mrb, "o", &y);
              -  if (mrb_fixnum_p(x) && mrb_fixnum_p(y)) {
              -    /* try ipow() */
              -    mrb_int base = mrb_fixnum(x);
              -    mrb_int exp = mrb_fixnum(y);
              -    mrb_int result = 1;
              -
              -    if (exp < 0)
              -#ifdef MRB_WITHOUT_FLOAT
              -      return mrb_fixnum_value(0);
              -#else
              -      goto float_pow;
              -#endif
              -    for (;;) {
              -      if (exp & 1) {
              -        if (mrb_int_mul_overflow(result, base, &result)) {
              -#ifndef MRB_WITHOUT_FLOAT
              -          goto float_pow;
              -#endif
              -        }
              -      }
              -      exp >>= 1;
              -      if (exp == 0) break;
              -      if (mrb_int_mul_overflow(base, base, &base)) {
              -#ifndef MRB_WITHOUT_FLOAT
              -        goto float_pow;
              -#endif
              -      }
              -    }
              -    return mrb_fixnum_value(result);
              -  }
              -#ifdef MRB_WITHOUT_FLOAT
              -  mrb_raise(mrb, E_TYPE_ERROR, "non fixnum value");
              -#else
              - float_pow:
              -  d = pow(mrb_to_flo(mrb, x), mrb_to_flo(mrb, y));
              -  return mrb_float_value(mrb, d);
              -#endif
              -}
              -
              -
              - -
              -

              - - #+@Object + #+@Object @@ -693,7 +440,7 @@

              - #-@Object + #-@Object @@ -735,9 +482,9 @@

              -

              +

              - #quo(numeric) ⇒ Object + #absObject @@ -745,15 +492,15 @@

              -

              Returns most exact division.

              +

              Returns the absolute value of the receiver.

              + +

              ISO 15.2.7.4.3

              - -
              @@ -763,55 +510,33 @@

               
               
              -138
              -139
              -140
              -141
              -142
              -143
              -144
              -145
              -146
              -147
              -148
              -149
              -150
              -151
              -152
              -153
              -154
              -155
              +27 +28 +29 +30 +31 +32 +33

      -
      # File 'src/numeric.c', line 138
      +      
      # File 'mrblib/numeric.rb', line 27
       
      -static mrb_value
      -num_div(mrb_state *mrb, mrb_value x)
      -{
      -#ifdef MRB_WITHOUT_FLOAT
      -  mrb_value y;
      -
      -  mrb_get_args(mrb, "o", &y);
      -  if (!mrb_fixnum_p(y)) {
      -    mrb_raise(mrb, E_TYPE_ERROR, "non fixnum value");
      -  }
      -  return mrb_fixnum_value(mrb_fixnum(x) / mrb_fixnum(y));
      -#else
      -  mrb_float y;
      -
      -  mrb_get_args(mrb, "f", &y);
      -  return mrb_float_value(mrb, mrb_to_flo(mrb, x) / y);
      -#endif
      -}
      +def abs + if self < 0 + -self + else + self + end +end
      -

      +

      - #<Object + #finite?Boolean @@ -819,13 +544,26 @@

      -

      15.2.9.3.6

      +

      15.2.7

      +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      @@ -835,81 +573,19 @@

       
       
      -1452
      -1453
      -1454
      -1455
      -1456
      -1457
      -1458
      -1459
      -1460
      -1461
      -1462
      -1463
      - - -
      # File 'src/numeric.c', line 1452
      -
      -static mrb_value
      -num_lt(mrb_state *mrb, mrb_value self)
      -{
      -  mrb_value other;
      -  mrb_int n;
      -
      -  mrb_get_args(mrb, "o", &other);
      -  n = cmpnum(mrb, self, other);
      -  if (n == -2) cmperr(mrb, self, other);
      -  if (n < 0) return mrb_true_value();
      -  return mrb_false_value();
      -}
      - - - -

      - -
      -

      - - #<=Object - - - - - -

      - - @@ -917,13 +593,9 @@

      -

      +

      - - #<=>(other.f) ⇒ -1, ... - - #<-1 - + #infinite?Boolean @@ -931,26 +603,6 @@

      -
      -

      => +1 - Comparison—Returns -1, 0, or +1 depending on whether fix is - less than, equal to, or greater than numeric. This is the - basis for the tests in Comparable.

      -
      - - -
      -
      -
      - -

      Overloads:

      -
        - - -
      • - #<=>(other.f) ⇒ -1, ... -
        -
        @@ -964,38 +616,7 @@

      • - (-1, 0, +1) - - - -
      • - -

      - -
      - - - - - -
    1566. - #<-1 -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (-1) + (Boolean) @@ -1003,14 +624,6 @@

      -
      - - -
    1567. - - - -

      -
      -
      -
      -1465
      -1466
      -1467
      -1468
      -1469
      -1470
      -1471
      -1472
      -1473
      -1474
      -1475
      -1476
      +1576 +1577 +1578 +1579 +1580
      -
      # File 'src/numeric.c', line 1465
      +      
      # File 'src/numeric.c', line 1576
       
       static mrb_value
      -num_le(mrb_state *mrb, mrb_value self)
      +num_finite_p(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value other;
      -  mrb_int n;
      -
      -  mrb_get_args(mrb, "o", &other);
      -  n = cmpnum(mrb, self, other);
      -  if (n == -2) cmperr(mrb, self, other);
      -  if (n <= 0) return mrb_true_value();
      -  return mrb_false_value();
      +  return mrb_true_value();
       }
      @@ -1019,78 +632,18 @@

       
       
      -1432
      -1433
      -1434
      -1435
      -1436
      -1437
      -1438
      -1439
      -1440
      -1441
      -1442
      - -

      - -
      -
      # File 'src/numeric.c', line 1432
      -
      -static mrb_value
      -num_cmp(mrb_state *mrb, mrb_value self)
      -{
      -  mrb_value other;
      -  mrb_int n;
      -
      -  mrb_get_args(mrb, "o", &other);
      -  n = cmpnum(mrb, self, other);
      -  if (n == -2) return mrb_nil_value();
      -  return mrb_fixnum_value(n);
      -}
      -
      -
      - -
      -

      - - #>Object - - - - - -

      - - @@ -1099,111 +652,64 @@

      -

      +

      - #>=Object + #negative?Boolean -

      -
      -
      -
      -1478
      -1479
      -1480
      -1481
      -1482
      -1483
      -1484
      -1485
      -1486
      -1487
      -1488
      -1489
      +1582 +1583 +1584 +1585 +1586
      -
      # File 'src/numeric.c', line 1478
      +      
      # File 'src/numeric.c', line 1582
       
       static mrb_value
      -num_gt(mrb_state *mrb, mrb_value self)
      +num_infinite_p(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value other;
      -  mrb_int n;
      -
      -  mrb_get_args(mrb, "o", &other);
      -  n = cmpnum(mrb, self, other);
      -  if (n == -2) cmperr(mrb, self, other);
      -  if (n > 0) return mrb_true_value();
         return mrb_false_value();
       }
      - - - - -
      -
      -
      -
      -1491
      -1492
      -1493
      -1494
      -1495
      -1496
      -1497
      -1498
      -1499
      -1500
      -1501
      -1502
      -
      -
      # File 'src/numeric.c', line 1491
      +
      +
      + -static mrb_value -num_ge(mrb_state *mrb, mrb_value self) -{ - mrb_value other; - mrb_int n; - mrb_get_args(mrb, "o", &other); - n = cmpnum(mrb, self, other); - if (n == -2) cmperr(mrb, self, other); - if (n >= 0) return mrb_true_value(); - return mrb_false_value(); -}
      -
      +
      - -
      -

      +
      - #__coerce_step_counterObject +

      Returns:

      +
        - +
      • + + + (Boolean) + + + +
      • +
      - -

      + + +
       
       
      -157
      -158
      -159
      -160
      -161
      -162
      -163
      -164
      -165
      -166
      -167
      -168
      -169
      -170
      -171
      +18 +19 +20
      -
      # File 'src/numeric.c', line 157
      -
      -static mrb_value
      -num_coerce_step_counter(mrb_state *mrb, mrb_value self)
      -{
      -  mrb_value counter = self, num, step;
      -
      -  mrb_get_args(mrb, "oo", &num, &step);
      -
      -#ifndef MRB_WITHOUT_FLOAT
      -  if (mrb_float_p(self) || mrb_float_p(num) || mrb_float_p(step)) {
      -    counter = mrb_funcall(mrb, counter, "to_f", 0);
      -  }
      -#endif
      +      
      # File 'mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb', line 18
       
      -  return counter;
      -}
      +def negative? + self < 0 +end
      -

      +

      - #absObject + #nonzero?Boolean @@ -1211,15 +717,26 @@

      -

      Returns the absolute value of the receiver.

      - -

      ISO 15.2.7.4.3

      +
      +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      @@ -1229,20 +746,20 @@

       
       
      -27
      -28
      -29
      -30
      -31
      -32
      -33
      +6 +7 +8 +9 +10 +11 +12

      -
      # File 'mrblib/numeric.rb', line 27
      +      
      # File 'mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb', line 6
       
      -def abs
      -  if self < 0
      -    -self
      +def nonzero?
      +  if self == 0
      +    nil
         else
           self
         end
      @@ -1253,9 +770,9 @@ 

      -

      +

      - #finite?Boolean + #positive?Boolean @@ -1292,92 +809,55 @@

       
       
      -1504
      -1505
      -1506
      -1507
      -1508
      -1509
      +14 +15 +16

      -
      # File 'src/numeric.c', line 1504
      +      
      # File 'mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb', line 14
       
      -static mrb_value
      -num_finite_p(mrb_state *mrb, mrb_value self)
      -{
      -  mrb_get_args(mrb, "");
      -  return mrb_true_value();
      -}
      +def positive? + self > 0 +end
      -

      +

      - #infinite?Boolean - - + #to_rObject -

      -
      - - -
      -
      -
      -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - +
       
       
      -1511
      -1512
      -1513
      -1514
      -1515
      -1516
      +80 +81 +82
      -
      # File 'src/numeric.c', line 1511
      +      
      # File 'mrbgems/mruby-rational/mrblib/rational.rb', line 80
       
      -static mrb_value
      -num_infinite_p(mrb_state *mrb, mrb_value self)
      -{
      -  mrb_get_args(mrb, "");
      -  return mrb_false_value();
      -}
      +def to_r + Rational(self, 1) +end
      -

      +

      - #quo(numeric) ⇒ Object + #zero?Boolean @@ -1385,15 +865,26 @@

      -

      Returns most exact division.

      +
      +

      Returns:

      +
        - +
      • + + + (Boolean) + + + +
      • + +
      @@ -1403,46 +894,16 @@

       
       
      -138
      -139
      -140
      -141
      -142
      -143
      -144
      -145
      -146
      -147
      -148
      -149
      -150
      -151
      -152
      -153
      -154
      -155
      +2 +3 +4

      -
      # File 'src/numeric.c', line 138
      +      
      # File 'mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb', line 2
       
      -static mrb_value
      -num_div(mrb_state *mrb, mrb_value x)
      -{
      -#ifdef MRB_WITHOUT_FLOAT
      -  mrb_value y;
      -
      -  mrb_get_args(mrb, "o", &y);
      -  if (!mrb_fixnum_p(y)) {
      -    mrb_raise(mrb, E_TYPE_ERROR, "non fixnum value");
      -  }
      -  return mrb_fixnum_value(mrb_fixnum(x) / mrb_fixnum(y));
      -#else
      -  mrb_float y;
      -
      -  mrb_get_args(mrb, "f", &y);
      -  return mrb_float_value(mrb, mrb_to_flo(mrb, x) / y);
      -#endif
      -}
      +def zero? + self == 0 +end
      @@ -1453,9 +914,9 @@

      diff --git a/docs/api/Object.html b/docs/api/Object.html deleted file mode 100644 index b775126..0000000 --- a/docs/api/Object.html +++ /dev/null @@ -1,273 +0,0 @@ - - - - - - - Class: Object - - — Documentation by YARD 0.9.19 - - - - - - - - - - - - - - - - - - - - - - - -
      - - -

      Class: Object - - - -

      -
      - -
      -
      Inherits:
      -
      - BasicObject - -
      -
      - - - - - - - - - - - -
      -
      Defined in:
      -
      mrbgems/mruby-object-ext/mrblib/object.rb
      -
      - -
      - - - - - - - - - -

      - Instance Method Summary - collapse -

      - - - - - - -
      -

      Instance Method Details

      - - -
      -

      - - #tap {|_self| ... } ⇒ Object - - - - - -

      -
      -

      call-seq: - obj.tap{|x|…} -> obj

      - -

      Yields x to the block, and then returns x. - The primary purpose of this method is to “tap into” a method chain, - in order to perform operations on intermediate results within the chain.

      - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      (1..10) .tap xputs “original: #{x.inspect”}  
      .to_a .tap xputs “array: #{x.inspect”}  
      .select xx%2==0 .tap xputs “evens: #{x.inspect”}
      .map {xx*x } .tap xputs “squares: #{x.inspect”}
      - - -
      -
      -
      - -

      Yields:

      -
        - -
      • - - - (_self) - - - -
      • - -
      -

      Yield Parameters:

      -
        - -
      • - - _self - - - (Object) - - - - — -

        the object that the method was called on

        -
        - -
      • - -
      - -
      - - - - - - -
      -
      -
      -
      -15
      -16
      -17
      -18
      -
      -
      # File 'mrbgems/mruby-object-ext/mrblib/object.rb', line 15
      -
      -def tap
      -  yield self
      -  self
      -end
      -
      -
      - -
      - -
      - - - -
      - - \ No newline at end of file diff --git a/docs/api/ObjectSpace.html b/docs/api/ObjectSpace.html index 4ac1009..53b4903 100644 --- a/docs/api/ObjectSpace.html +++ b/docs/api/ObjectSpace.html @@ -6,7 +6,7 @@ Module: ObjectSpace - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -99,9 +99,9 @@ diff --git a/docs/api/Proc.html b/docs/api/Proc.html index f020410..ddaefdf 100644 --- a/docs/api/Proc.html +++ b/docs/api/Proc.html @@ -6,7 +6,7 @@ Class: Proc - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
      Inherits:
      - Object + Object
        -
      • Object
      • +
      • Object
      • @@ -282,7 +282,7 @@

        Instance Method Details

        - #<<(other) ⇒ Object + #<<(other) ⇒ Object @@ -312,7 +312,7 @@

        - #===(*args) ⇒ Object + #===(*args) ⇒ Object @@ -342,7 +342,7 @@

        - #>>(other) ⇒ Object + #>>(other) ⇒ Object @@ -372,7 +372,7 @@

        - #curry(arity = self.arity) ⇒ Object + #curry(arity = self.arity) ⇒ Object @@ -448,7 +448,7 @@

        - #to_procObject + #to_procObject @@ -478,7 +478,7 @@

        - #yield(*args) ⇒ Object + #yield(*args) ⇒ Object @@ -510,9 +510,9 @@

        diff --git a/docs/api/Random.html b/docs/api/Random.html index 76ba1b7..ff3b93b 100644 --- a/docs/api/Random.html +++ b/docs/api/Random.html @@ -6,7 +6,7 @@ Class: Random - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
        Inherits:
        - Object + Object
          -
        • Object
        • +
        • Object
        • @@ -198,7 +198,7 @@

          Constructor Details

          - #initializeObject + #initializeObject @@ -210,72 +210,44 @@

           
           
          -121
          -122
          -123
          -124
          -125
          -126
          -127
          -128
          -129
          -130
          -131
          -132
          -133
          -134
          -135
          -136
          -137
          -138
          -139
          -140
          -141
          -142
          -143
          -144
          -145
          -146
          -147
          -148
          -149
          -150
          -151
          -152
          +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174

      -
      # File 'mrbgems/mruby-random/src/random.c', line 121
      +      
      # File 'mrbgems/mruby-random/src/random.c', line 157
       
       static mrb_value
      -mrb_random_init(mrb_state *mrb, mrb_value self)
      +random_m_init(mrb_state *mrb, mrb_value self)
       {
         mrb_value seed;
      -  mt_state *t;
      +  rand_state *t;
       
         seed = get_opt(mrb);
      -
         /* avoid memory leaks */
      -  t = (mt_state*)DATA_PTR(self);
      -  if (t) {
      -    mrb_free(mrb, t);
      -  }
      -  mrb_data_init(self, NULL, &mt_state_type);
      -
      -  t = (mt_state *)mrb_malloc(mrb, sizeof(mt_state));
      -  t->mti = N + 1;
      -
      -  seed = mrb_random_mt_srand(mrb, t, seed);
      +  t = random_ptr(self);
         if (mrb_nil_p(seed)) {
      -    t->has_seed = FALSE;
      +    rand_init(t);
         }
         else {
      -    mrb_assert(mrb_fixnum_p(seed));
      -    t->has_seed = TRUE;
      -    t->seed = mrb_fixnum(seed);
      +    rand_seed(t, (uint32_t)mrb_fixnum(seed));
         }
       
      -  mrb_data_init(self, t, &mt_state_type);
      -
         return self;
       }
      @@ -293,7 +265,7 @@

      Instance Method Details

      - #randObject + #randObject @@ -305,29 +277,27 @@

       
       
      -162
      -163
      -164
      -165
      -166
      -167
      -168
      -169
      -170
      -171
      +176 +177 +178 +179 +180 +181 +182 +183 +184

      -
      # File 'mrbgems/mruby-random/src/random.c', line 162
      +      
      # File 'mrbgems/mruby-random/src/random.c', line 176
       
       static mrb_value
      -mrb_random_rand(mrb_state *mrb, mrb_value self)
      +random_m_rand(mrb_state *mrb, mrb_value self)
       {
         mrb_value max;
      -  mt_state *t = DATA_GET_PTR(mrb, self, &mt_state_type, mt_state);
      +  rand_state *t = random_ptr(self);
       
         max = get_opt(mrb);
      -  mrb_random_rand_seed(mrb, t);
      -  return mrb_random_mt_rand(mrb, t, max);
      +  return random_rand(mrb, t, max);
       }
      @@ -337,7 +307,7 @@

      - #srandObject + #srandObject @@ -349,19 +319,6 @@

       
       
      -173
      -174
      -175
      -176
      -177
      -178
      -179
      -180
      -181
      -182
      -183
      -184
      -185
       186
       187
       188
      @@ -369,31 +326,40 @@ 

      190 191 192 -193

      +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204

      -
      # File 'mrbgems/mruby-random/src/random.c', line 173
      +      
      # File 'mrbgems/mruby-random/src/random.c', line 186
       
       static mrb_value
      -mrb_random_srand(mrb_state *mrb, mrb_value self)
      +random_m_srand(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value seed;
      -  mrb_value old_seed;
      -  mt_state *t = DATA_GET_PTR(mrb, self, &mt_state_type, mt_state);
      -
      -  seed = get_opt(mrb);
      -  seed = mrb_random_mt_srand(mrb, t, seed);
      -  old_seed = t->has_seed? mrb_fixnum_value(t->seed) : mrb_nil_value();
      -  if (mrb_nil_p(seed)) {
      -    t->has_seed = FALSE;
      +  uint32_t seed;
      +  uint32_t old_seed;
      +  mrb_value sv;
      +  rand_state *t = random_ptr(self);
      +
      +  sv = get_opt(mrb);
      +  if (mrb_nil_p(sv)) {
      +    seed = (uint32_t)time(NULL) + rand_uint32(t);
         }
         else {
      -    mrb_assert(mrb_fixnum_p(seed));
      -    t->has_seed = TRUE;
      -    t->seed = mrb_fixnum(seed);
      +    seed = (uint32_t)mrb_fixnum(sv);
         }
      +  old_seed = rand_seed(t, seed);
       
      -  return old_seed;
      +  return mrb_fixnum_value((mrb_int)old_seed);
       }
      @@ -405,9 +371,9 @@

      diff --git a/docs/api/Range.html b/docs/api/Range.html index eecbb0a..cf56ad7 100644 --- a/docs/api/Range.html +++ b/docs/api/Range.html @@ -6,7 +6,7 @@ Class: Range - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
      Inherits:
      - Object + Object
        -
      • Object
      • +
      • Object
      • @@ -211,6 +211,52 @@

        redefine #hash 15.3.1.3.15.

        + + + +
      • + + + #max(&block) ⇒ Object + + + + + + + + + + + + + +
        +
        + +
      • + + +
      • + + + #min(&block) ⇒ Object + + + + + + + + + + + + + +
        +
        +
      • @@ -227,7 +273,7 @@

        Methods included from Enumerable

        -

        #+, __update_hash, #all?, #any?, #chain, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #find_all, #find_index, #flat_map, #grep, #group_by, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #sort, #sort_by, #take, #take_while, #to_h, to_h, #uniq, #zip

        +

        __update_hash, #all?, #any?, #chain, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #filter_map, #find_all, #find_index, #flat_map, #grep, #group_by, #include?, #inject, #lazy, #max_by, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #sort, #sort_by, #take, #take_while, #tally, #to_h, #uniq, #zip

        @@ -237,7 +283,7 @@

        Instance Method Details

        - #each(&block) ⇒ Object + #each(&block) ⇒ Object @@ -338,7 +384,7 @@

        return self end - if val.kind_of?(String) && last.kind_of?(String) # fixnums are special + if val.kind_of?(String) && last.kind_of?(String) # strings are special if val.respond_to? :upto return val.upto(last, exclude_end?, &block) else @@ -369,7 +415,7 @@

        - #first(*args) ⇒ Object + #first(*args) ⇒ Object @@ -456,7 +502,7 @@

        - #hashObject + #hashObject @@ -497,6 +543,126 @@

        +

        + +
        +

        + + #max(&block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +29
        +30
        +31
        +32
        +33
        +34
        +35
        +36
        +37
        +38
        +39
        +40
        +41
        +42
        +43
        +44
        +45
        +46
        +47
        +
        +
        # File 'mrbgems/mruby-range-ext/mrblib/range.rb', line 29
        +
        +def max(&block)
        +  val = self.first
        +  last = self.last
        +  return super if block
        +
        +  # fast path for numerics
        +  if val.kind_of?(Numeric) && last.kind_of?(Numeric)
        +    raise TypeError if exclude_end? && !last.kind_of?(Fixnum)
        +    return nil if val > last
        +    return nil if val == last && exclude_end?
        +
        +    max = last
        +    max -= 1 if exclude_end?
        +    return max
        +  end
        +
        +  # delegate to Enumerable
        +  super
        +end
        +
        +
        + +
        +

        + + #min(&block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +49
        +50
        +51
        +52
        +53
        +54
        +55
        +56
        +57
        +58
        +59
        +60
        +61
        +62
        +63
        +64
        +65
        +
        +
        # File 'mrbgems/mruby-range-ext/mrblib/range.rb', line 49
        +
        +def min(&block)
        +  val = self.first
        +  last = self.last
        +  return super if block
        +
        +  # fast path for numerics
        +  if val.kind_of?(Numeric) && last.kind_of?(Numeric)
        +    return nil if val > last
        +    return nil if val == last && exclude_end?
        +
        +    min = val
        +    return min
        +  end
        +
        +  # delegate to Enumerable
        +  super
        +end
        +

        @@ -504,9 +670,9 @@

        diff --git a/docs/api/RangeError.html b/docs/api/RangeError.html index 874c5e4..ef0a8f8 100644 --- a/docs/api/RangeError.html +++ b/docs/api/RangeError.html @@ -6,7 +6,7 @@ Exception: RangeError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ StandardError
          -
        • Object
        • +
        • Object
        • @@ -158,9 +158,9 @@

          Constructor Details

          diff --git a/docs/api/Rational.html b/docs/api/Rational.html new file mode 100644 index 0000000..680b781 --- /dev/null +++ b/docs/api/Rational.html @@ -0,0 +1,678 @@ + + + + + + + Class: Rational + + — Documentation by YARD 0.9.20 + + + + + + + + + + + + + + + + + + + + + + + +
          + + +

          Class: Rational + + + +

          +
          + +
          +
          Inherits:
          +
          + Numeric + +
            +
          • Object
          • + + + + + +
          + show all + +
          +
          + + + + + + + + + + + +
          +
          Defined in:
          +
          mrbgems/mruby-rational/mrblib/rational.rb
          +
          + +
          + + + + + + + + + +

          + Instance Method Summary + collapse +

          + + + + + + + + + + + + + +

          Methods inherited from Numeric

          +

          #+@, #-@, #abs, #finite?, #infinite?, #negative?, #nonzero?, #positive?, #to_r, #zero?

          + + + + + + + + + +

          Methods included from Comparable

          +

          #<, #<=, #>, #>=, #between?, #clamp

          + + +
          +

          Instance Method Details

          + + +
          +

          + + #*(rhs) ⇒ Object + + + + + +

          + + + + +
          +
          +
          +
          +10
          +11
          +12
          +13
          +14
          +15
          +16
          +17
          +18
          +
          +
          # File 'mrbgems/mruby-rational/mrblib/rational.rb', line 10
          +
          +def *(rhs)
          +  if rhs.is_a? Rational
          +    Rational(numerator * rhs.numerator, denominator * rhs.denominator)
          +  elsif rhs.is_a? Integer
          +    Rational(numerator * rhs, denominator)
          +  elsif rhs.is_a? Numeric
          +    numerator * rhs / denominator
          +  end
          +end
          +
          +
          + +
          +

          + + #+(rhs) ⇒ Object + + + + + +

          + + + + +
          +
          +
          +
          +20
          +21
          +22
          +23
          +24
          +25
          +26
          +27
          +28
          +
          +
          # File 'mrbgems/mruby-rational/mrblib/rational.rb', line 20
          +
          +def +(rhs)
          +  if rhs.is_a? Rational
          +    Rational(numerator * rhs.denominator + rhs.numerator * denominator, denominator * rhs.denominator)
          +  elsif rhs.is_a? Integer
          +    Rational(numerator + rhs * denominator, denominator)
          +  elsif rhs.is_a? Numeric
          +    (numerator + rhs * denominator) / denominator
          +  end
          +end
          +
          +
          + +
          +

          + + #-(rhs) ⇒ Object + + + + + +

          + + + + +
          +
          +
          +
          +30
          +31
          +32
          +33
          +34
          +35
          +36
          +37
          +38
          +
          +
          # File 'mrbgems/mruby-rational/mrblib/rational.rb', line 30
          +
          +def -(rhs)
          +  if rhs.is_a? Rational
          +    Rational(numerator * rhs.denominator - rhs.numerator * denominator, denominator * rhs.denominator)
          +  elsif rhs.is_a? Integer
          +    Rational(numerator - rhs * denominator, denominator)
          +  elsif rhs.is_a? Numeric
          +    (numerator - rhs * denominator) / denominator
          +  end
          +end
          +
          +
          + +
          +

          + + #/(rhs) ⇒ Object + + + + + +

          + + + + +
          +
          +
          +
          +40
          +41
          +42
          +43
          +44
          +45
          +46
          +47
          +48
          +
          +
          # File 'mrbgems/mruby-rational/mrblib/rational.rb', line 40
          +
          +def /(rhs)
          +  if rhs.is_a? Rational
          +    Rational(numerator * rhs.denominator, denominator * rhs.numerator)
          +  elsif rhs.is_a? Integer
          +    Rational(numerator, denominator * rhs)
          +  elsif rhs.is_a? Numeric
          +    numerator / rhs / denominator
          +  end
          +end
          +
          +
          + +
          +

          + + #<=>(rhs) ⇒ Object + + + + + +

          + + + + +
          +
          +
          +
          +50
          +51
          +52
          +53
          +54
          +55
          +56
          +57
          +58
          +59
          +60
          +61
          +62
          +63
          +64
          +
          +
          # File 'mrbgems/mruby-rational/mrblib/rational.rb', line 50
          +
          +def <=>(rhs)
          +  if rhs.is_a?(Integral)
          +    return numerator <=> rhs if denominator == 1
          +    rhs = Rational(rhs)
          +  end
          +
          +  case rhs
          +  when Rational
          +    (numerator * rhs.denominator - denominator * rhs.numerator) <=> 0
          +  when Numeric
          +    (rhs <=> self)&.-@
          +  else
          +    nil
          +  end
          +end
          +
          +
          + +
          +

          + + #==(rhs) ⇒ Object + + + + + +

          + + + + +
          +
          +
          +
          +66
          +67
          +68
          +69
          +70
          +71
          +72
          +73
          +74
          +75
          +76
          +
          +
          # File 'mrbgems/mruby-rational/mrblib/rational.rb', line 66
          +
          +def ==(rhs)
          +  return true if self.equal?(rhs)
          +  if rhs.is_a?(Integral) && denominator == 1
          +    return numerator == rhs
          +  end
          +  if rhs.is_a?(Rational)
          +    numerator * rhs.denominator == denominator * rhs.numerator
          +  else
          +    rhs == self
          +  end
          +end
          +
          +
          + +
          +

          + + #inspectObject + + + + + +

          + + + + +
          +
          +
          +
          +2
          +3
          +4
          +
          +
          # File 'mrbgems/mruby-rational/mrblib/rational.rb', line 2
          +
          +def inspect
          +  "(#{to_s})"
          +end
          +
          +
          + +
          +

          + + #to_sObject + + + + + +

          + + + + +
          +
          +
          +
          +6
          +7
          +8
          +
          +
          # File 'mrbgems/mruby-rational/mrblib/rational.rb', line 6
          +
          +def to_s
          +  "#{numerator}/#{denominator}"
          +end
          +
          +
          + +
          + +
          + + + +
          + + \ No newline at end of file diff --git a/docs/api/RegexpError.html b/docs/api/RegexpError.html index cca5394..5623683 100644 --- a/docs/api/RegexpError.html +++ b/docs/api/RegexpError.html @@ -6,7 +6,7 @@ Exception: RegexpError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ StandardError
            -
          • Object
          • +
          • Object
          • @@ -154,9 +154,9 @@

            Constructor Details

            diff --git a/docs/api/ScriptError.html b/docs/api/ScriptError.html index 5b0dacd..231e23f 100644 --- a/docs/api/ScriptError.html +++ b/docs/api/ScriptError.html @@ -6,7 +6,7 @@ Exception: ScriptError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ Exception
              -
            • Object
            • +
            • Object
            • @@ -150,9 +150,9 @@

              Constructor Details

              diff --git a/docs/api/Socket.html b/docs/api/Socket.html index 1e96081..f93f74b 100644 --- a/docs/api/Socket.html +++ b/docs/api/Socket.html @@ -6,7 +6,7 @@ Class: Socket - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ BasicSocket
                -
              • Object
              • +
              • Object
              • @@ -608,7 +608,7 @@

                Class Method Details

                - .getaddrinfo(nodename, servname, family = nil, socktype = nil, protocol = nil, flags = 0) ⇒ Object + .getaddrinfo(nodename, servname, family = nil, socktype = nil, protocol = nil, flags = 0) ⇒ Object @@ -664,7 +664,7 @@

                - .open(*args) ⇒ Object + .open(*args) ⇒ Object @@ -707,7 +707,7 @@

                - .sockaddr_in(port, host) ⇒ Object + .sockaddr_in(port, host) ⇒ Object @@ -743,7 +743,7 @@

                - .unpack_sockaddr_in(sa) ⇒ Object + .unpack_sockaddr_in(sa) ⇒ Object @@ -794,7 +794,7 @@

                - .unpack_sockaddr_un(sa) ⇒ Object + .unpack_sockaddr_un(sa) ⇒ Object @@ -830,7 +830,7 @@

                Instance Method Details

                - #acceptObject + #acceptObject @@ -862,7 +862,7 @@

                - #accept_nonblockObject + #accept_nonblockObject @@ -902,7 +902,7 @@

                - #bind(sockaddr) ⇒ Object + #bind(sockaddr) ⇒ Object @@ -936,7 +936,7 @@

                - #connect(sockaddr) ⇒ Object + #connect(sockaddr) ⇒ Object @@ -970,7 +970,7 @@

                - #connect_nonblock(sockaddr) ⇒ Object + #connect_nonblock(sockaddr) ⇒ Object @@ -1010,7 +1010,7 @@

                - #listen(backlog) ⇒ Object + #listen(backlog) ⇒ Object @@ -1054,7 +1054,7 @@

                - #recvfrom(maxlen, flags = 0) ⇒ Object + #recvfrom(maxlen, flags = 0) ⇒ Object @@ -1088,7 +1088,7 @@

                - #recvfrom_nonblock(*args) ⇒ Object + #recvfrom_nonblock(*args) ⇒ Object @@ -1128,7 +1128,7 @@

                - #sysacceptObject + #sysacceptObject @@ -1160,9 +1160,9 @@

                diff --git a/docs/api/Socket/Constants.html b/docs/api/Socket/Constants.html index 1483a05..891770a 100644 --- a/docs/api/Socket/Constants.html +++ b/docs/api/Socket/Constants.html @@ -6,7 +6,7 @@ Module: Socket::Constants - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -104,9 +104,9 @@

                diff --git a/docs/api/Socket/Option.html b/docs/api/Socket/Option.html index 2170060..107c224 100644 --- a/docs/api/Socket/Option.html +++ b/docs/api/Socket/Option.html @@ -6,7 +6,7 @@ Class: Socket::Option - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
                Inherits:
                - Object + Object
                  -
                • Object
                • +
                • Object
                • @@ -494,7 +494,7 @@

                  Instance Attribute Details

                  - #dataObject (readonly) + #dataObject (readonly) @@ -539,7 +539,7 @@

                  - #familyObject (readonly) + #familyObject (readonly) @@ -584,7 +584,7 @@

                  - #levelObject (readonly) + #levelObject (readonly) @@ -629,7 +629,7 @@

                  - #optnameObject (readonly) + #optnameObject (readonly) @@ -679,7 +679,7 @@

                  Class Method Details

                  - .bool(family, level, optname, bool) ⇒ Object + .bool(family, level, optname, bool) ⇒ Object @@ -709,7 +709,7 @@

                  - .int(family, level, optname, integer) ⇒ Object + .int(family, level, optname, integer) ⇒ Object @@ -745,7 +745,7 @@

                  Instance Method Details

                  - #boolObject + #boolObject @@ -775,7 +775,7 @@

                  - #inspectObject + #inspectObject @@ -805,7 +805,7 @@

                  - #intObject + #intObject @@ -835,7 +835,7 @@

                  - #lingerObject + #lingerObject @@ -890,7 +890,7 @@

                  - #unpack(template) ⇒ Object + #unpack(template) ⇒ Object @@ -947,9 +947,9 @@

                  diff --git a/docs/api/SocketError.html b/docs/api/SocketError.html index d6ca9cb..bc3ccc3 100644 --- a/docs/api/SocketError.html +++ b/docs/api/SocketError.html @@ -6,7 +6,7 @@ Exception: SocketError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ StandardError

                  diff --git a/docs/api/StandardError.html b/docs/api/StandardError.html index d73d9e2..2fadf13 100644 --- a/docs/api/StandardError.html +++ b/docs/api/StandardError.html @@ -6,7 +6,7 @@ Exception: StandardError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ Exception

                  diff --git a/docs/api/StopIteration.html b/docs/api/StopIteration.html index e8fad85..16bdec3 100644 --- a/docs/api/StopIteration.html +++ b/docs/api/StopIteration.html @@ -6,7 +6,7 @@ Exception: StopIteration - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ IndexError
                    -
                  • Object
                  • +
                  • Object
                  • @@ -185,7 +185,7 @@

                    Instance Attribute Details

                    - #resultObject + #resultObject @@ -230,9 +230,9 @@

                  diff --git a/docs/api/String.html b/docs/api/String.html index eac360f..a47a1e4 100644 --- a/docs/api/String.html +++ b/docs/api/String.html @@ -6,7 +6,7 @@ Class: String - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
                  Inherits:
                  - Object + Object

      -
      # File 'src/string.c', line 1618
      +      
      # File 'src/string.c', line 1901
       
       static mrb_value
       mrb_str_init(mrb_state *mrb, mrb_value self)
      @@ -2651,7 +2628,7 @@ 

      Instance Method Details

      - #%(args) ⇒ Object + #%(args) ⇒ Object @@ -2743,41 +2720,42 @@

       
       
      -818
      -819
      -820
      -821
      -822
      -823
      -824
      -825
      -826
      -827
      -828
      -829
      -830
      -831
      -832
      -833
      -834
      -835
      -836
      -837
      -838
      -839
      -840
      -841
      -842
      -843
      -844
      -845
      -846
      -847
      -848
      -849
      +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973

      -
      # File 'src/string.c', line 818
      +      
      # File 'src/string.c', line 941
       
       static mrb_value
       mrb_str_times(mrb_state *mrb, mrb_value self)
      @@ -2796,7 +2774,7 @@ 

      len = RSTRING_LEN(self)*times; str2 = str_new(mrb, 0, len); - str_with_class(mrb, str2, self); + str_with_class(str2, self); p = RSTR_PTR(str2); if (len > 0) { n = RSTRING_LEN(self); @@ -2808,6 +2786,7 @@

      memcpy(p + n, p, len-n); } p[RSTR_LEN(str2)] = '\0'; + RSTR_COPY_ASCII_FLAG(str2, mrb_str_ptr(self)); return mrb_obj_value(str2); }

      @@ -2873,17 +2852,17 @@

       
       
      -777
      -778
      -779
      -780
      -781
      -782
      -783
      -784
      +900 +901 +902 +903 +904 +905 +906 +907

      -
      # File 'src/string.c', line 777
      +      
      # File 'src/string.c', line 900
       
       static mrb_value
       mrb_str_plus_m(mrb_state *mrb, mrb_value self)
      @@ -2919,7 +2898,8 @@ 

      Append—Concatenates the given object to str. If the object is a Integer, it is considered as a codepoint, and is converted -to a character before concatenation.

      +to a character before concatenation +(equivalent to str.concat(integer.chr(__ENCODING__))).

      a = “hello “ a « “world” #=> “hello world” @@ -3068,22 +3048,26 @@

       
       
      -157
      -158
      -159
      -160
      -161
      -162
      -163
       164
       165
       166
       167
       168
      -169
      +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 157
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 164
       
       static mrb_value
       mrb_str_concat_m(mrb_state *mrb, mrb_value self)
      @@ -3091,11 +3075,15 @@ 

      mrb_value str; mrb_get_args(mrb, "o", &str); - if (mrb_fixnum_p(str)) - str = mrb_fixnum_chr(mrb, str); + if (mrb_fixnum_p(str) || mrb_float_p(str)) +#ifdef MRB_UTF8_STRING + str = int_chr_utf8(mrb, str); +#else + str = int_chr_binary(mrb, str); +#endif else - str = mrb_ensure_string_type(mrb, str); - mrb_str_concat(mrb, self, str); + mrb_ensure_string_type(mrb, str); + mrb_str_cat_str(mrb, self, str); return self; }

      @@ -3175,38 +3163,24 @@

       
       
      -907
      -908
      -909
      -910
      -911
      -912
      -913
      -914
      -915
      -916
      -917
      -918
      -919
      -920
      -921
      -922
      -923
      -924
      -925
      -926
      -927
      -928
      -929
      -930
      -931
      -932
      -933
      -934
      -935
      +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045

      -
      # File 'src/string.c', line 907
      +      
      # File 'src/string.c', line 1031
       
       static mrb_value
       mrb_str_cmp_m(mrb_state *mrb, mrb_value str1)
      @@ -3216,21 +3190,7 @@ 

      mrb_get_args(mrb, "o", &str2); if (!mrb_string_p(str2)) { - if (!mrb_respond_to(mrb, str2, mrb_intern_lit(mrb, "to_s"))) { - return mrb_nil_value(); - } - else if (!mrb_respond_to(mrb, str2, mrb_intern_lit(mrb, "<=>"))) { - return mrb_nil_value(); - } - else { - mrb_value tmp = mrb_funcall(mrb, str2, "<=>", 1, str1); - - if (mrb_nil_p(tmp)) return mrb_nil_value(); - if (!mrb_fixnum_p(tmp)) { - return mrb_funcall(mrb, mrb_fixnum_value(0), "-", 1, tmp); - } - result = -mrb_fixnum(tmp); - } + return mrb_nil_value(); } else { result = mrb_str_cmp(mrb, str1, str2); @@ -3300,18 +3260,18 @@

       
       
      -966
      -967
      -968
      -969
      -970
      -971
      -972
      -973
      -974
      +1076 +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084

      -
      # File 'src/string.c', line 966
      +      
      # File 'src/string.c', line 1076
       
       static mrb_value
       mrb_str_equal_m(mrb_state *mrb, mrb_value str1)
      @@ -3325,48 +3285,6 @@ 

      - - -
      -

      - - #=~(re) ⇒ Object - - - - - -

      -
      -

      ISO 15.2.10.5.3

      - - -
      -
      -
      - - -
      - - - - - - -
      -
      -
      -
      -247
      -248
      -249
      -
      -
      # File 'mrblib/string.rb', line 247
      -
      -def =~(re)
      -  re =~ self
      -end
      -
      @@ -3754,47 +3672,31 @@

       
       
      -1120
      -1121
      -1122
      -1123
      -1124
      -1125
      -1126
      -1127
      -1128
      -1129
      -1130
      -1131
      -1132
      -1133
      -1134
      -1135
      -1136
      -1137
      -1138
      - - -
      # File 'src/string.c', line 1120
      -
      +1259
      +1260
      +1261
      +1262
      +1263
      +1264
      +1265
      +1266
      +1267
      +1268
      +1269
      + + +
      # File 'src/string.c', line 1259
      +
       static mrb_value
       mrb_str_aref_m(mrb_state *mrb, mrb_value str)
       {
         mrb_value a1, a2;
      -  mrb_int argc;
      -
      -  argc = mrb_get_args(mrb, "o|o", &a1, &a2);
      -  if (argc == 2) {
      -    mrb_int n1, n2;
       
      -    mrb_regexp_check(mrb, a1);
      -    mrb_get_args(mrb, "ii", &n1, &n2);
      -    return str_substr(mrb, str, n1, n2);
      +  if (mrb_get_args(mrb, "o|o", &a1, &a2) == 1) {
      +    a2 = mrb_undef_value();
         }
      -  if (argc != 1) {
      -    mrb_raisef(mrb, E_ARGUMENT_ERROR, "wrong number of arguments (%S for 1)", mrb_fixnum_value(argc));
      -  }
      -  return mrb_str_aref(mrb, str, a1);
      +
      +  return mrb_str_aref(mrb, str, a1, a2);
       }
      @@ -3804,7 +3706,19 @@

      - #[]=(*args) ⇒ Object + + #[]=(fixnum) ⇒ Object + + #[]=(fixnum, fixnum) ⇒ Object + + #[]=(range) ⇒ Object + + #[]=(regexp) ⇒ Object + + #[]=(regexp, fixnum) ⇒ Object + + #[]=(other_str) ⇒ Object + @@ -3829,108 +3743,42 @@

       
       
      -195
      -196
      -197
      -198
      -199
      -200
      -201
      -202
      -203
      -204
      -205
      -206
      -207
      -208
      -209
      -210
      -211
      -212
      -213
      -214
      -215
      -216
      -217
      -218
      -219
      -220
      -221
      -222
      -223
      -224
      -225
      -226
      -227
      -228
      -229
      -230
      -231
      -232
      -233
      -234
      -235
      -236
      -237
      -238
      -239
      -240
      -241
      -242
      -243
      - - -
      # File 'mrblib/string.rb', line 195
      -
      -def []=(*args)
      -  anum = args.size
      -  if anum == 2
      -    pos, value = args
      -    case pos
      -    when String
      -      posnum = self.index(pos)
      -      if posnum
      -        b = self[0, posnum.to_i]
      -        a = self[(posnum + pos.length)..-1]
      -        self.replace([b, value, a].join(''))
      -      else
      -        raise IndexError, "string not matched"
      -      end
      -    when Range
      -      head = pos.begin
      -      tail = pos.end
      -      tail += self.length if tail < 0
      -      unless pos.exclude_end?
      -        tail += 1
      -      end
      -      return self[head, tail-head]=value
      -    else
      -      pos += self.length if pos < 0
      -      if pos < 0 || pos > self.length
      -        raise IndexError, "index #{args[0]} out of string"
      -      end
      -      b = self[0, pos.to_i]
      -      a = self[pos + 1..-1]
      -      self.replace([b, value, a].join(''))
      -    end
      -    return value
      -  elsif anum == 3
      -    pos, len, value = args
      -    pos += self.length if pos < 0
      -    if pos < 0 || pos > self.length
      -      raise IndexError, "index #{args[0]} out of string"
      -    end
      -    if len < 0
      -      raise IndexError, "negative length #{len}"
      -    end
      -    b = self[0, pos.to_i]
      -    a = self[pos + len..-1]
      -    self.replace([b, value, a].join(''))
      -    return value
      -  else
      -    raise ArgumentError, "wrong number of arguments (#{anum} for 2..3)"
      -  end
      -end
      +1442 +1443 +1444 +1445 +1446 +1447 +1448 +1449 +1450 +1451 +1452 +1453 +1454 +1455 +1456 +1457

      + + +
      # File 'src/string.c', line 1442
      +
      +static mrb_value
      +mrb_str_aset_m(mrb_state *mrb, mrb_value str)
      +{
      +  mrb_value indx, alen, replace;
      +
      +  switch (mrb_get_args(mrb, "oo|S!", &indx, &alen, &replace)) {
      +    case 2:
      +      replace = alen;
      +      alen = mrb_undef_value();
      +      break;
      +    case 3:
      +      break;
      +  }
      +  mrb_str_aset(mrb, str, indx, alen, replace);
      +  return str;
      +}
      @@ -3939,7 +3787,7 @@

      - #__linesObject + #__linesObject @@ -3951,9 +3799,6 @@

       
       
      -1171
      -1172
      -1173
       1174
       1175
       1176
      @@ -3974,10 +3819,11 @@ 

      1191 1192 1193 -1194

      +1194 +1195

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 1171
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 1174
       
       static mrb_value
       mrb_str_lines(mrb_state *mrb, mrb_value self)
      @@ -3989,8 +3835,6 @@ 

      char *p = b, *t; char *e = b + RSTRING_LEN(self); - mrb_get_args(mrb, ""); - result = mrb_ary_new(mrb); ai = mrb_gc_arena_save(mrb); while (p < e) { @@ -4011,7 +3855,7 @@

      - #__sub_replace(pre, m, post) ⇒ Object + #__sub_replace(pre, m, post) ⇒ Object @@ -4035,33 +3879,33 @@

       
       
      -28
      -29
      -30
      -31
      -32
      -33
      -34
      -35
      -36
      -37
      -38
      -39
      -40
      -41
      -42
      -43
      -44
      -45
      -46
      -47
      -48
      -49
      -50
      -51
      +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78

      -
      # File 'mrblib/string.rb', line 28
      +      
      # File 'mrblib/string.rb', line 55
       
       def __sub_replace(pre, m, post)
         s = ""
      @@ -4095,7 +3939,7 @@ 

      - #bytesObject + #bytesObject @@ -4124,22 +3968,22 @@

       
       
      -2695
      -2696
      -2697
      -2698
      -2699
      -2700
      -2701
      -2702
      -2703
      -2704
      -2705
      -2706
      -2707
      +2765 +2766 +2767 +2768 +2769 +2770 +2771 +2772 +2773 +2774 +2775 +2776 +2777

      -
      # File 'src/string.c', line 2695
      +      
      # File 'src/string.c', line 2765
       
       static mrb_value
       mrb_str_bytes(mrb_state *mrb, mrb_value str)
      @@ -4162,7 +4006,7 @@ 

      - #bytesizeObject + #bytesizeObject @@ -4174,15 +4018,15 @@

       
       
      -801
      -802
      -803
      -804
      -805
      -806
      +924 +925 +926 +927 +928 +929

      -
      # File 'src/string.c', line 801
      +      
      # File 'src/string.c', line 924
       
       static mrb_value
       mrb_str_bytesize(mrb_state *mrb, mrb_value self)
      @@ -4198,105 +4042,209 @@ 

      - #bytesliceObject + + #byteslice(integer) ⇒ String? + + #byteslice(integer, integer) ⇒ String? + + #byteslice(range) ⇒ String? + -

      +
      +
      +

      Byte Reference—If passed a single Integer, returns a +substring of one byte at that position. If passed two Integer +objects, returns a substring starting at the offset given by the first, and +a length given by the second. If given a Range, a substring containing +bytes at offsets given by the range is returned. In all three cases, if +an offset is negative, it is counted from the end of str. Returns +nil if the initial offset falls outside the string, the length +is negative, or the beginning of the range is greater than the end. +The encoding of the resulted string keeps original encoding.

      + +

      “hello”.byteslice(1) #=> “e” + “hello”.byteslice(-1) #=> “o” + “hello”.byteslice(1, 2) #=> “el” + “\x80\u3042”.byteslice(1, 3) #=> “\u3042” + “\x03\u3042\xff”.byteslice(1..3) #=> “\u3042”

      + + +
      +
      +
      + +

      Overloads:

      +
        + + +
      • + #byteslice(integer) ⇒ String? +
        +
        + + + +
        +
        +
        + +

        Returns:

        +
          + +
        • + + + (String, nil) + + + +
        • + +
        + +
        + + +
      • + + +
      • + #byteslice(integer, integer) ⇒ String? +
        +
        + + + +
        +
        +
        + +

        Returns:

        +
          + +
        • + + + (String, nil) + + + +
        • + +
        + +
        + + +
      • + + +
      • + #byteslice(range) ⇒ String? +
        +
        + + + +
        +
        +
        + +

        Returns:

        +
          + +
        • + + + (String, nil) + + + +
        • + +
        + +
        + + +
      • + +
      + + +
      + +
      - + @@ -4362,18 +4310,18 @@

       
       
      -1189
      -1190
      -1191
      -1192
      -1193
      -1194
      -1195
      -1196
      -1197
      +1508 +1509 +1510 +1511 +1512 +1513 +1514 +1515 +1516

      - + @@ -5558,7 +5514,7 @@

      - #countObject + #countObject @@ -5590,16 +5546,6 @@

       
       
      -800
      -801
      -802
      -803
      -804
      -805
      -806
      -807
      -808
      -809
       810
       811
       812
      @@ -5612,10 +5558,20 @@ 

      819 820 821 -822

      +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832

      - + - + @@ -6744,7 +6488,7 @@

      - #each_byte(&block) ⇒ Object + #each_byte(&block) ⇒ Object @@ -6768,20 +6512,22 @@

       
       
      -182
      -183
      -184
      -185
      -186
      -187
      -188
      -189
      -190
      +194 +195 +196 +197 +198 +199 +200 +201 +202 +203

      @@ -6972,16 +6783,16 @@

       
       
      -1433
      -1434
      -1435
      -1436
      -1437
      -1438
      -1439
      +1751 +1752 +1753 +1754 +1755 +1756 +1757

      - + @@ -9382,13 +9143,7 @@

      - - #rindex(substring[, fixnum]) ⇒ Fixnum? - - #rindex(fixnum[, fixnum]) ⇒ Fixnum? - - #rindex(regexp[, fixnum]) ⇒ Fixnum? - + #rindex(substring[, offset]) ⇒ Fixnum? @@ -9396,92 +9151,22 @@

      -

      Returns the index of the last occurrence of the given substring, -character (fixnum), or pattern (regexp) in str. Returns -nil if not found. If the second parameter is present, it -specifies the position in the string to end the search—characters beyond -this point will not be considered.

      +

      Returns the index of the last occurrence of the given substring. +Returns nil if not found. If the second parameter is +present, it specifies the position in the string to end the +search—characters beyond this point will not be considered.

      “hello”.rindex(‘e’) #=> 1 “hello”.rindex(‘l’) #=> 3 “hello”.rindex(‘a’) #=> nil - “hello”.rindex(101) #=> 1 - “hello”.rindex(/[aeiou]/, -2) #=> 1

      - - -
      -
      -
      - -

      Overloads:

      -
        - - -
      • - #rindex(substring[, fixnum]) ⇒ Fixnum? -
        -
        - - - -
        -
        -
        - -

        Returns:

        -
          - -
        • - - - (Fixnum, nil) - - - -
        • - -
        - -
        - - -
      • - - -
      • - #rindex(fixnum[, fixnum]) ⇒ Fixnum? -
        -
        - + “hello”.rindex(‘l’, 2) #=> 2

        -

        Returns:

        -
          - -
        • - - - (Fixnum, nil) - - - -
        • - -
        - -
        - - -
      • - - -
      • - #rindex(regexp[, fixnum]) ⇒ Fixnum? -
        +
        @@ -9507,9 +9192,6 @@

        -
      • - -
      @@ -9520,116 +9202,64 @@

       
       
      -1798
      -1799
      -1800
      -1801
      -1802
      -1803
      -1804
      -1805
      -1806
      -1807
      -1808
      -1809
      -1810
      -1811
      -1812
      -1813
      -1814
      -1815
      -1816
      -1817
      -1818
      -1819
      -1820
      -1821
      -1822
      -1823
      -1824
      -1825
      -1826
      -1827
      -1828
      -1829
      -1830
      -1831
      -1832
      -1833
      -1834
      -1835
      -1836
      -1837
      -1838
      -1839
      -1840
      -1841
      -1842
      -1843
      -1844
      -1845
      -1846
      -1847
      -1848
      -1849
      -1850
      - -

      +
       
       
      -42
      -43
      -44
      -45
      -46
      -47
      -48
      -49
      -50
      -51
      -52
      -53
      -54
      -55
      -56
      -57
      -58
      -59
      -60
      -61
      -62
      -63
      -64
      -65
      -66
      -67
      -68
      -69
      -70
      -71
      -72
      -73
      -74
      -75
      -76
      -77
      -78
      -79
      -80
      -81
      -82
      -83
      -
      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 42
      +2847
      +2848
      +2849
      +2850
      +2851
      +2852
      +2853
      +2854
      +2855
      +2856
      +2857
      +2858
      +2859
      +2860
      +2861
      +2862
      +2863
      +2864
      +2865
      +2866
      +2867
      +2868
      +2869
      +2870
      +2871
      +2872
      +2873
      +2874
      +2875
      +
      +
      # File 'src/string.c', line 2847
       
       static mrb_value
       mrb_str_byteslice(mrb_state *mrb, mrb_value str)
       {
      -  mrb_value a1;
      -  mrb_int len;
      +  mrb_value a1, a2;
      +  mrb_int str_len = RSTRING_LEN(str), beg, len;
      +  mrb_bool empty = TRUE;
       
      -  if (mrb_get_argc(mrb) == 2) {
      -    mrb_int pos;
      -    mrb_get_args(mrb, "ii", &pos, &len);
      -    return mrb_str_substr(mrb, str, pos, len);
      +  if (mrb_get_args(mrb, "o|o", &a1, &a2) == 2) {
      +    beg = mrb_fixnum(mrb_to_int(mrb, a1));
      +    len = mrb_fixnum(mrb_to_int(mrb, a2));
         }
      -  mrb_get_args(mrb, "o|i", &a1, &len);
      -  switch (mrb_type(a1)) {
      -  case MRB_TT_RANGE:
      -    {
      -      mrb_int beg;
      -
      -      len = RSTRING_LEN(str);
      -      switch (mrb_range_beg_len(mrb, a1, &beg, &len, len, TRUE)) {
      -      case 0:                   /* not range */
      -        break;
      -      case 1:                   /* range */
      -        return mrb_str_substr(mrb, str, beg, len);
      -      case 2:                   /* out of range */
      -        mrb_raisef(mrb, E_RANGE_ERROR, "%S out of range", a1);
      -        break;
      -      }
      +  else if (mrb_range_p(a1)) {
      +    if (mrb_range_beg_len(mrb, a1, &beg, &len, str_len, TRUE) != MRB_RANGE_OK) {
             return mrb_nil_value();
           }
      -#ifndef MRB_WITHOUT_FLOAT
      -  case MRB_TT_FLOAT:
      -    a1 = mrb_fixnum_value((mrb_int)mrb_float(a1));
      -    /* fall through */
      -#endif
      -  case MRB_TT_FIXNUM:
      -    return mrb_str_substr(mrb, str, mrb_fixnum(a1), 1);
      -  default:
      -    mrb_raise(mrb, E_TYPE_ERROR, "wrong type of argument");
         }
      -  /* not reached */
      -  return mrb_nil_value();
      +  else {
      +    beg = mrb_fixnum(mrb_to_int(mrb, a1));
      +    len = 1;
      +    empty = FALSE;
      +  }
      +
      +  if (mrb_str_beg_len(str_len, &beg, &len) && (empty || len != 0)) {
      +    return mrb_str_byte_subseq(mrb, str, beg, len);
      +  }
      +  else {
      +    return mrb_nil_value();
      +  }
       }
      -
      # File 'src/string.c', line 1189
      +      
      # File 'src/string.c', line 1508
       
       static mrb_value
       mrb_str_capitalize(mrb_state *mrb, mrb_value self)
      @@ -4449,32 +4397,32 @@ 

       
       
      -1153
      -1154
      -1155
      -1156
      -1157
      -1158
      -1159
      -1160
      -1161
      -1162
      -1163
      -1164
      -1165
      -1166
      -1167
      -1168
      -1169
      -1170
      -1171
      -1172
      -1173
      -1174
      -1175
      +1472 +1473 +1474 +1475 +1476 +1477 +1478 +1479 +1480 +1481 +1482 +1483 +1484 +1485 +1486 +1487 +1488 +1489 +1490 +1491 +1492 +1493 +1494

      -
      # File 'src/string.c', line 1153
      +      
      # File 'src/string.c', line 1472
       
       static mrb_value
       mrb_str_capitalize_bang(mrb_state *mrb, mrb_value str)
      @@ -4483,7 +4431,7 @@ 

      mrb_bool modify = FALSE; struct RString *s = mrb_str_ptr(str); - mrb_str_modify(mrb, s); + mrb_str_modify_keep_ascii(mrb, s); if (RSTR_LEN(s) == 0 || !RSTR_PTR(s)) return mrb_nil_value(); p = RSTR_PTR(s); pend = RSTR_PTR(s) + RSTR_LEN(s); if (ISLOWER(*p)) { @@ -4507,7 +4455,7 @@

      - #casecmp(str) ⇒ Object + #casecmp(str) ⇒ Object @@ -4624,7 +4572,7 @@

      - #chars(&block) ⇒ Object + #chars(&block) ⇒ Object @@ -4677,9 +4625,8 @@

      Returns a new String with the given record separator removed -from the end of str (if present). If $/ has not been -changed from the default Ruby record separator, then chomp also -removes carriage return characters (that is it will remove \n, +from the end of str (if present). chomp also removes +carriage return characters (that is it will remove \n, \r, and \r\n).

      “hello”.chomp #=> “hello” @@ -4731,18 +4678,18 @@

       
       
      -1294
      -1295
      -1296
      -1297
      -1298
      -1299
      -1300
      -1301
      -1302
      +1612 +1613 +1614 +1615 +1616 +1617 +1618 +1619 +1620

      -
      # File 'src/string.c', line 1294
      +      
      # File 'src/string.c', line 1612
       
       static mrb_value
       mrb_str_chomp(mrb_state *mrb, mrb_value self)
      @@ -4813,76 +4760,76 @@ 

       
       
      -1207
      -1208
      -1209
      -1210
      -1211
      -1212
      -1213
      -1214
      -1215
      -1216
      -1217
      -1218
      -1219
      -1220
      -1221
      -1222
      -1223
      -1224
      -1225
      -1226
      -1227
      -1228
      -1229
      -1230
      -1231
      -1232
      -1233
      -1234
      -1235
      -1236
      -1237
      -1238
      -1239
      -1240
      -1241
      -1242
      -1243
      -1244
      -1245
      -1246
      -1247
      -1248
      -1249
      -1250
      -1251
      -1252
      -1253
      -1254
      -1255
      -1256
      -1257
      -1258
      -1259
      -1260
      -1261
      -1262
      -1263
      -1264
      -1265
      -1266
      -1267
      -1268
      -1269
      -1270
      -1271
      -1272
      -1273
      +1526 +1527 +1528 +1529 +1530 +1531 +1532 +1533 +1534 +1535 +1536 +1537 +1538 +1539 +1540 +1541 +1542 +1543 +1544 +1545 +1546 +1547 +1548 +1549 +1550 +1551 +1552 +1553 +1554 +1555 +1556 +1557 +1558 +1559 +1560 +1561 +1562 +1563 +1564 +1565 +1566 +1567 +1568 +1569 +1570 +1571 +1572 +1573 +1574 +1575 +1576 +1577 +1578 +1579 +1580 +1581 +1582 +1583 +1584 +1585 +1586 +1587 +1588 +1589 +1590 +1591 +1592

      -
      # File 'src/string.c', line 1207
      +      
      # File 'src/string.c', line 1526
       
       static mrb_value
       mrb_str_chomp_bang(mrb_state *mrb, mrb_value str)
      @@ -4896,7 +4843,7 @@ 

      struct RString *s = mrb_str_ptr(str); argc = mrb_get_args(mrb, "|S", &rs); - mrb_str_modify(mrb, s); + mrb_str_modify_keep_ascii(mrb, s); len = RSTR_LEN(s); if (argc == 0) { if (len == 0) return mrb_nil_value(); @@ -5020,17 +4967,17 @@

       
       
      -1363
      -1364
      -1365
      -1366
      -1367
      -1368
      -1369
      -1370
      +1681 +1682 +1683 +1684 +1685 +1686 +1687 +1688

      -
      # File 'src/string.c', line 1363
      +      
      # File 'src/string.c', line 1681
       
       static mrb_value
       mrb_str_chop(mrb_state *mrb, mrb_value self)
      @@ -5101,48 +5048,48 @@ 

       
       
      -1313
      -1314
      -1315
      -1316
      -1317
      -1318
      -1319
      -1320
      -1321
      -1322
      -1323
      -1324
      -1325
      -1326
      -1327
      -1328
      -1329
      -1330
      -1331
      -1332
      -1333
      -1334
      -1335
      -1336
      -1337
      -1338
      -1339
      -1340
      -1341
      -1342
      -1343
      -1344
      -

      -
      # File 'src/string.c', line 1313
      +1631
      +1632
      +1633
      +1634
      +1635
      +1636
      +1637
      +1638
      +1639
      +1640
      +1641
      +1642
      +1643
      +1644
      +1645
      +1646
      +1647
      +1648
      +1649
      +1650
      +1651
      +1652
      +1653
      +1654
      +1655
      +1656
      +1657
      +1658
      +1659
      +1660
      +1661
      +1662
      +
      +
      # File 'src/string.c', line 1631
       
       static mrb_value
       mrb_str_chop_bang(mrb_state *mrb, mrb_value str)
       {
         struct RString *s = mrb_str_ptr(str);
       
      -  mrb_str_modify(mrb, s);
      +  mrb_str_modify_keep_ascii(mrb, s);
         if (RSTR_LEN(s) > 0) {
           mrb_int len;
       #ifdef MRB_UTF8_STRING
      @@ -5231,14 +5178,14 @@ 

       
       
      -845
      -846
      -847
      -848
      -849
      +855 +856 +857 +858 +859

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 845
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 855
       
       static mrb_value
       mrb_str_chr(mrb_state *mrb, mrb_value self)
      @@ -5253,7 +5200,7 @@ 

      - #clearObject + #clearObject @@ -5301,7 +5248,7 @@

      - #codepoints(&block) ⇒ Object + #codepoints(&block) ⇒ Object @@ -5317,10 +5264,6 @@

       
       
      -322
      -323
      -324
      -325
       326
       327
       328
      @@ -5328,10 +5271,14 @@ 

      330 331 332 -333

      +333 +334 +335 +336 +337

      -
      # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 322
      +      
      # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 326
       
       def codepoints(&block)
         len = self.size
      @@ -5371,7 +5318,8 @@ 

      Append—Concatenates the given object to str. If the object is a Integer, it is considered as a codepoint, and is converted -to a character before concatenation.

      +to a character before concatenation +(equivalent to str.concat(integer.chr(__ENCODING__))).

      a = “hello “ a « “world” #=> “hello world” @@ -5520,22 +5468,26 @@

       
       
      -157
      -158
      -159
      -160
      -161
      -162
      -163
       164
       165
       166
       167
       168
      -169
      +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 157
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 164
       
       static mrb_value
       mrb_str_concat_m(mrb_state *mrb, mrb_value self)
      @@ -5543,11 +5495,15 @@ 

      mrb_value str; mrb_get_args(mrb, "o", &str); - if (mrb_fixnum_p(str)) - str = mrb_fixnum_chr(mrb, str); + if (mrb_fixnum_p(str) || mrb_float_p(str)) +#ifdef MRB_UTF8_STRING + str = int_chr_utf8(mrb, str); +#else + str = int_chr_binary(mrb, str); +#endif else - str = mrb_ensure_string_type(mrb, str); - mrb_str_concat(mrb, self, str); + mrb_ensure_string_type(mrb, str); + mrb_str_cat_str(mrb, self, str); return self; }

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 800
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 810
       
       static mrb_value
       mrb_str_count(mrb_state *mrb, mrb_value str)
      @@ -5632,7 +5588,7 @@ 

      tr_parse_pattern(mrb, &pat, v_pat, TRUE); tr_compile_pattern(&pat, v_pat, bitmap); tr_free_pattern(mrb, &pat); - + s = RSTRING_PTR(str); len = RSTRING_LEN(str); for (i = 0; i < len; i++) { @@ -5707,6 +5663,14 @@

       
       
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
       42
       43
       44
      @@ -5720,21 +5684,13 @@ 

      52 53 54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66

      +55 +56 +57 +58

      -
      # File 'mrbgems/mruby-range-ext/src/range.c', line 42
      +      
      # File 'mrbgems/mruby-range-ext/src/range.c', line 34
       
       static mrb_value
       range_cover(mrb_state *mrb, mrb_value range)
      @@ -5769,7 +5725,7 @@ 

      - #deleteObject + #deleteObject @@ -5781,20 +5737,20 @@

       
       
      -765
      -766
      -767
      -768
      -769
      -770
      -771
      -772
      -773
      -774
      -775
      +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 765
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 775
       
       static mrb_value
       mrb_str_delete(mrb_state *mrb, mrb_value str)
      @@ -5815,7 +5771,7 @@ 

      - #delete!Object + #delete!Object @@ -5827,20 +5783,20 @@

       
       
      -777
      -778
      -779
      -780
      -781
      -782
      -783
      -784
      -785
      -786
      -787
      +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 777
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 787
       
       static mrb_value
       mrb_str_delete_bang(mrb_state *mrb, mrb_value str)
      @@ -5915,9 +5871,6 @@ 

       
       
      -1102
      -1103
      -1104
       1105
       1106
       1107
      @@ -5927,10 +5880,13 @@ 

      1111 1112 1113 -1114

      +1114 +1115 +1116 +1117

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 1102
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 1105
       
       static mrb_value
       mrb_str_del_prefix(mrb_state *mrb, mrb_value self)
      @@ -6008,9 +5964,6 @@ 

       
       
      -1069
      -1070
      -1071
       1072
       1073
       1074
      @@ -6030,10 +5983,13 @@ 

      1088 1089 1090 -1091

      +1091 +1092 +1093 +1094

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 1069
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 1072
       
       static mrb_value
       mrb_str_del_prefix_bang(mrb_state *mrb, mrb_value self)
      @@ -6047,7 +6003,7 @@ 

      if (plen > slen) return mrb_nil_value(); s = RSTR_PTR(str); if (memcmp(s, ptr, plen) != 0) return mrb_nil_value(); - if (!MRB_FROZEN_P(str) && (RSTR_SHARED_P(str) || RSTR_FSHARED_P(str))) { + if (!mrb_frozen_p(str) && (RSTR_SHARED_P(str) || RSTR_FSHARED_P(str))) { str->as.heap.ptr += plen; } else { @@ -6120,9 +6076,6 @@

       
       
      -1157
      -1158
      -1159
       1160
       1161
       1162
      @@ -6132,10 +6085,13 @@ 

      1166 1167 1168 -1169

      +1169 +1170 +1171 +1172

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 1157
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 1160
       
       static mrb_value
       mrb_str_del_suffix(mrb_state *mrb, mrb_value self)
      @@ -6213,9 +6169,6 @@ 

       
       
      -1126
      -1127
      -1128
       1129
       1130
       1131
      @@ -6233,10 +6186,13 @@ 

      1143 1144 1145 -1146

      +1146 +1147 +1148 +1149

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 1126
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 1129
       
       static mrb_value
       mrb_str_del_suffix_bang(mrb_state *mrb, mrb_value self)
      @@ -6250,7 +6206,7 @@ 

      if (plen > slen) return mrb_nil_value(); s = RSTR_PTR(str); if (memcmp(s+slen-plen, ptr, plen) != 0) return mrb_nil_value(); - if (!MRB_FROZEN_P(str) && (RSTR_SHARED_P(str) || RSTR_FSHARED_P(str))) { + if (!mrb_frozen_p(str) && (RSTR_SHARED_P(str) || RSTR_FSHARED_P(str))) { /* no need to modify string */ } else { @@ -6322,18 +6278,18 @@

       
       
      -1413
      -1414
      -1415
      -1416
      -1417
      -1418
      -1419
      -1420
      -1421
      +1731 +1732 +1733 +1734 +1735 +1736 +1737 +1738 +1739

      -
      # File 'src/string.c', line 1413
      +      
      # File 'src/string.c', line 1731
       
       static mrb_value
       mrb_str_downcase(mrb_state *mrb, mrb_value self)
      @@ -6404,30 +6360,30 @@ 

       
       
      -1380
      -1381
      -1382
      -1383
      -1384
      -1385
      -1386
      -1387
      -1388
      -1389
      -1390
      -1391
      -1392
      -1393
      -1394
      -1395
      -1396
      -1397
      -1398
      -1399
      -1400
      -

      -
      # File 'src/string.c', line 1380
      +1698
      +1699
      +1700
      +1701
      +1702
      +1703
      +1704
      +1705
      +1706
      +1707
      +1708
      +1709
      +1710
      +1711
      +1712
      +1713
      +1714
      +1715
      +1716
      +1717
      +1718
      +
      +
      # File 'src/string.c', line 1698
       
       static mrb_value
       mrb_str_downcase_bang(mrb_state *mrb, mrb_value str)
      @@ -6436,7 +6392,7 @@ 

      mrb_bool modify = FALSE; struct RString *s = mrb_str_ptr(str); - mrb_str_modify(mrb, s); + mrb_str_modify_keep_ascii(mrb, s); p = RSTR_PTR(s); pend = RSTR_PTR(s) + RSTR_LEN(s); while (p < pend) { @@ -6510,231 +6466,19 @@

       
       
      -2427
      -2428
      -2429
      -2430
      -2431
      -2432
      -2433
      -2434
      -2435
      -2436
      -2437
      -2438
      -2439
      -2440
      -2441
      -2442
      -2443
      -2444
      -2445
      -2446
      -2447
      -2448
      -2449
      -2450
      -2451
      -2452
      -2453
      -2454
      -2455
      -2456
      -2457
      -2458
      -2459
      -2460
      -2461
      -2462
      -2463
      -2464
      -2465
      -2466
      -2467
      -2468
      -2469
      -2470
      -2471
      -2472
      -2473
      -2474
      -2475
      -2476
      -2477
      -2478
      -2479
      -2480
      -2481
      -2482
      -2483
      -2484
      -2485
      -2486
      -2487
      -2488
      -2489
      -2490
      -2491
      -2492
      -2493
      -2494
      -2495
      -2496
      -2497
      -2498
      -2499
      -2500
      -2501
      -2502
      -2503
      -2504
      -2505
      -2506
      -2507
      -2508
      -2509
      -2510
      -2511
      -2512
      -2513
      -2514
      -2515
      -2516
      -2517
      -2518
      -2519
      -2520
      -2521
      -2522
      -2523
      -2524
      -2525
      -2526
      -2527
      -2528
      -2529
      -2530
      -2531
      -2532
      -2533
      -2534
      -2535
      -2536
      -2537
      -

      -
      # File 'src/string.c', line 2427
      +2666
      +2667
      +2668
      +2669
      +2670
      +
      +
      # File 'src/string.c', line 2666
       
       mrb_value
       mrb_str_dump(mrb_state *mrb, mrb_value str)
       {
      -  mrb_int len;
      -  const char *p, *pend;
      -  char *q;
      -  struct RString *result;
      -
      -  len = 2;                  /* "" */
      -  p = RSTRING_PTR(str); pend = p + RSTRING_LEN(str);
      -  while (p < pend) {
      -    unsigned char c = *p++;
      -    switch (c) {
      -      case '"':  case '\\':
      -      case '\n': case '\r':
      -      case '\t': case '\f':
      -      case '\013': case '\010': case '\007': case '\033':
      -        len += 2;
      -        break;
      -
      -      case '#':
      -        len += IS_EVSTR(p, pend) ? 2 : 1;
      -        break;
      -
      -      default:
      -        if (ISPRINT(c)) {
      -          len++;
      -        }
      -        else {
      -          len += 4;                /* \NNN */
      -        }
      -        break;
      -    }
      -  }
      -
      -  result = str_new(mrb, 0, len);
      -  str_with_class(mrb, result, str);
      -  p = RSTRING_PTR(str); pend = p + RSTRING_LEN(str);
      -  q = RSTR_PTR(result);
      -  *q++ = '"';
      -  while (p < pend) {
      -    unsigned char c = *p++;
      -
      -    switch (c) {
      -      case '"':
      -      case '\\':
      -        *q++ = '\\';
      -        *q++ = c;
      -        break;
      -
      -      case '\n':
      -        *q++ = '\\';
      -        *q++ = 'n';
      -        break;
      -
      -      case '\r':
      -        *q++ = '\\';
      -        *q++ = 'r';
      -        break;
      -
      -      case '\t':
      -        *q++ = '\\';
      -        *q++ = 't';
      -        break;
      -
      -      case '\f':
      -        *q++ = '\\';
      -        *q++ = 'f';
      -        break;
      -
      -      case '\013':
      -        *q++ = '\\';
      -        *q++ = 'v';
      -        break;
      -
      -      case '\010':
      -        *q++ = '\\';
      -        *q++ = 'b';
      -        break;
      -
      -      case '\007':
      -        *q++ = '\\';
      -        *q++ = 'a';
      -        break;
      -
      -      case '\033':
      -        *q++ = '\\';
      -        *q++ = 'e';
      -        break;
      -
      -      case '#':
      -        if (IS_EVSTR(p, pend)) *q++ = '\\';
      -        *q++ = '#';
      -        break;
      -
      -      default:
      -        if (ISPRINT(c)) {
      -          *q++ = c;
      -        }
      -        else {
      -          *q++ = '\\';
      -          *q++ = 'x';
      -          q[1] = mrb_digitmap[c % 16]; c /= 16;
      -          q[0] = mrb_digitmap[c % 16];
      -          q += 2;
      -        }
      -    }
      -  }
      -  *q = '"';
      -  return mrb_obj_value(result);
      +  return str_escape(mrb, str, FALSE);
       }
      -
      # File 'mrblib/string.rb', line 182
      +      
      # File 'mrblib/string.rb', line 194
       
       def each_byte(&block)
      +  return to_enum(:each_byte, &block) unless block
         bytes = self.bytes
         pos = 0
         while pos < bytes.size
      @@ -6798,7 +6544,7 @@ 

      - #each_char(&block) ⇒ Object + #each_char(&block) ⇒ Object @@ -6823,19 +6569,21 @@

       
       
      -171
      -172
      -173
      -174
      -175
      -176
      -177
      -178
      +316 +317 +318 +319 +320 +321 +322 +323 +324

      -
      # File 'mrblib/string.rb', line 171
      +      
      # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 316
       
       def each_char(&block)
      +  return to_enum :each_char unless block
         pos = 0
         while pos < self.size
           block.call(self[pos])
      @@ -6851,7 +6599,7 @@ 

      - #each_line(rs = "\n", &block) ⇒ Object + #each_line(separator = "\n", &block) ⇒ Object @@ -6869,6 +6617,19 @@

      +

      Raises:

      +
      @@ -6878,8 +6639,6 @@

       
       
      -12
      -13
       14
       15
       16
      @@ -6891,23 +6650,75 @@ 

      22 23 24 -25

      +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52

      -
      # File 'mrblib/string.rb', line 12
      +      
      # File 'mrblib/string.rb', line 14
       
      -def each_line(rs = "\n", &block)
      -  return to_enum(:each_line, rs, &block) unless block
      -  return block.call(self) if rs.nil?
      -  rs.__to_str
      -  offset = 0
      -  rs_len = rs.length
      -  this = dup
      -  while pos = this.index(rs, offset)
      -    block.call(this[offset, pos + rs_len - offset])
      -    offset = pos + rs_len
      +def each_line(separator = "\n", &block)
      +  return to_enum(:each_line, separator) unless block
      +
      +  if separator.nil?
      +    block.call(self)
      +    return self
      +  end
      +  raise TypeError unless separator.is_a?(String)
      +
      +  paragraph_mode = false
      +  if separator.empty?
      +    paragraph_mode = true
      +    separator = "\n\n"
      +  end
      +  start = 0
      +  string = dup
      +  self_len = length
      +  sep_len = separator.length
      +  should_yield_subclass_instances = self.class != String
      +
      +  while (pointer = string.index(separator, start))
      +    pointer += sep_len
      +    pointer += 1 while paragraph_mode && string[pointer] == "\n"
      +    if should_yield_subclass_instances
      +      block.call(self.class.new(string[start, pointer - start]))
      +    else
      +      block.call(string[start, pointer - start])
      +    end
      +    start = pointer
      +  end
      +  return self if start == self_len
      +
      +  if should_yield_subclass_instances
      +    block.call(self.class.new(string[start, self_len - start]))
      +  else
      +    block.call(string[start, self_len - start])
         end
      -  block.call(this[offset, this.size - offset]) if this.size > offset
         self
       end
      -
      # File 'src/string.c', line 1433
      +      
      # File 'src/string.c', line 1751
       
       static mrb_value
       mrb_str_empty_p(mrb_state *mrb, mrb_value self)
      @@ -7049,17 +6860,6 @@ 

       
       
      -213
      -214
      -215
      -216
      -217
      -218
      -219
      -220
      -221
      -222
      -223
       224
       225
       226
      @@ -7072,10 +6872,21 @@ 

      233 234 235 -236

      +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 213
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 224
       
       static mrb_value
       mrb_str_end_with(mrb_state *mrb, mrb_value self)
      @@ -7160,20 +6971,20 @@ 

       
       
      -1448
      -1449
      -1450
      -1451
      -1452
      -1453
      -1454
      -1455
      -1456
      -1457
      -1458
      +1766 +1767 +1768 +1769 +1770 +1771 +1772 +1773 +1774 +1775 +1776

      -
      # File 'src/string.c', line 1448
      +      
      # File 'src/string.c', line 1766
       
       static mrb_value
       mrb_str_eql(mrb_state *mrb, mrb_value self)
      @@ -7182,7 +6993,7 @@ 

      mrb_bool eql_p; mrb_get_args(mrb, "o", &str2); - eql_p = (mrb_type(str2) == MRB_TT_STRING) && str_eql(mrb, self, str2); + eql_p = (mrb_string_p(str2)) && str_eql(mrb, self, str2); return mrb_bool_value(eql_p); }

      @@ -7194,34 +7005,73 @@

      - #getbyteObject + #getbyte(index) ⇒ 0 .. 255 + + + + + +

      +
      +

      returns the indexth byte as an integer.

      + + +
      +
      +
      + +
      +
      + + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (0 .. 255) + + + +
      • +
      + +
      + - - -

      + + + +
      - + - + @@ -8270,9 +7859,9 @@

      - #internObject + #internObject - #to_symObject + #to_symObject @@ -8309,14 +7898,14 @@

       
       
      -1652
      -1653
      -1654
      -1655
      -1656
      +1935 +1936 +1937 +1938 +1939

       
       
      -8
      -9
      -10
      -11
      -12
      -13
      -14
      -15
      -16
      -17
      -18
      -19
      -20
      +2785 +2786 +2787 +2788 +2789 +2790 +2791 +2792 +2793 +2794 +2795 +2796 +2797
      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 8
      +      
      # File 'src/string.c', line 2785
       
       static mrb_value
       mrb_str_getbyte(mrb_state *mrb, mrb_value str)
      @@ -7244,7 +7094,7 @@ 

      - #gsub(*args, &block) ⇒ Object + #gsub(*args, &block) ⇒ Object @@ -7286,39 +7136,39 @@

       
       
      -60
      -61
      -62
      -63
      -64
      -65
      -66
      -67
      -68
      -69
      -70
      -71
      -72
      -73
      -74
      -75
      -76
      -77
      -78
      -79
      -80
      -81
      -82
      -83
      -84
      -85
      -86
       87
       88
      -89
      +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116

      -
      # File 'mrblib/string.rb', line 60
      +      
      # File 'mrblib/string.rb', line 87
       
       def gsub(*args, &block)
         return to_enum(:gsub, *args) if args.length == 1 && !block
      @@ -7358,7 +7208,7 @@ 

      - #gsub!(*args, &block) ⇒ Object + #gsub!(*args, &block) ⇒ Object @@ -7400,16 +7250,16 @@

       
       
      -98
      -99
      -100
      -101
      -102
      -103
      -104
      +125 +126 +127 +128 +129 +130 +131

      -
      # File 'mrblib/string.rb', line 98
      +      
      # File 'mrblib/string.rb', line 125
       
       def gsub!(*args, &block)
         raise FrozenError, "can't modify frozen String" if frozen?
      @@ -7477,15 +7327,15 @@ 

       
       
      -1489
      -1490
      -1491
      -1492
      -1493
      -1494
      +1807 +1808 +1809 +1810 +1811 +1812

      -
      # File 'src/string.c', line 1489
      +      
      # File 'src/string.c', line 1807
       
       static mrb_value
       mrb_str_hash_m(mrb_state *mrb, mrb_value self)
      @@ -7501,7 +7351,7 @@ 

      - #hexObject + #hexObject @@ -7513,14 +7363,14 @@

       
       
      -824
      -825
      -826
      -827
      -828
      +834 +835 +836 +837 +838

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 824
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 834
       
       static mrb_value
       mrb_str_hex(mrb_state *mrb, mrb_value self)
      @@ -7635,19 +7485,19 @@ 

       
       
      -1509
      -1510
      -1511
      -1512
      -1513
      -1514
      -1515
      -1516
      -1517
      -1518
      +1827 +1828 +1829 +1830 +1831 +1832 +1833 +1834 +1835 +1836

      -
      # File 'src/string.c', line 1509
      +      
      # File 'src/string.c', line 1827
       
       static mrb_value
       mrb_str_include(mrb_state *mrb, mrb_value self)
      @@ -7667,13 +7517,7 @@ 

      - - #index(substring[, offset]) ⇒ Fixnum? - - #index(fixnum[, offset]) ⇒ Fixnum? - - #index(regexp[, offset]) ⇒ Fixnum? - + #index(substring[, offset]) ⇒ Fixnum? @@ -7682,93 +7526,21 @@

      Returns the index of the first occurrence of the given -substring, -character (fixnum), or pattern (regexp) in str. -Returns -nil if not found. +substring. Returns nil if not found. If the second parameter is present, it specifies the position in the string to begin the search.

      -

      “hello”.index(‘e’) #=> 1 +

      “hello”.index(‘l’) #=> 2 “hello”.index(‘lo’) #=> 3 “hello”.index(‘a’) #=> nil - “hello”.index(101) #=> 1(101=0x65=’e’) - “hello”.index(/[aeiou]/, -3) #=> 4

      - - -
      -
      -
      - -

      Overloads:

      -
        - - -
      • - #index(substring[, offset]) ⇒ Fixnum? -
        -
        - - - -
        -
        -
        - -

        Returns:

        -
          - -
        • - - - (Fixnum, nil) - - - -
        • - -
        - -
        - - -
      • - - -
      • - #index(fixnum[, offset]) ⇒ Fixnum? -
        -
        - + “hello”.index(‘l’, -2) #=> 3

        -

        Returns:

        -
          - -
        • - - - (Fixnum, nil) - - - -
        • - -
        - -
        - - -
      • - - -
      • - #index(regexp[, offset]) ⇒ Fixnum? -
        +
        @@ -7794,9 +7566,6 @@

        -
      • - -
      @@ -7807,109 +7576,51 @@

       
       
      -1541
      -1542
      -1543
      -1544
      -1545
      -1546
      -1547
      -1548
      -1549
      -1550
      -1551
      -1552
      -1553
      -1554
      -1555
      -1556
      -1557
      -1558
      -1559
      -1560
      -1561
      -1562
      -1563
      -1564
      -1565
      -1566
      -1567
      -1568
      -1569
      -1570
      -1571
      -1572
      -1573
      -1574
      -1575
      -1576
      -1577
      -1578
      -1579
      -1580
      -1581
      -1582
      -1583
      -1584
      -1585
      -1586
      -1587
      -1588
      -1589
      -1590
      -1591
      -

      -
      # File 'src/string.c', line 1541
      +1853
      +1854
      +1855
      +1856
      +1857
      +1858
      +1859
      +1860
      +1861
      +1862
      +1863
      +1864
      +1865
      +1866
      +1867
      +1868
      +1869
      +1870
      +1871
      +1872
      +1873
      +1874
      +
      +
      # File 'src/string.c', line 1853
       
       static mrb_value
       mrb_str_index_m(mrb_state *mrb, mrb_value str)
       {
      -  mrb_value *argv;
      -  mrb_int argc;
         mrb_value sub;
      -  mrb_int pos, clen;
      +  mrb_int pos;
       
      -  mrb_get_args(mrb, "*!", &argv, &argc);
      -  if (argc == 2) {
      -    mrb_get_args(mrb, "oi", &sub, &pos);
      -  }
      -  else {
      +  if (mrb_get_args(mrb, "S|i", &sub, &pos) == 1) {
           pos = 0;
      -    if (argc > 0)
      -      sub = argv[0];
      -    else
      -      sub = mrb_nil_value();
         }
      -  mrb_regexp_check(mrb, sub);
      -  clen = RSTRING_CHAR_LEN(str);
      -  if (pos < 0) {
      +  else if (pos < 0) {
      +    mrb_int clen = RSTRING_CHAR_LEN(str);
           pos += clen;
           if (pos < 0) {
             return mrb_nil_value();
           }
         }
      -  if (pos > clen) return mrb_nil_value();
      -  pos = chars2bytes(str, 0, pos);
      -
      -  switch (mrb_type(sub)) {
      -    default: {
      -      mrb_value tmp;
      -
      -      tmp = mrb_check_string_type(mrb, sub);
      -      if (mrb_nil_p(tmp)) {
      -        mrb_raisef(mrb, E_TYPE_ERROR, "type mismatch: %S given", sub);
      -      }
      -      sub = tmp;
      -    }
      -    /* fall through */
      -    case MRB_TT_STRING:
      -      pos = str_index_str(mrb, str, sub, pos);
      -      break;
      -  }
      +  pos = str_index_str_by_char(mrb, str, sub, pos);
       
         if (pos == -1) return mrb_nil_value();
      -  pos = bytes2chars(RSTRING_PTR(str), pos);
         BYTES_ALIGN_CHECK(pos);
         return mrb_fixnum_value(pos);
       }
      @@ -7973,17 +7684,17 @@

       
       
      -1602
      -1603
      -1604
      -1605
      -1606
      -1607
      -1608
      -1609
      +1885 +1886 +1887 +1888 +1889 +1890 +1891 +1892

      -
      # File 'src/string.c', line 1602
      +      
      # File 'src/string.c', line 1885
       
       static mrb_value
       mrb_str_replace(mrb_state *mrb, mrb_value str)
      @@ -8001,7 +7712,7 @@ 

      - #insert(idx, str) ⇒ Object + #insert(idx, str) ⇒ Object @@ -8125,141 +7836,19 @@

       
       
      -2619
      -2620
      -2621
      -2622
      -2623
      -2624
      -2625
      -2626
      -2627
      -2628
      -2629
      -2630
      -2631
      -2632
      -2633
      -2634
      -2635
      -2636
      -2637
      -2638
      -2639
      -2640
      -2641
      -2642
      -2643
      -2644
      -2645
      -2646
      -2647
      -2648
      -2649
      -2650
      -2651
      -2652
      -2653
      -2654
      -2655
      -2656
      -2657
      -2658
      -2659
      -2660
      -2661
      -2662
      -2663
      -2664
      -2665
      -2666
      -2667
      -2668
      -2669
      -2670
      -2671
      -2672
      -2673
      -2674
      -2675
      -2676
      -2677
      -2678
      -2679
      -2680
      -2681
      -2682
      -2683
      -2684
      -

      -
      # File 'src/string.c', line 2619
      +2750
      +2751
      +2752
      +2753
      +2754
      +
      +
      # File 'src/string.c', line 2750
       
       mrb_value
       mrb_str_inspect(mrb_state *mrb, mrb_value str)
       {
      -  const char *p, *pend;
      -  char buf[CHAR_ESC_LEN + 1];
      -  mrb_value result = mrb_str_new_lit(mrb, "\"");
      -
      -  p = RSTRING_PTR(str); pend = RSTRING_END(str);
      -  for (;p < pend; p++) {
      -    unsigned char c, cc;
      -#ifdef MRB_UTF8_STRING
      -    mrb_int clen;
      -
      -    clen = utf8len(p, pend);
      -    if (clen > 1) {
      -      mrb_int i;
      -
      -      for (i=0; i<clen; i++) {
      -        buf[i] = p[i];
      -      }
      -      mrb_str_cat(mrb, result, buf, clen);
      -      p += clen-1;
      -      continue;
      -    }
      -#endif
      -    c = *p;
      -    if (c == '"'|| c == '\\' || (c == '#' && IS_EVSTR(p+1, pend))) {
      -      buf[0] = '\\'; buf[1] = c;
      -      mrb_str_cat(mrb, result, buf, 2);
      -      continue;
      -    }
      -    if (ISPRINT(c)) {
      -      buf[0] = c;
      -      mrb_str_cat(mrb, result, buf, 1);
      -      continue;
      -    }
      -    switch (c) {
      -      case '\n': cc = 'n'; break;
      -      case '\r': cc = 'r'; break;
      -      case '\t': cc = 't'; break;
      -      case '\f': cc = 'f'; break;
      -      case '\013': cc = 'v'; break;
      -      case '\010': cc = 'b'; break;
      -      case '\007': cc = 'a'; break;
      -      case 033: cc = 'e'; break;
      -      default: cc = 0; break;
      -    }
      -    if (cc) {
      -      buf[0] = '\\';
      -      buf[1] = (char)cc;
      -      mrb_str_cat(mrb, result, buf, 2);
      -      continue;
      -    }
      -    else {
      -      buf[0] = '\\';
      -      buf[1] = 'x';
      -      buf[3] = mrb_digitmap[c % 16]; c /= 16;
      -      buf[2] = mrb_digitmap[c % 16];
      -      mrb_str_cat(mrb, result, buf, 4);
      -      continue;
      -    }
      -  }
      -  mrb_str_cat_lit(mrb, result, "\"");
      -
      -  return result;
      +  return str_escape(mrb, str, TRUE);
       }
      -
      # File 'src/string.c', line 1652
      +      
      # File 'src/string.c', line 1935
       
       MRB_API mrb_value
       mrb_str_intern(mrb_state *mrb, mrb_value self)
      @@ -8332,7 +7921,7 @@ 

      - #lastObject + #lastObject #last(n) ⇒ Array @@ -8364,7 +7953,7 @@

    1568. - #lastObject + #lastObject
      @@ -8380,7 +7969,7 @@

    1569. - (Object) + (Object) @@ -8435,22 +8024,22 @@

       
       
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
       84
       85
       86
       87
      -88
      -89
      -90
      -91
      -92
      -93
      -94
      -95
      -96
      +88

    1570. -
      # File 'mrbgems/mruby-range-ext/src/range.c', line 84
      +      
      # File 'mrbgems/mruby-range-ext/src/range.c', line 76
       
       static mrb_value
       range_last(mrb_state *mrb, mrb_value range)
      @@ -8524,15 +8113,15 @@ 

       
       
      -794
      -795
      -796
      -797
      -798
      -799
      +917 +918 +919 +920 +921 +922

      -
      # File 'src/string.c', line 794
      +      
      # File 'src/string.c', line 917
       
       static mrb_value
       mrb_str_size(mrb_state *mrb, mrb_value self)
      @@ -8548,7 +8137,7 @@ 

      - #lines(&blk) ⇒ Object + #lines(&blk) ⇒ Object @@ -8581,18 +8170,18 @@

       
       
      -361
      -362
      -363
      -364
       365
       366
       367
       368
      -369
      +369 +370 +371 +372 +373

      -
      # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 361
      +      
      # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 365
       
       def lines(&blk)
         lines = self.__lines
      @@ -8611,7 +8200,7 @@ 

      - #ljust(idx, padstr = ' ') ⇒ Object + #ljust(idx, padstr = ' ') ⇒ Object @@ -8684,7 +8273,7 @@

      - #lstripObject + #lstripObject @@ -8739,7 +8328,7 @@

      - #lstrip!Object + #lstrip!Object @@ -8804,9 +8393,51 @@

      -

      +

      + + #nextObject + + + + + +

      + + + + +
      +
      +
      +
      +986
      +987
      +988
      +989
      +990
      +991
      +992
      +993
      +994
      +
      +
      # File 'mrbgems/mruby-string-ext/src/string.c', line 986
      +
      +static mrb_value
      +mrb_str_succ(mrb_state *mrb, mrb_value self)
      +{
      +  mrb_value str;
      +
      +  str = mrb_str_dup(mrb, self);
      +  mrb_str_succ_bang(mrb, str);
      +  return str;
      +}
      +
      +
      + +
      +

      - #match(re, &block) ⇒ Object + #succString @@ -8814,13 +8445,43 @@

      -

      ISO 15.2.10.5.27

      +

      Returns next sequence of the string;

      + +

      a = “abc” + a.succ #=> “abd”

      + + +
      +
      +
      + +
      +
      +
      +

      Returns:

      +
        + +
      • + + + (String) + + + +
      • + +
      + +
      + + +
      @@ -8830,34 +8491,164 @@

       
       
      -253
      -254
      -255
      -256
      -257
      -258
      -259
      -260
      -261
      -262
      -263
      -264
      +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 +980 +981 +982 +983 +984

      -
      # File 'mrblib/string.rb', line 253
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 908
      +
      +static mrb_value
      +mrb_str_succ_bang(mrb_state *mrb, mrb_value self)
      +{
      +  mrb_value result;
      +  unsigned char *p, *e, *b, *t;
      +  const char *prepend;
      +  struct RString *s = mrb_str_ptr(self);
      +  mrb_int l;
      +
      +  if (RSTRING_LEN(self) == 0)
      +    return self;
      +
      +  mrb_str_modify(mrb, s);
      +  l = RSTRING_LEN(self);
      +  b = p = (unsigned char*) RSTRING_PTR(self);
      +  t = e = p + l;
      +  *(e--) = 0;
      +
      +  // find trailing ascii/number
      +  while (e >= b) {
      +    if (ISALNUM(*e))
      +      break;
      +    e--;
      +  }
      +  if (e < b) {
      +    e = p + l - 1;
      +    result = mrb_str_new_lit(mrb, "");
      +  }
      +  else {
      +    // find leading letter of the ascii/number
      +    b = e;
      +    while (b > p) {
      +      if (!ISALNUM(*b) || (ISALNUM(*b) && *b != '9' && *b != 'z' && *b != 'Z'))
      +        break;
      +      b--;
      +    }
      +    if (!ISALNUM(*b))
      +      b++;
      +    result = mrb_str_new(mrb, (char*) p, b - p);
      +  }
       
      -def match(re, &block)
      -  if String === re
      -    if Object.const_defined?(:Regexp)
      -      r = Regexp.new(re)
      -      r.match(self, &block)
      -    else
      -      raise NotImplementedError, "String#match needs Regexp class"
      -    end
      -  else
      -    re.match(self, &block)
      -  end
      -end
      + while (e >= b) { + if (!ISALNUM(*e)) { + if (*e == 0xff) { + mrb_str_cat_lit(mrb, result, "\x01"); + (*e) = 0; + } + else + (*e)++; + break; + } + prepend = NULL; + if (*e == '9') { + if (e == b) prepend = "1"; + *e = '0'; + } + else if (*e == 'z') { + if (e == b) prepend = "a"; + *e = 'a'; + } + else if (*e == 'Z') { + if (e == b) prepend = "A"; + *e = 'A'; + } + else { + (*e)++; + break; + } + if (prepend) mrb_str_cat_cstr(mrb, result, prepend); + e--; + } + result = mrb_str_cat(mrb, result, (char*) b, t - b); + l = RSTRING_LEN(result); + mrb_str_resize(mrb, self, l); + memcpy(RSTRING_PTR(self), RSTRING_PTR(result), l); + return self; +}
      @@ -8866,7 +8657,7 @@

      - #octObject + #octObject @@ -8878,14 +8669,14 @@

       
       
      -830
      -831
      -832
      -833
      -834
      +840 +841 +842 +843 +844

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 830
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 840
       
       static mrb_value
       mrb_str_oct(mrb_state *mrb, mrb_value self)
      @@ -8900,7 +8691,7 @@ 

      - #ordObject + #ordObject @@ -8912,16 +8703,16 @@

       
       
      -1050
      -1051
      -1052
       1053
       1054
       1055
      -1056
      +1056 +1057 +1058 +1059

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 1050
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 1053
       
       static mrb_value
       mrb_str_ord(mrb_state* mrb, mrb_value str)
      @@ -8938,7 +8729,7 @@ 

      - #partition(sep) ⇒ Object + #partition(sep) ⇒ Object @@ -9007,7 +8798,7 @@

      - #prepend(arg) ⇒ Object + #prepend(arg) ⇒ Object @@ -9038,13 +8829,13 @@

       
       
      -345
      -346
      -347
      -348
      +349 +350 +351 +352

      -
      # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 345
      +      
      # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 349
       
       def prepend(arg)
         self[0, 0] = arg
      @@ -9110,17 +8901,17 @@ 

       
       
      -1602
      -1603
      -1604
      -1605
      -1606
      -1607
      -1608
      -1609
      +1885 +1886 +1887 +1888 +1889 +1890 +1891 +1892

      -
      # File 'src/string.c', line 1602
      +      
      # File 'src/string.c', line 1885
       
       static mrb_value
       mrb_str_replace(mrb_state *mrb, mrb_value str)
      @@ -9191,16 +8982,16 @@ 

       
       
      -1771
      -1772
      -1773
      -1774
      -1775
      -1776
      -1777
      +2051 +2052 +2053 +2054 +2055 +2056 +2057

      -
      # File 'src/string.c', line 1771
      +      
      # File 'src/string.c', line 2051
       
       static mrb_value
       mrb_str_reverse(mrb_state *mrb, mrb_value str)
      @@ -9268,111 +9059,81 @@ 

       
       
      -1709
      -1710
      -1711
      -1712
      -1713
      -1714
      -1715
      -1716
      -1717
      -1718
      -1719
      -1720
      -1721
      -1722
      -1723
      -1724
      -1725
      -1726
      -1727
      -1728
      -1729
      -1730
      -1731
      -1732
      -1733
      -1734
      -1735
      -1736
      -1737
      -1738
      -1739
      -1740
      -1741
      -1742
      -1743
      -1744
      -1745
      -1746
      -1747
      -1748
      -1749
      -1750
      -1751
      -1752
      -1753
      -1754
      -1755
      -1756
      -1757
      -1758
      -1759
      -

      -
      # File 'src/string.c', line 1709
      +2004
      +2005
      +2006
      +2007
      +2008
      +2009
      +2010
      +2011
      +2012
      +2013
      +2014
      +2015
      +2016
      +2017
      +2018
      +2019
      +2020
      +2021
      +2022
      +2023
      +2024
      +2025
      +2026
      +2027
      +2028
      +2029
      +2030
      +2031
      +2032
      +2033
      +2034
      +2035
      +2036
      +2037
      +2038
      +2039
      +
      +
      # File 'src/string.c', line 2004
       
       static mrb_value
       mrb_str_reverse_bang(mrb_state *mrb, mrb_value str)
       {
      +  struct RString *s = mrb_str_ptr(str);
      +  char *p, *e;
      +
       #ifdef MRB_UTF8_STRING
         mrb_int utf8_len = RSTRING_CHAR_LEN(str);
      -  mrb_int len = RSTRING_LEN(str);
      -
      -  if (utf8_len == len) goto bytes;
      -  if (utf8_len > 1) {
      -    char *buf;
      -    char *p, *e, *r;
      -
      -    mrb_str_modify(mrb, mrb_str_ptr(str));
      -    len = RSTRING_LEN(str);
      -    buf = (char*)mrb_malloc(mrb, (size_t)len);
      -    p = buf;
      -    e = buf + len;
      -
      -    memcpy(buf, RSTRING_PTR(str), len);
      -    r = RSTRING_PTR(str) + len;
      +  mrb_int len = RSTR_LEN(s);
       
      +  if (utf8_len < 2) return str;
      +  if (utf8_len < len) {
      +    mrb_str_modify(mrb, s);
      +    p = RSTR_PTR(s);
      +    e = p + RSTR_LEN(s);
           while (p<e) {
             mrb_int clen = utf8len(p, e);
      -      r -= clen;
      -      memcpy(r, p, clen);
      +      str_reverse(p, p + clen - 1);
             p += clen;
           }
      -    mrb_free(mrb, buf);
      +    goto bytes;
         }
      -  return str;
      -
      - bytes:
       #endif
      -  {
      -    struct RString *s = mrb_str_ptr(str);
      -    char *p, *e;
      -    char c;
       
      +  if (RSTR_LEN(s) > 1) {
           mrb_str_modify(mrb, s);
      -    if (RSTR_LEN(s) > 1) {
      -      p = RSTR_PTR(s);
      -      e = p + RSTR_LEN(s) - 1;
      -      while (p < e) {
      -      c = *p;
      -      *p++ = *e;
      -      *e-- = c;
      -      }
      -    }
      -    return str;
      +    goto bytes;
         }
      +  return str;
      +
      + bytes:
      +  p = RSTR_PTR(s);
      +  e = p + RSTR_LEN(s) - 1;
      +  str_reverse(p, e);
      +  return str;
       }
      -
      # File 'src/string.c', line 1798
      +2074
      +2075
      +2076
      +2077
      +2078
      +2079
      +2080
      +2081
      +2082
      +2083
      +2084
      +2085
      +2086
      +2087
      +2088
      +2089
      +2090
      +2091
      +2092
      +2093
      +2094
      +2095
      +2096
      +2097
      +2098
      +2099
      +2100
      +
      +
      # File 'src/string.c', line 2074
       
       static mrb_value
       mrb_str_rindex(mrb_state *mrb, mrb_value str)
       {
      -  mrb_value *argv;
      -  mrb_int argc;
         mrb_value sub;
         mrb_int pos, len = RSTRING_CHAR_LEN(str);
       
      -  mrb_get_args(mrb, "*!", &argv, &argc);
      -  if (argc == 2) {
      -    mrb_get_args(mrb, "oi", &sub, &pos);
      +  if (mrb_get_args(mrb, "S|i", &sub, &pos) == 1) {
      +    pos = len;
      +  }
      +  else {
           if (pos < 0) {
             pos += len;
             if (pos < 0) {
      -        mrb_regexp_check(mrb, sub);
               return mrb_nil_value();
             }
           }
           if (pos > len) pos = len;
         }
      -  else {
      -    pos = len;
      -    if (argc > 0)
      -      sub = argv[0];
      -    else
      -      sub = mrb_nil_value();
      -  }
         pos = chars2bytes(str, 0, pos);
      -  mrb_regexp_check(mrb, sub);
      -
      -  switch (mrb_type(sub)) {
      -    default: {
      -      mrb_value tmp;
      -
      -      tmp = mrb_check_string_type(mrb, sub);
      -      if (mrb_nil_p(tmp)) {
      -        mrb_raisef(mrb, E_TYPE_ERROR, "type mismatch: %S given", sub);
      -      }
      -      sub = tmp;
      -    }
      -     /* fall through */
      -    case MRB_TT_STRING:
      -      pos = str_rindex(mrb, str, sub, pos);
      -      if (pos >= 0) {
      -        pos = bytes2chars(RSTRING_PTR(str), pos);
      -        BYTES_ALIGN_CHECK(pos);
      -        return mrb_fixnum_value(pos);
      -      }
      -      break;
      -
      -  } /* end of switch (TYPE(sub)) */
      -  return mrb_nil_value();
      -}
      + pos = str_rindex(mrb, str, sub, pos); + if (pos >= 0) { + pos = bytes2chars(RSTRING_PTR(str), RSTRING_LEN(str), pos); + BYTES_ALIGN_CHECK(pos); + return mrb_fixnum_value(pos); + } + return mrb_nil_value(); +}
      @@ -9638,7 +9268,7 @@

      - #rjust(idx, padstr = ' ') ⇒ Object + #rjust(idx, padstr = ' ') ⇒ Object @@ -9711,7 +9341,7 @@

      - #rpartition(sep) ⇒ Object + #rpartition(sep) ⇒ Object @@ -9780,7 +9410,7 @@

      - #rstripObject + #rstripObject @@ -9835,7 +9465,7 @@

      - #rstrip!Object + #rstrip!Object @@ -9900,9 +9530,9 @@

      -

      +

      - #scan(reg, &block) ⇒ Object + #setbyte(index, integer) ⇒ Integer @@ -9910,84 +9540,71 @@

      -

      Calls the given block for each match of +pattern+ -If no block is given return an array with all -matches of +pattern+.

      - -

      ISO 15.2.10.5.32

      +

      modifies the indexth byte as integer.

      +
      +
      + -
      - - - - - - -
      -
      -
      -
      -112
      -113
      -114
      -115
      -116
      -117
      -
      -
      # File 'mrblib/string.rb', line 112
       
      -def scan(reg, &block)
      -  ### *** TODO *** ###
      -  unless Object.const_defined?(:Regexp)
      -    raise NotImplementedError, "scan not available (yet)"
      -  end
      -end
      -
      +
      - -
      -

      +
      - #setbyteObject +

      Returns:

      + - +
      + - -

      + + + + +
      - + @@ -10523,7 +10124,7 @@

      - #slice!(arg1, arg2 = nil) ⇒ Object + #slice!(arg1, arg2 = nil) ⇒ Object @@ -10778,124 +10379,116 @@

       
       
      -1893
      -1894
      -1895
      -1896
      -1897
      -1898
      -1899
      -1900
      -1901
      -1902
      -1903
      -1904
      -1905
      -1906
      -1907
      -1908
      -1909
      -1910
      -1911
      -1912
      -1913
      -1914
      -1915
      -1916
      -1917
      -1918
      -1919
      -1920
      -1921
      -1922
      -1923
      -1924
      -1925
      -1926
      -1927
      -1928
      -1929
      -1930
      -1931
      -1932
      -1933
      -1934
      -1935
      -1936
      -1937
      -1938
      -1939
      -1940
      -1941
      -1942
      -1943
      -1944
      -1945
      -1946
      -1947
      -1948
      -1949
      -1950
      -1951
      -1952
      -1953
      -1954
      -1955
      -1956
      -1957
      -1958
      -1959
      -1960
      -1961
      -1962
      -1963
      -1964
      -1965
      -1966
      -1967
      -1968
      -1969
      -1970
      -1971
      -1972
      -1973
      -1974
      -1975
      -1976
      -1977
      -1978
      -1979
      -1980
      -1981
      -1982
      -1983
      -1984
      -1985
      -1986
      -1987
      -1988
      -1989
      -1990
      -1991
      -1992
      -1993
      -1994
      -1995
      -1996
      -1997
      -1998
      -1999
      -2000
      -2001
      -2002
      -2003
      -2004
      -2005
      -2006
      -2007
      +2143 +2144 +2145 +2146 +2147 +2148 +2149 +2150 +2151 +2152 +2153 +2154 +2155 +2156 +2157 +2158 +2159 +2160 +2161 +2162 +2163 +2164 +2165 +2166 +2167 +2168 +2169 +2170 +2171 +2172 +2173 +2174 +2175 +2176 +2177 +2178 +2179 +2180 +2181 +2182 +2183 +2184 +2185 +2186 +2187 +2188 +2189 +2190 +2191 +2192 +2193 +2194 +2195 +2196 +2197 +2198 +2199 +2200 +2201 +2202 +2203 +2204 +2205 +2206 +2207 +2208 +2209 +2210 +2211 +2212 +2213 +2214 +2215 +2216 +2217 +2218 +2219 +2220 +2221 +2222 +2223 +2224 +2225 +2226 +2227 +2228 +2229 +2230 +2231 +2232 +2233 +2234 +2235 +2236 +2237 +2238 +2239 +2240 +2241 +2242 +2243 +2244 +2245 +2246 +2247 +2248 +2249

      - + @@ -1652,14 +1644,14 @@

       
       
      -632
      -633
      -634
      -635
      -636
      +618 +619 +620 +621 +622

      @@ -579,7 +579,7 @@

      - #casecmp(other) ⇒ Object + #casecmp(other) ⇒ Object @@ -618,7 +618,7 @@

      def casecmp(other) return nil unless other.kind_of?(Symbol) - lhs = self.to_s; lhs.upcase! + lhs = self.to_s.upcase rhs = other.to_s.upcase lhs <=> rhs end @@ -693,7 +693,7 @@

      - #downcaseObject + #downcaseObject @@ -728,7 +728,7 @@

      # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 22
       
       def downcase
      -  (self.to_s.downcase! || self).to_sym
      +  self.to_s.downcase.to_sym
       end
      @@ -893,19 +893,19 @@

       
       
      -326
      -327
      -328
      -329
      -330
      +339 +340 +341 +342 +343

      @@ -915,7 +915,7 @@

      - #inspectObject + #inspectObject @@ -939,19 +939,6 @@

       
       
      -475
      -476
      -477
      -478
      -479
      -480
      -481
      -482
      -483
      -484
      -485
      -486
      -487
       488
       489
       490
      @@ -961,10 +948,26 @@ 

      494 495 496 -497

      +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513

      @@ -997,7 +1003,7 @@

      - #to_procObject + #to_procObject @@ -1128,19 +1134,19 @@

       
       
      -326
      -327
      -328
      -329
      -330
      +339 +340 +341 +342 +343

      @@ -1151,9 +1157,9 @@

      - #to_symObject + #to_symObject - #internObject + #internObject @@ -1184,14 +1190,14 @@

       
       
      -343
      -344
      -345
      -346
      -347
      +356 +357 +358 +359 +360

      @@ -1253,9 +1259,9 @@

      diff --git a/docs/api/SystemStackError.html b/docs/api/SystemStackError.html index 26fd358..3ec8b42 100644 --- a/docs/api/SystemStackError.html +++ b/docs/api/SystemStackError.html @@ -6,7 +6,7 @@ Exception: SystemStackError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ Exception
        -
      • Object
      • +
      • Object
      • @@ -146,9 +146,9 @@

        Constructor Details

        diff --git a/docs/api/TCPServer.html b/docs/api/TCPServer.html index 5de9369..61e6d25 100644 --- a/docs/api/TCPServer.html +++ b/docs/api/TCPServer.html @@ -6,7 +6,7 @@ Class: TCPServer - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ TCPSocket
          -
        • Object
        • +
        • Object
        • @@ -372,7 +372,7 @@

          Instance Method Details

          - #acceptObject + #acceptObject @@ -414,7 +414,7 @@

          - #accept_nonblockObject + #accept_nonblockObject @@ -454,7 +454,7 @@

          - #listen(backlog) ⇒ Object + #listen(backlog) ⇒ Object @@ -486,7 +486,7 @@

          - #sysacceptObject + #sysacceptObject @@ -518,9 +518,9 @@

          diff --git a/docs/api/TCPSocket.html b/docs/api/TCPSocket.html index 759429a..885c93e 100644 --- a/docs/api/TCPSocket.html +++ b/docs/api/TCPSocket.html @@ -6,7 +6,7 @@ Class: TCPSocket - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ IPSocket
            -
          • Object
          • +
          • Object
          • @@ -333,7 +333,7 @@

            Class Method Details

            - .new_with_prelude(pre, *args) ⇒ Object + .new_with_prelude(pre, *args) ⇒ Object @@ -371,9 +371,9 @@

          diff --git a/docs/api/Time.html b/docs/api/Time.html index 33a252e..39b3caa 100644 --- a/docs/api/Time.html +++ b/docs/api/Time.html @@ -6,7 +6,7 @@ Class: Time - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
          Inherits:
          - Object + Object
            -
          • Object
          • +
          • Object
          • @@ -542,7 +542,7 @@

            -

            Returns a string that describes the time.

            +
            @@ -818,7 +818,7 @@

            -

            Returns a Fixnum with the time since the epoch in seconds.

            +

            Returns an Integer with the time since the epoch in seconds.

            @@ -841,7 +841,7 @@

            -

            Returns a string that describes the time.

            +

            15.2.19.7.3.

            @@ -887,7 +887,7 @@

            -

            Returns a Float with the time since the epoch in microseconds.

            +

            Returns an Integer with the time since the epoch in microseconds.

            @@ -1063,7 +1063,7 @@

            Constructor Details

            - #initializeObject + #initializeObject @@ -1087,34 +1087,34 @@

             
             
            -655
            -656
            -657
            -658
            -659
            -660
            -661
            -662
            -663
            -664
            -665
            -666
            -667
            -668
            -669
            -670
            -671
            -672
            -673
            -674
            -675
            -676
            -677
            -678
            -679
            +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763

      @@ -1212,7 +1216,7 @@

      - #-Object + #-Object @@ -1236,34 +1240,41 @@

       
       
      -489
      -490
      -491
      -492
      -493
      -494
      -495
      -496
      -497
      -498
      -499
      -500
      -501
      -502
      -503
      -504
      -505
      -506
      -507
      -508
      - -

      + @@ -1288,7 +1308,7 @@

      - #<=>Object + #<=>Object @@ -1312,34 +1332,34 @@

       
       
      -452
      -453
      -454
      -455
      -456
      -457
      -458
      -459
      -460
      -461
      -462
      -463
      -464
      -465
      -466
      -467
      -468
      -469
      -470
      -471
      -472
      -473
      -474
      -475
      -476
      - -

      +
       
       
      -22
      -23
      -24
      -25
      -26
      -27
      -28
      -29
      -30
      -31
      -32
      -33
      -34
      -35
      -36
      -37
      -38
      -39
      -40
      -
      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 22
      +2805
      +2806
      +2807
      +2808
      +2809
      +2810
      +2811
      +2812
      +2813
      +2814
      +2815
      +2816
      +2817
      +2818
      +2819
      +2820
      +2821
      +2822
      +2823
      +
      +
      # File 'src/string.c', line 2805
       
       static mrb_value
       mrb_str_setbyte(mrb_state *mrb, mrb_value str)
      @@ -9999,7 +9616,7 @@ 

      len = RSTRING_LEN(str); if (pos < -len || len <= pos) - mrb_raisef(mrb, E_INDEX_ERROR, "index %S is out of array", mrb_fixnum_value(pos)); + mrb_raisef(mrb, E_INDEX_ERROR, "index %i out of string", pos); if (pos < 0) pos += len; @@ -10067,15 +9684,15 @@

       
       
      -794
      -795
      -796
      -797
      -798
      -799
      +917 +918 +919 +920 +921 +922

      -
      # File 'src/string.c', line 794
      +      
      # File 'src/string.c', line 917
       
       static mrb_value
       mrb_str_size(mrb_state *mrb, mrb_value self)
      @@ -10473,47 +10090,31 @@ 

       
       
      -1120
      -1121
      -1122
      -1123
      -1124
      -1125
      -1126
      -1127
      -1128
      -1129
      -1130
      -1131
      -1132
      -1133
      -1134
      -1135
      -1136
      -1137
      -1138
      +1259 +1260 +1261 +1262 +1263 +1264 +1265 +1266 +1267 +1268 +1269

      -
      # File 'src/string.c', line 1120
      +      
      # File 'src/string.c', line 1259
       
       static mrb_value
       mrb_str_aref_m(mrb_state *mrb, mrb_value str)
       {
         mrb_value a1, a2;
      -  mrb_int argc;
      -
      -  argc = mrb_get_args(mrb, "o|o", &a1, &a2);
      -  if (argc == 2) {
      -    mrb_int n1, n2;
       
      -    mrb_regexp_check(mrb, a1);
      -    mrb_get_args(mrb, "ii", &n1, &n2);
      -    return str_substr(mrb, str, n1, n2);
      +  if (mrb_get_args(mrb, "o|o", &a1, &a2) == 1) {
      +    a2 = mrb_undef_value();
         }
      -  if (argc != 1) {
      -    mrb_raisef(mrb, E_ARGUMENT_ERROR, "wrong number of arguments (%S for 1)", mrb_fixnum_value(argc));
      -  }
      -  return mrb_str_aref(mrb, str, a1);
      +
      +  return mrb_str_aref(mrb, str, a1, a2);
       }
      -
      # File 'src/string.c', line 1893
      +      
      # File 'src/string.c', line 2143
       
       static mrb_value
       mrb_str_split_m(mrb_state *mrb, mrb_value str)
      @@ -10924,16 +10517,11 @@ 

      if (argc == 0 || mrb_nil_p(spat)) { split_type = awk; } - else { - if (mrb_string_p(spat)) { - split_type = string; - if (RSTRING_LEN(spat) == 1 && RSTRING_PTR(spat)[0] == ' ') { - split_type = awk; - } - } - else { - mrb_noregexp(mrb, str); - } + else if (!mrb_string_p(spat)) { + mrb_raise(mrb, E_TYPE_ERROR, "expected String"); + } + else if (RSTRING_LEN(spat) == 1 && RSTRING_PTR(spat)[0] == ' ') { + split_type = awk; } result = mrb_ary_new(mrb); @@ -10959,7 +10547,7 @@

      } } else if (ISSPACE(c)) { - mrb_ary_push(mrb, result, byte_subseq(mrb, str, beg, end-beg)); + mrb_ary_push(mrb, result, mrb_str_byte_subseq(mrb, str, beg, end-beg)); mrb_gc_arena_restore(mrb, ai); skip = TRUE; beg = idx; @@ -10970,7 +10558,7 @@

      } } } - else if (split_type == string) { + else { /* split_type == string */ mrb_int str_len = RSTRING_LEN(str); mrb_int pat_len = RSTRING_LEN(spat); mrb_int idx = 0; @@ -10984,22 +10572,19 @@

      else { end = chars2bytes(str, idx, 1); } - mrb_ary_push(mrb, result, byte_subseq(mrb, str, idx, end)); + mrb_ary_push(mrb, result, mrb_str_byte_subseq(mrb, str, idx, end)); mrb_gc_arena_restore(mrb, ai); idx += end + pat_len; if (lim_p && lim <= ++i) break; } beg = idx; } - else { - mrb_noregexp(mrb, str); - } if (RSTRING_LEN(str) > 0 && (lim_p || RSTRING_LEN(str) > beg || lim < 0)) { if (RSTRING_LEN(str) == beg) { tmp = mrb_str_new_empty(mrb, str); } else { - tmp = byte_subseq(mrb, str, beg, RSTRING_LEN(str)-beg); + tmp = mrb_str_byte_subseq(mrb, str, beg, RSTRING_LEN(str)-beg); } mrb_ary_push(mrb, result, tmp); } @@ -11079,20 +10664,20 @@

       
       
      -702
      -703
      -704
      -705
      -706
      -707
      -708
      -709
      -710
      -711
      -712
      +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 702
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 712
       
       static mrb_value
       mrb_str_squeeze(mrb_state *mrb, mrb_value str)
      @@ -11165,20 +10750,20 @@ 

       
       
      -721
      -722
      -723
      -724
      -725
      -726
      -727
      -728
      -729
      -730
      -731
      +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 721
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 731
       
       static mrb_value
       mrb_str_squeeze_bang(mrb_state *mrb, mrb_value str)
      @@ -11257,17 +10842,6 @@ 

       
       
      -184
      -185
      -186
      -187
      -188
      -189
      -190
      -191
      -192
      -193
      -194
       195
       196
       197
      @@ -11278,10 +10852,21 @@ 

      202 203 204 -205

      +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 184
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 195
       
       static mrb_value
       mrb_str_start_with(mrb_state *mrb, mrb_value self)
      @@ -11313,7 +10898,7 @@ 

      - #stripObject + #stripObject @@ -11369,7 +10954,7 @@

      - #strip!Object + #strip!Object @@ -11432,7 +11017,7 @@

      - #sub(*args, &block) ⇒ Object + #sub(*args, &block) ⇒ Object @@ -11461,36 +11046,36 @@

       
       
      -126
      -127
      -128
      -129
      -130
      -131
      -132
      -133
      -134
      -135
      -136
      -137
      -138
      -139
      -140
      -141
      -142
      -143
      -144
      -145
      -146
      -147
      -148
      -149
       150
       151
      -152
      +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176

      -
      # File 'mrblib/string.rb', line 126
      +      
      # File 'mrblib/string.rb', line 150
       
       def sub(*args, &block)
         unless (1..2).include?(args.length)
      @@ -11527,7 +11112,7 @@ 

      - #sub!(*args, &block) ⇒ Object + #sub!(*args, &block) ⇒ Object @@ -11569,15 +11154,15 @@

       
       
      -161
      -162
      -163
      -164
      -165
      -166
      +185 +186 +187 +188 +189 +190

      -
      # File 'mrblib/string.rb', line 161
      +      
      # File 'mrblib/string.rb', line 185
       
       def sub!(*args, &block)
         raise FrozenError, "can't modify frozen String" if frozen?
      @@ -11593,7 +11178,7 @@ 

      - #succObject + #succObject @@ -11605,18 +11190,18 @@

       
       
      -983
      -984
      -985
       986
       987
       988
       989
       990
      -991
      +991 +992 +993 +994

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 983
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 986
       
       static mrb_value
       mrb_str_succ(mrb_state *mrb, mrb_value self)
      @@ -11689,9 +11274,6 @@ 

       
       
      -905
      -906
      -907
       908
       909
       910
      @@ -11765,10 +11347,13 @@ 

      978 979 980 -981

      +981 +982 +983 +984

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 905
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 908
       
       static mrb_value
       mrb_str_succ_bang(mrb_state *mrb, mrb_value self)
      @@ -11911,18 +11496,18 @@ 

       
       
      -130
      -131
      -132
      -133
      -134
      -135
      -136
      -137
      -138
      +138 +139 +140 +141 +142 +143 +144 +145 +146

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 130
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 138
       
       static mrb_value
       mrb_str_swapcase(mrb_state *mrb, mrb_value self)
      @@ -11994,14 +11579,6 @@ 

       
       
      -93
      -94
      -95
      -96
      -97
      -98
      -99
      -100
       101
       102
       103
      @@ -12018,10 +11595,18 @@ 

      114 115 116 -117

      +117 +118 +119 +120 +121 +122 +123 +124 +125

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 93
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 101
       
       static mrb_value
       mrb_str_swapcase_bang(mrb_state *mrb, mrb_value str)
      @@ -12114,14 +11699,14 @@ 

       
       
      -2344
      -2345
      -2346
      -2347
      -2348
      +2585 +2586 +2587 +2588 +2589

      -
      # File 'src/string.c', line 2344
      +      
      # File 'src/string.c', line 2585
       
       static mrb_value
       mrb_str_to_f(mrb_state *mrb, mrb_value self)
      @@ -12201,20 +11786,20 @@ 

       
       
      -2233
      -2234
      -2235
      -2236
      -2237
      -2238
      -2239
      -2240
      -2241
      -2242
      -2243
      +2489 +2490 +2491 +2492 +2493 +2494 +2495 +2496 +2497 +2498 +2499

      -
      # File 'src/string.c', line 2233
      +      
      # File 'src/string.c', line 2489
       
       static mrb_value
       mrb_str_to_i(mrb_state *mrb, mrb_value self)
      @@ -12223,7 +11808,7 @@ 

      mrb_get_args(mrb, "|i", &base); if (base < 0) { - mrb_raisef(mrb, E_ARGUMENT_ERROR, "illegal radix %S", mrb_fixnum_value(base)); + mrb_raisef(mrb, E_ARGUMENT_ERROR, "illegal radix %i", base); } return mrb_str_to_inum(mrb, self, base, FALSE); }

      @@ -12286,17 +11871,17 @@

       
       
      -2358
      -2359
      -2360
      -2361
      -2362
      -2363
      -2364
      -2365
      +2599 +2600 +2601 +2602 +2603 +2604 +2605 +2606

      -
      # File 'src/string.c', line 2358
      +      
      # File 'src/string.c', line 2599
       
       static mrb_value
       mrb_str_to_s(mrb_state *mrb, mrb_value self)
      @@ -12365,17 +11950,17 @@ 

       
       
      -2358
      -2359
      -2360
      -2361
      -2362
      -2363
      -2364
      -2365
      +2599 +2600 +2601 +2602 +2603 +2604 +2605 +2606

      -
      # File 'src/string.c', line 2358
      +      
      # File 'src/string.c', line 2599
       
       static mrb_value
       mrb_str_to_s(mrb_state *mrb, mrb_value self)
      @@ -12394,9 +11979,9 @@ 

      - #internObject + #internObject - #to_symObject + #to_symObject @@ -12433,14 +12018,14 @@

       
       
      -1652
      -1653
      -1654
      -1655
      -1656
      +1935 +1936 +1937 +1938 +1939

      -
      # File 'src/string.c', line 1652
      +      
      # File 'src/string.c', line 1935
       
       MRB_API mrb_value
       mrb_str_intern(mrb_state *mrb, mrb_value self)
      @@ -12536,20 +12121,20 @@ 

       
       
      -566
      -567
      -568
      -569
      -570
      -571
      -572
      -573
      -574
      -575
      -576
      +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 566
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 576
       
       static mrb_value
       mrb_str_tr(mrb_state *mrb, mrb_value str)
      @@ -12622,20 +12207,20 @@ 

       
       
      -585
      -586
      -587
      -588
      -589
      -590
      -591
      -592
      -593
      -594
      -595
      +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 585
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 595
       
       static mrb_value
       mrb_str_tr_bang(mrb_state *mrb, mrb_value str)
      @@ -12712,20 +12297,20 @@ 

       
       
      -608
      -609
      -610
      -611
      -612
      -613
      -614
      -615
      -616
      -617
      -618
      +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 608
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 618
       
       static mrb_value
       mrb_str_tr_s(mrb_state *mrb, mrb_value str)
      @@ -12798,20 +12383,20 @@ 

       
       
      -627
      -628
      -629
      -630
      -631
      -632
      -633
      -634
      -635
      -636
      -637
      +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647

      -
      # File 'mrbgems/mruby-string-ext/src/string.c', line 627
      +      
      # File 'mrbgems/mruby-string-ext/src/string.c', line 637
       
       static mrb_value
       mrb_str_tr_s_bang(mrb_state *mrb, mrb_value str)
      @@ -12887,18 +12472,18 @@ 

       
       
      -2408
      -2409
      -2410
      -2411
      -2412
      -2413
      -2414
      -2415
      -2416
      +2649 +2650 +2651 +2652 +2653 +2654 +2655 +2656 +2657

      -
      # File 'src/string.c', line 2408
      +      
      # File 'src/string.c', line 2649
       
       static mrb_value
       mrb_str_upcase(mrb_state *mrb, mrb_value self)
      @@ -12969,30 +12554,30 @@ 

       
       
      -2375
      -2376
      -2377
      -2378
      -2379
      -2380
      -2381
      -2382
      -2383
      -2384
      -2385
      -2386
      -2387
      -2388
      -2389
      -2390
      -2391
      -2392
      -2393
      -2394
      -2395
      -

      -
      # File 'src/string.c', line 2375
      +2616
      +2617
      +2618
      +2619
      +2620
      +2621
      +2622
      +2623
      +2624
      +2625
      +2626
      +2627
      +2628
      +2629
      +2630
      +2631
      +2632
      +2633
      +2634
      +2635
      +2636
      +
      +
      # File 'src/string.c', line 2616
       
       static mrb_value
       mrb_str_upcase_bang(mrb_state *mrb, mrb_value str)
      @@ -13001,7 +12586,7 @@ 

      char *p, *pend; mrb_bool modify = FALSE; - mrb_str_modify(mrb, s); + mrb_str_modify_keep_ascii(mrb, s); p = RSTRING_PTR(str); pend = RSTRING_END(str); while (p < pend) { @@ -13023,7 +12608,7 @@

      - #upto(max, exclusive = false, &block) ⇒ Object + #upto(max, exclusive = false, &block) ⇒ Object @@ -13091,10 +12676,6 @@

       
       
      -401
      -402
      -403
      -404
       405
       406
       407
      @@ -13132,10 +12713,14 @@ 

      439 440 441 -442

      +442 +443 +444 +445 +446

      -
      # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 401
      +      
      # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 405
       
       def upto(max, exclusive=false, &block)
         return to_enum(:upto, max, exclusive) unless block
      @@ -13149,7 +12734,7 @@ 

      e = max.ord while c <= e break if exclusive and c == e - yield c.chr + yield c.chr(__ENCODING__) c += 1 end return self @@ -13189,9 +12774,9 @@

      diff --git a/docs/api/Struct.html b/docs/api/Struct.html index ba3d0e5..9ed2f52 100644 --- a/docs/api/Struct.html +++ b/docs/api/Struct.html @@ -6,7 +6,7 @@ Class: Struct - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
      Inherits:
      - Object + Object

      -
      # File 'mrbgems/mruby-struct/src/struct.c', line 355
      +      
      # File 'mrbgems/mruby-struct/src/struct.c', line 344
       
       static mrb_value
       mrb_struct_initialize(mrb_state *mrb, mrb_value self)
      @@ -692,6 +692,20 @@ 

       
       
      +545
      +546
      +547
      +548
      +549
      +550
      +551
      +552
      +553
      +554
      +555
      +556
      +557
      +558
       559
       560
       561
      @@ -705,24 +719,10 @@ 

      569 570 571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586

      +572

      -
      # File 'mrbgems/mruby-struct/src/struct.c', line 559
      +      
      # File 'mrbgems/mruby-struct/src/struct.c', line 545
       
       static mrb_value
       mrb_struct_equal(mrb_state *mrb, mrb_value s)
      @@ -761,9 +761,9 @@ 

      - #[](symbol) ⇒ Object + #[](symbol) ⇒ Object - #[](fixnum) ⇒ Object + #[](fixnum) ⇒ Object @@ -795,7 +795,7 @@

    1571. - #[](symbol) ⇒ Object + #[](symbol) ⇒ Object
      @@ -811,7 +811,7 @@

    1572. - (Object) + (Object) @@ -826,7 +826,7 @@

    1573. - #[](fixnum) ⇒ Object + #[](fixnum) ⇒ Object
      @@ -842,7 +842,7 @@

    1574. - (Object) + (Object) @@ -866,28 +866,28 @@

       
       
      +428
      +429
      +430
      +431
      +432
      +433
      +434
      +435
      +436
      +437
      +438
      +439
       440
       441
       442
       443
       444
       445
      -446
      -447
      -448
      -449
      -450
      -451
      -452
      -453
      -454
      -455
      -456
      -457
      -458
      +446

    1575. -
      # File 'mrbgems/mruby-struct/src/struct.c', line 440
      +      
      # File 'mrbgems/mruby-struct/src/struct.c', line 428
       
       static mrb_value
       mrb_struct_aref(mrb_state *mrb, mrb_value s)
      @@ -899,7 +899,7 @@ 

      mrb_value sym = mrb_check_intern_str(mrb, idx); if (mrb_nil_p(sym)) { - mrb_name_error(mrb, mrb_intern_str(mrb, idx), "no member '%S' in struct", idx); + mrb_name_error(mrb, mrb_intern_str(mrb, idx), "no member '%v' in struct", idx); } idx = sym; } @@ -917,9 +917,9 @@

      - #[]=(symbol) ⇒ Object + #[]=(symbol) ⇒ Object - #[]=(fixnum) ⇒ Object + #[]=(fixnum) ⇒ Object @@ -953,7 +953,7 @@

    1576. - #[]=(symbol) ⇒ Object + #[]=(symbol) ⇒ Object
      @@ -969,7 +969,7 @@

    1577. - (Object) + (Object) @@ -984,7 +984,7 @@

    1578. - #[]=(fixnum) ⇒ Object + #[]=(fixnum) ⇒ Object
      @@ -1000,7 +1000,7 @@

    1579. - (Object) + (Object) @@ -1024,6 +1024,18 @@

       
       
      +492
      +493
      +494
      +495
      +496
      +497
      +498
      +499
      +500
      +501
      +502
      +503
       504
       505
       506
      @@ -1045,24 +1057,10 @@ 

      522 523 524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539

      +525

    1580. -
      # File 'mrbgems/mruby-struct/src/struct.c', line 504
      +      
      # File 'mrbgems/mruby-struct/src/struct.c', line 492
       
       static mrb_value
       mrb_struct_aset(mrb_state *mrb, mrb_value s)
      @@ -1077,7 +1075,7 @@ 

      mrb_value sym = mrb_check_intern_str(mrb, idx); if (mrb_nil_p(sym)) { - mrb_name_error(mrb, mrb_intern_str(mrb, idx), "no member '%S' in struct", idx); + mrb_name_error(mrb, mrb_intern_str(mrb, idx), "no member '%v' in struct", idx); } idx = sym; } @@ -1089,13 +1087,11 @@

      if (i < 0) i = RSTRUCT_LEN(s) + i; if (i < 0) { mrb_raisef(mrb, E_INDEX_ERROR, - "offset %S too small for struct(size:%S)", - mrb_fixnum_value(i), mrb_fixnum_value(RSTRUCT_LEN(s))); + "offset %i too small for struct(size:%i)", i, RSTRUCT_LEN(s)); } if (RSTRUCT_LEN(s) <= i) { mrb_raisef(mrb, E_INDEX_ERROR, - "offset %S too large for struct(size:%S)", - mrb_fixnum_value(i), mrb_fixnum_value(RSTRUCT_LEN(s))); + "offset %i too large for struct(size:%i)", i, RSTRUCT_LEN(s)); } mrb_struct_modify(mrb, s); return RSTRUCT_PTR(s)[i] = val; @@ -1108,7 +1104,7 @@

      - #_inspectObject + #_inspect(recur_list) ⇒ Object @@ -1132,12 +1128,16 @@

      58 59 60 -61

      +61 +62 +63
      # File 'mrbgems/mruby-struct/mrblib/struct.rb', line 49
       
      -def _inspect
      +def _inspect(recur_list)
      +  return "#<struct #{self.class}:...>" if recur_list[self.object_id]
      +  recur_list[self.object_id] = true
         name = self.class.to_s
         if name[0] == "#"
           str = "#<struct "
      @@ -1146,7 +1146,7 @@ 

      end buf = [] self.each_pair do |k,v| - buf.push [k.to_s + "=" + v._inspect] + buf.push [k.to_s + "=" + v._inspect(recur_list)] end str + buf.join(", ") + ">" end

      @@ -1158,7 +1158,7 @@

      - #dig(idx, *args) ⇒ Object + #dig(idx, *args) ⇒ Object @@ -1187,17 +1187,17 @@

       
       
      +91
      +92
       93
       94
       95
       96
       97
      -98
      -99
      -100
      +98

      -
      # File 'mrbgems/mruby-struct/mrblib/struct.rb', line 93
      +      
      # File 'mrbgems/mruby-struct/mrblib/struct.rb', line 91
       
       def dig(idx,*args)
         n = self[idx]
      @@ -1215,7 +1215,7 @@ 

      - #each(&block) ⇒ Object + #each(&block) ⇒ Object @@ -1266,7 +1266,7 @@

      - #each_pair(&block) ⇒ Object + #each_pair(&block) ⇒ Object @@ -1359,6 +1359,20 @@

       
       
      +582
      +583
      +584
      +585
      +586
      +587
      +588
      +589
      +590
      +591
      +592
      +593
      +594
      +595
       596
       597
       598
      @@ -1372,24 +1386,10 @@ 

      606 607 608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623

      +609

      -
      # File 'mrbgems/mruby-struct/src/struct.c', line 596
      +      
      # File 'mrbgems/mruby-struct/src/struct.c', line 582
       
       static mrb_value
       mrb_struct_eql(mrb_state *mrb, mrb_value s)
      @@ -1427,7 +1427,7 @@ 

      - #initialize_copyObject + #initialize_copyObject @@ -1451,26 +1451,26 @@

       
       
      +356
      +357
      +358
      +359
      +360
      +361
      +362
      +363
      +364
      +365
      +366
       367
       368
       369
       370
       371
      -372
      -373
      -374
      -375
      -376
      -377
      -378
      -379
      -380
      -381
      -382
      -383
      +372

      -
      # File 'mrbgems/mruby-struct/src/struct.c', line 367
      +      
      # File 'mrbgems/mruby-struct/src/struct.c', line 356
       
       static mrb_value
       mrb_struct_init_copy(mrb_state *mrb, mrb_value copy)
      @@ -1497,7 +1497,7 @@ 

      - #inspectObject + #inspectObject @@ -1531,23 +1531,15 @@

       
       
      -72
      -73
       74
       75
      -76
      -77
      -78
      +76

      -
      # File 'mrbgems/mruby-struct/mrblib/struct.rb', line 72
      +      
      # File 'mrbgems/mruby-struct/mrblib/struct.rb', line 74
       
       def inspect
      -  begin
      -    self._inspect
      -  rescue SystemStackError
      -    "#<struct #{self.class.to_s}:...>"
      -  end
      +  self._inspect({})
       end
      -
      # File 'mrbgems/mruby-struct/src/struct.c', line 632
      +      
      # File 'mrbgems/mruby-struct/src/struct.c', line 618
       
       static mrb_value
       mrb_struct_len(mrb_state *mrb, mrb_value self)
      @@ -1730,14 +1722,14 @@ 

       
       
      +107
      +108
      +109
       110
      -111
      -112
      -113
      -114
      +111

      -
      # File 'mrbgems/mruby-struct/src/struct.c', line 110
      +      
      # File 'mrbgems/mruby-struct/src/struct.c', line 107
       
       static mrb_value
       mrb_struct_members(mrb_state *mrb, mrb_value obj)
      @@ -1752,7 +1744,7 @@ 

      - #select(&block) ⇒ Object + #select(&block) ⇒ Object @@ -1903,14 +1895,14 @@

       
       
      -632
      -633
      -634
      -635
      -636
      +618 +619 +620 +621 +622

      -
      # File 'mrbgems/mruby-struct/src/struct.c', line 632
      +      
      # File 'mrbgems/mruby-struct/src/struct.c', line 618
       
       static mrb_value
       mrb_struct_len(mrb_state *mrb, mrb_value self)
      @@ -2020,14 +2012,14 @@ 

       
       
      -645
      -646
      -647
      -648
      -649
      +631 +632 +633 +634 +635

      -
      # File 'mrbgems/mruby-struct/src/struct.c', line 645
      +      
      # File 'mrbgems/mruby-struct/src/struct.c', line 631
       
       static mrb_value
       mrb_struct_to_a(mrb_state *mrb, mrb_value self)
      @@ -2093,24 +2085,24 @@ 

       
       
      -657
      -658
      -659
      -660
      -661
      -662
      -663
      -664
      -665
      -666
      -667
      -668
      -669
      -670
      -671
      +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657

      -
      # File 'mrbgems/mruby-struct/src/struct.c', line 657
      +      
      # File 'mrbgems/mruby-struct/src/struct.c', line 643
       
       static mrb_value
       mrb_struct_to_h(mrb_state *mrb, mrb_value self)
      @@ -2230,14 +2222,14 @@ 

       
       
      -645
      -646
      -647
      -648
      -649
      +631 +632 +633 +634 +635

      -
      # File 'mrbgems/mruby-struct/src/struct.c', line 645
      +      
      # File 'mrbgems/mruby-struct/src/struct.c', line 631
       
       static mrb_value
       mrb_struct_to_a(mrb_state *mrb, mrb_value self)
      @@ -2252,7 +2244,7 @@ 

      - #values_atObject + #values_atObject @@ -2264,19 +2256,19 @@

       
       
      -673
      -674
      -675
      -676
      -677
      -678
      -679
      -680
      -681
      -682
      +659 +660 +661 +662 +663 +664 +665 +666 +667 +668

      -
      # File 'mrbgems/mruby-struct/src/struct.c', line 673
      +      
      # File 'mrbgems/mruby-struct/src/struct.c', line 659
       
       static mrb_value
       mrb_struct_values_at(mrb_state *mrb, mrb_value self)
      @@ -2298,9 +2290,9 @@ 

      diff --git a/docs/api/Symbol.html b/docs/api/Symbol.html index d933073..106641d 100644 --- a/docs/api/Symbol.html +++ b/docs/api/Symbol.html @@ -6,7 +6,7 @@ Class: Symbol - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
      Inherits:
      - Object + Object
        -
      • Object
      • +
      • Object
      • @@ -438,7 +438,7 @@

        Instance Method Details

        - #<=>Object + #<=>Object @@ -462,39 +462,39 @@

         
         
        -537
        -538
        -539
        -540
        -541
        -542
        -543
        -544
        -545
        -546
        -547
        -548
        -549
        -550
        -551
        -552
        -553
        -554
        -555
        -556
        -557
        -558
        -559
        -560
        -561
        -562
        -563
        -564
        -565
        -566
        +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595

      -
      # File 'src/symbol.c', line 537
      +      
      # File 'src/symbol.c', line 566
       
       static mrb_value
       sym_cmp(mrb_state *mrb, mrb_value s1)
      @@ -503,7 +503,7 @@ 

      mrb_sym sym1, sym2; mrb_get_args(mrb, "o", &s2); - if (mrb_type(s2) != MRB_TT_SYMBOL) return mrb_nil_value(); + if (!mrb_symbol_p(s2)) return mrb_nil_value(); sym1 = mrb_symbol(s1); sym2 = mrb_symbol(s2); if (sym1 == sym2) return mrb_fixnum_value(0); @@ -534,7 +534,7 @@

      - #capitalizeObject + #capitalizeObject @@ -569,7 +569,7 @@

      # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 12
       
       def capitalize
      -  (self.to_s.capitalize! || self).to_sym
      +  self.to_s.capitalize.to_sym
       end

      -
      # File 'src/symbol.c', line 326
      +      
      # File 'src/symbol.c', line 339
       
       static mrb_value
       sym_to_s(mrb_state *mrb, mrb_value sym)
       {
      -  return mrb_sym2str(mrb, mrb_symbol(sym));
      +  return mrb_sym_str(mrb, mrb_symbol(sym));
       }
      -
      # File 'src/symbol.c', line 475
      +      
      # File 'src/symbol.c', line 488
       
       static mrb_value
       sym_inspect(mrb_state *mrb, mrb_value sym)
      @@ -975,18 +978,21 @@ 

      mrb_sym id = mrb_symbol(sym); char *sp; - name = mrb_sym2name_len(mrb, id, &len); + name = mrb_sym_name_len(mrb, id, &len); str = mrb_str_new(mrb, 0, len+1); sp = RSTRING_PTR(str); - RSTRING_PTR(str)[0] = ':'; + sp[0] = ':'; memcpy(sp+1, name, len); mrb_assert_int_fit(mrb_int, len, size_t, SIZE_MAX); if (!symname_p(name) || strlen(name) != (size_t)len) { - str = mrb_str_dump(mrb, str); + str = mrb_str_inspect(mrb, str); sp = RSTRING_PTR(str); sp[0] = ':'; sp[1] = '"'; } +#ifdef MRB_UTF8_STRING + if (SYMBOL_INLINE_P(id)) RSTR_SET_ASCII_FLAG(mrb_str_ptr(str)); +#endif return str; }

      -
      # File 'src/symbol.c', line 326
      +      
      # File 'src/symbol.c', line 339
       
       static mrb_value
       sym_to_s(mrb_state *mrb, mrb_value sym)
       {
      -  return mrb_sym2str(mrb, mrb_symbol(sym));
      +  return mrb_sym_str(mrb, mrb_symbol(sym));
       }
      -
      # File 'src/symbol.c', line 343
      +      
      # File 'src/symbol.c', line 356
       
       static mrb_value
       sym_to_sym(mrb_state *mrb, mrb_value sym)
      @@ -1206,7 +1212,7 @@ 

      - #upcaseObject + #upcaseObject @@ -1241,7 +1247,7 @@

      # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 32
       
       def upcase
      -  (self.to_s.upcase! || self).to_sym
      +  self.to_s.upcase.to_sym
       end

      -
      # File 'mrbgems/mruby-time/src/time.c', line 655
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 739
       
       static mrb_value
       mrb_time_initialize(mrb_state *mrb, mrb_value self)
      @@ -1156,7 +1156,7 @@ 

      Instance Method Details

      - #+Object + #+Object @@ -1180,29 +1180,33 @@

       
       
      -478
      -479
      -480
      -481
      -482
      -483
      -484
      -485
      -486
      -487
      +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564

      -
      # File 'mrbgems/mruby-time/src/time.c', line 478
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 553
       
       static mrb_value
       mrb_time_plus(mrb_state *mrb, mrb_value self)
       {
      -  mrb_float f;
      +  mrb_value o;
         struct mrb_time *tm;
      +  time_t sec, usec;
       
      -  mrb_get_args(mrb, "f", &f);
      +  mrb_get_args(mrb, "o", &o);
         tm = time_get_ptr(mrb, self);
      -  return mrb_time_make(mrb, mrb_obj_class(mrb, self), (double)tm->sec+f, (double)tm->usec, tm->timezone);
      +  sec = mrb_to_time_t(mrb, o, &usec);
      +  return mrb_time_make_time(mrb, mrb_obj_class(mrb, self), tm->sec+sec, tm->usec+usec, tm->timezone);
       }
      -
      # File 'mrbgems/mruby-time/src/time.c', line 489
      +566
      +567
      +568
      +569
      +570
      +571
      +572
      +573
      +574
      +575
      +576
      +577
      +578
      +579
      +580
      +581
      +582
      +583
      +584
      +585
      +586
      +587
      +588
      +589
      +590
      +591
      +592
      +593
      +
      +
      # File 'mrbgems/mruby-time/src/time.c', line 566
       
       static mrb_value
       mrb_time_minus(mrb_state *mrb, mrb_value self)
       {
      -  mrb_float f;
         mrb_value other;
         struct mrb_time *tm, *tm2;
       
      @@ -1271,13 +1282,22 @@ 

      tm = time_get_ptr(mrb, self); tm2 = DATA_CHECK_GET_PTR(mrb, other, &mrb_time_type, struct mrb_time); if (tm2) { - f = (mrb_float)(tm->sec - tm2->sec) - + (mrb_float)(tm->usec - tm2->usec) / 1.0e6; +#ifndef MRB_WITHOUT_FLOAT + mrb_float f; + f = (mrb_sec)(tm->sec - tm2->sec) + + (mrb_sec)(tm->usec - tm2->usec) / 1.0e6; return mrb_float_value(mrb, f); +#else + mrb_int f; + f = tm->sec - tm2->sec; + if (tm->usec < tm2->usec) f--; + return mrb_fixnum_value(f); +#endif } else { - mrb_get_args(mrb, "f", &f); - return mrb_time_make(mrb, mrb_obj_class(mrb, self), (double)tm->sec-f, (double)tm->usec, tm->timezone); + time_t sec, usec; + sec = mrb_to_time_t(mrb, other, &usec); + return mrb_time_make_time(mrb, mrb_obj_class(mrb, self), tm->sec-sec, tm->usec-usec, tm->timezone); } }

      -
      # File 'mrbgems/mruby-time/src/time.c', line 452
      +527
      +528
      +529
      +530
      +531
      +532
      +533
      +534
      +535
      +536
      +537
      +538
      +539
      +540
      +541
      +542
      +543
      +544
      +545
      +546
      +547
      +548
      +549
      +550
      +551
      +
      +
      # File 'mrbgems/mruby-time/src/time.c', line 527
       
       static mrb_value
       mrb_time_cmp(mrb_state *mrb, mrb_value self)
      @@ -1374,7 +1394,7 @@ 

      - #==Object + #==Object @@ -1398,23 +1418,23 @@

       
       
      -437
      -438
      -439
      -440
      -441
      -442
      -443
      -444
      -445
      -446
      -447
      -448
      -449
      -450
      +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525

      -
      # File 'mrbgems/mruby-time/src/time.c', line 437
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 512
       
       static mrb_value
       mrb_time_eq(mrb_state *mrb, mrb_value self)
      @@ -1438,7 +1458,7 @@ 

      - #asctimeObject + #asctimeObject @@ -1462,36 +1482,35 @@

       
       
      -560
      -561
      -562
      -563
      -564
      -565
      -566
      -567
      -568
      -569
      -570
      -571
      -572
      -573
      -574
      -575
      -576
      -577
      -578
      -579
      -580
      -581
      -582
      -583
      -584
      -585
      -586
      +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670

      -
      # File 'mrbgems/mruby-time/src/time.c', line 560
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 645
       
       static mrb_value
       mrb_time_asctime(mrb_state *mrb, mrb_value self)
      @@ -1512,10 +1531,9 @@ 

      #else char buf[256]; - len = snprintf(buf, sizeof(buf), "%s %s %02d %02d:%02d:%02d %s%d", + len = snprintf(buf, sizeof(buf), "%s %s %2d %02d:%02d:%02d %.4d", wday_names[d->tm_wday], mon_names[d->tm_mon], d->tm_mday, d->tm_hour, d->tm_min, d->tm_sec, - tm->timezone == MRB_TIMEZONE_UTC ? "UTC " : "", d->tm_year + 1900); #endif return mrb_str_new(mrb, buf, len); @@ -1528,7 +1546,7 @@

      - #ctimeObject + #ctimeObject @@ -1552,36 +1570,35 @@

       
       
      -560
      -561
      -562
      -563
      -564
      -565
      -566
      -567
      -568
      -569
      -570
      -571
      -572
      -573
      -574
      -575
      -576
      -577
      -578
      -579
      -580
      -581
      -582
      -583
      -584
      -585
      -586
      +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670

      -
      # File 'mrbgems/mruby-time/src/time.c', line 560
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 645
       
       static mrb_value
       mrb_time_asctime(mrb_state *mrb, mrb_value self)
      @@ -1602,10 +1619,9 @@ 

      #else char buf[256]; - len = snprintf(buf, sizeof(buf), "%s %s %02d %02d:%02d:%02d %s%d", + len = snprintf(buf, sizeof(buf), "%s %s %2d %02d:%02d:%02d %.4d", wday_names[d->tm_wday], mon_names[d->tm_mon], d->tm_mday, d->tm_hour, d->tm_min, d->tm_sec, - tm->timezone == MRB_TIMEZONE_UTC ? "UTC " : "", d->tm_year + 1900); #endif return mrb_str_new(mrb, buf, len); @@ -1618,7 +1634,7 @@

      - #dayObject + #dayObject @@ -1642,17 +1658,17 @@

       
       
      -590
      -591
      -592
      -593
      -594
      -595
      -596
      -597
      +674 +675 +676 +677 +678 +679 +680 +681

      -
      # File 'mrbgems/mruby-time/src/time.c', line 590
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 674
       
       static mrb_value
       mrb_time_day(mrb_state *mrb, mrb_value self)
      @@ -1707,17 +1723,17 @@ 

       
       
      -602
      -603
      -604
      -605
      -606
      -607
      -608
      -609
      +686 +687 +688 +689 +690 +691 +692 +693

      -
      # File 'mrbgems/mruby-time/src/time.c', line 602
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 686
       
       static mrb_value
       mrb_time_dst_p(mrb_state *mrb, mrb_value self)
      @@ -1786,7 +1802,7 @@ 

      - #getgmObject + #getgmObject @@ -1810,21 +1826,21 @@

       
       
      -614
      -615
      -616
      -617
      -618
      -619
      -620
      -621
      -622
      -623
      -624
      -625
      +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709

      -
      # File 'mrbgems/mruby-time/src/time.c', line 614
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 698
       
       static mrb_value
       mrb_time_getutc(mrb_state *mrb, mrb_value self)
      @@ -1846,7 +1862,7 @@ 

      - #getlocalObject + #getlocalObject @@ -1870,21 +1886,21 @@

       
       
      -629
      -630
      -631
      -632
      -633
      -634
      -635
      -636
      -637
      -638
      -639
      -640
      +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724

      -
      # File 'mrbgems/mruby-time/src/time.c', line 629
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 713
       
       static mrb_value
       mrb_time_getlocal(mrb_state *mrb, mrb_value self)
      @@ -1906,7 +1922,7 @@ 

      - #getutcObject + #getutcObject @@ -1930,21 +1946,21 @@

       
       
      -614
      -615
      -616
      -617
      -618
      -619
      -620
      -621
      -622
      -623
      -624
      -625
      +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709

      -
      # File 'mrbgems/mruby-time/src/time.c', line 614
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 698
       
       static mrb_value
       mrb_time_getutc(mrb_state *mrb, mrb_value self)
      @@ -2003,17 +2019,17 @@ 

       
       
      -819
      -820
      -821
      -822
      -823
      -824
      -825
      -826
      +908 +909 +910 +911 +912 +913 +914 +915

      -
      # File 'mrbgems/mruby-time/src/time.c', line 819
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 908
       
       static mrb_value
       mrb_time_utc_p(mrb_state *mrb, mrb_value self)
      @@ -2031,7 +2047,7 @@ 

      - #gmtimeObject + #gmtimeObject @@ -2055,19 +2071,19 @@

       
       
      -806
      -807
      -808
      -809
      -810
      -811
      -812
      -813
      -814
      -815
      +895 +896 +897 +898 +899 +900 +901 +902 +903 +904

      -
      # File 'mrbgems/mruby-time/src/time.c', line 806
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 895
       
       static mrb_value
       mrb_time_utc(mrb_state *mrb, mrb_value self)
      @@ -2087,7 +2103,7 @@ 

      - #hourObject + #hourObject @@ -2111,17 +2127,17 @@

       
       
      -644
      -645
      -646
      -647
      -648
      -649
      -650
      -651
      +728 +729 +730 +731 +732 +733 +734 +735

      -
      # File 'mrbgems/mruby-time/src/time.c', line 644
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 728
       
       static mrb_value
       mrb_time_hour(mrb_state *mrb, mrb_value self)
      @@ -2139,7 +2155,7 @@ 

      - #initialize_copyObject + #initialize_copyObject @@ -2163,32 +2179,32 @@

       
       
      -683
      -684
      -685
      -686
      -687
      -688
      -689
      -690
      -691
      -692
      -693
      -694
      -695
      -696
      -697
      -698
      -699
      -700
      -701
      -702
      -703
      -704
      -705
      +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789

      -
      # File 'mrbgems/mruby-time/src/time.c', line 683
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 767
       
       static mrb_value
       mrb_time_initialize_copy(mrb_state *mrb, mrb_value copy)
      @@ -2221,86 +2237,38 @@ 

      - #inspectObject + #inspectObject -

      -
      -

      Returns a string that describes the time.

      - - -
      -
      -
      - - -
      - - +
      @@ -2311,7 +2279,7 @@

      - #localtimeObject + #localtimeObject @@ -2335,19 +2303,19 @@

       
       
      -709
      -710
      -711
      -712
      -713
      -714
      -715
      -716
      -717
      -718
      +793 +794 +795 +796 +797 +798 +799 +800 +801 +802

      @@ -2941,7 +2913,7 @@

      - #to_sObject + #to_sObject @@ -2949,7 +2921,7 @@

      -

      Returns a string that describes the time.

      +

      15.2.19.7.3

      @@ -2965,62 +2937,26 @@

       
       
      -560
      -561
      -562
      -563
      -564
      -565
      -566
      -567
      -568
      -569
      -570
      -571
      -572
      -573
      -574
      -575
      -576
      -577
      -578
      -579
      -580
      -581
      -582
      -583
      -584
      -585
      -586
      +948 +949 +950 +951 +952 +953 +954 +955 +956

      @@ -3082,7 +3018,7 @@

      - #usecObject + #usecObject @@ -3090,7 +3026,7 @@

      -

      Returns a Float with the time since the epoch in microseconds.

      +

      Returns an Integer with the time since the epoch in microseconds.

      @@ -3106,20 +3042,22 @@

       
       
      -792
      -793
      -794
      -795
      -796
      -797
      -798
      -799
      -800
      -801
      -802
      +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891

      @@ -3140,7 +3080,7 @@

      - #utcObject + #utcObject @@ -3164,19 +3104,19 @@

       
       
      -806
      -807
      -808
      -809
      -810
      -811
      -812
      -813
      -814
      -815
      +895 +896 +897 +898 +899 +900 +901 +902 +903 +904

      @@ -431,7 +431,7 @@

      - #to_sObject + #to_sObject @@ -469,7 +469,7 @@

      static mrb_value true_to_s(mrb_state *mrb, mrb_value obj) { - return mrb_str_new_lit(mrb, "true"); + return mrb_str_new_lit_frozen(mrb, "true"); } @@ -575,9 +575,9 @@

      diff --git a/docs/api/TypeError.html b/docs/api/TypeError.html index 231938a..4cecfff 100644 --- a/docs/api/TypeError.html +++ b/docs/api/TypeError.html @@ -6,7 +6,7 @@ Exception: TypeError - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ StandardError
        -
      • Object
      • +
      • Object
      • @@ -154,9 +154,9 @@

        Constructor Details

        diff --git a/docs/api/UDPSocket.html b/docs/api/UDPSocket.html index 473c62c..698d538 100644 --- a/docs/api/UDPSocket.html +++ b/docs/api/UDPSocket.html @@ -6,7 +6,7 @@ Class: UDPSocket - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ IPSocket
          -
        • Object
        • +
        • Object
        • @@ -370,7 +370,7 @@

          Instance Method Details

          - #_sockaddr_in(port, host) ⇒ Object + #_sockaddr_in(port, host) ⇒ Object @@ -402,7 +402,7 @@

          - #bind(host, port) ⇒ Object + #bind(host, port) ⇒ Object @@ -434,7 +434,7 @@

          - #connect(host, port) ⇒ Object + #connect(host, port) ⇒ Object @@ -466,7 +466,7 @@

          - #recvfrom_nonblock(*args) ⇒ Object + #recvfrom_nonblock(*args) ⇒ Object @@ -510,7 +510,7 @@

          - #send(mesg, flags, host = nil, port = nil) ⇒ Object + #send(mesg, flags, host = nil, port = nil) ⇒ Object @@ -554,9 +554,9 @@

          diff --git a/docs/api/UNIXServer.html b/docs/api/UNIXServer.html index 1884828..b43272b 100644 --- a/docs/api/UNIXServer.html +++ b/docs/api/UNIXServer.html @@ -6,7 +6,7 @@ Class: UNIXServer - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ UNIXSocket
            -
          • Object
          • +
          • Object
          • @@ -375,7 +375,7 @@

            Instance Method Details

            - #acceptObject + #acceptObject @@ -417,7 +417,7 @@

            - #accept_nonblockObject + #accept_nonblockObject @@ -457,7 +457,7 @@

            - #listen(backlog) ⇒ Object + #listen(backlog) ⇒ Object @@ -489,7 +489,7 @@

            - #sysacceptObject + #sysacceptObject @@ -521,9 +521,9 @@

            diff --git a/docs/api/UNIXSocket.html b/docs/api/UNIXSocket.html index ba0e582..52e1f7a 100644 --- a/docs/api/UNIXSocket.html +++ b/docs/api/UNIXSocket.html @@ -6,7 +6,7 @@ Class: UNIXSocket - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -76,7 +76,7 @@ BasicSocket
              -
            • Object
            • +
            • Object
            • @@ -400,7 +400,7 @@

              Class Method Details

              - .socketpair(type = Socket::SOCK_STREAM, protocol = 0) ⇒ Object + .socketpair(type = Socket::SOCK_STREAM, protocol = 0) ⇒ Object @@ -442,7 +442,7 @@

              Instance Method Details

              - #addrObject + #addrObject @@ -472,7 +472,7 @@

              - #pathObject + #pathObject @@ -502,7 +502,7 @@

              - #peeraddrObject + #peeraddrObject @@ -532,7 +532,7 @@

              - #recvfrom(maxlen, flags = 0) ⇒ Object + #recvfrom(maxlen, flags = 0) ⇒ Object @@ -580,9 +580,9 @@

              diff --git a/docs/api/UnboundMethod.html b/docs/api/UnboundMethod.html index 98a90f8..541d1b3 100644 --- a/docs/api/UnboundMethod.html +++ b/docs/api/UnboundMethod.html @@ -6,7 +6,7 @@ Class: UnboundMethod - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
              Inherits:
              - Object + Object
                -
              • Object
              • +
              • Object
              • @@ -98,9 +98,7 @@
                Defined in:
                -
                mrbgems/mruby-method/src/method.c,
                - mrbgems/mruby-method/mrblib/unbound_method.rb
                -
                +
                mrbgems/mruby-method/src/method.c

              @@ -183,6 +181,52 @@

              +
              +
              + + + + +
            • + + + #bind_call ⇒ Object + + + + + + + + + + + + + +
              +
              + +
            • + + +
            • + + + #eql? ⇒ Boolean + + + + + + + + + + + + +
              @@ -362,7 +406,7 @@

              Instance Method Details

              - #==Object + #==Object @@ -374,10 +418,6 @@

               
               
              -47
              -48
              -49
              -50
               51
               52
               53
              @@ -430,10 +470,14 @@ 

              100 101 102 -103

              +103 +104 +105 +106 +107

      @@ -560,7 +582,7 @@

      - #bindObject + #bindObject @@ -572,20 +594,6 @@

       
       
      -14
      -15
      -16
      -17
      -18
      -19
      -20
      -21
      -22
      -23
      -24
      -25
      -26
      -27
       28
       29
       30
      @@ -602,51 +610,260 @@ 

      41 42 43 -44

      +44 +45 +46 +47 +48

       
       
      -560
      -561
      -562
      -563
      -564
      -565
      -566
      -567
      -568
      -569
      -570
      -571
      -572
      -573
      -574
      -575
      -576
      -577
      -578
      -579
      -580
      -581
      -582
      -583
      -584
      -585
      -586
      +948 +949 +950 +951 +952 +953 +954 +955 +956
      -
      # File 'mrbgems/mruby-time/src/time.c', line 560
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 948
       
       static mrb_value
      -mrb_time_asctime(mrb_state *mrb, mrb_value self)
      +mrb_time_to_s(mrb_state *mrb, mrb_value self)
       {
      +  char buf[64];
         struct mrb_time *tm = time_get_ptr(mrb, self);
      -  struct tm *d = &tm->datetime;
      -  int len;
      -
      -#if defined(MRB_DISABLE_STDIO)
      -  char *s;
      -# ifdef NO_ASCTIME_R
      -  s = asctime(d);
      -# else
      -  char buf[32];
      -  s = asctime_r(d, buf);
      -# endif
      -  len = strlen(s)-1;            /* truncate the last newline */
      -#else
      -  char buf[256];
      -
      -  len = snprintf(buf, sizeof(buf), "%s %s %02d %02d:%02d:%02d %s%d",
      -    wday_names[d->tm_wday], mon_names[d->tm_mon], d->tm_mday,
      -    d->tm_hour, d->tm_min, d->tm_sec,
      -    tm->timezone == MRB_TIMEZONE_UTC ? "UTC " : "",
      -    d->tm_year + 1900);
      -#endif
      +  mrb_bool utc = tm->timezone == MRB_TIMEZONE_UTC;
      +  size_t len = (utc ? time_to_s_utc : time_to_s_local)(mrb, tm, buf, sizeof(buf));
         return mrb_str_new(mrb, buf, len);
       }
      -
      # File 'mrbgems/mruby-time/src/time.c', line 709
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 793
       
       static mrb_value
       mrb_time_localtime(mrb_state *mrb, mrb_value self)
      @@ -2367,7 +2335,7 @@ 

      - #mdayObject + #mdayObject @@ -2391,17 +2359,17 @@

       
       
      -722
      -723
      -724
      -725
      -726
      -727
      -728
      -729
      +806 +807 +808 +809 +810 +811 +812 +813

      -
      # File 'mrbgems/mruby-time/src/time.c', line 722
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 806
       
       static mrb_value
       mrb_time_mday(mrb_state *mrb, mrb_value self)
      @@ -2419,7 +2387,7 @@ 

      - #minObject + #minObject @@ -2443,17 +2411,17 @@

       
       
      -733
      -734
      -735
      -736
      -737
      -738
      -739
      -740
      +817 +818 +819 +820 +821 +822 +823 +824

      -
      # File 'mrbgems/mruby-time/src/time.c', line 733
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 817
       
       static mrb_value
       mrb_time_min(mrb_state *mrb, mrb_value self)
      @@ -2471,7 +2439,7 @@ 

      - #monObject + #monObject @@ -2495,17 +2463,17 @@

       
       
      -744
      -745
      -746
      -747
      -748
      -749
      -750
      -751
      +828 +829 +830 +831 +832 +833 +834 +835

      -
      # File 'mrbgems/mruby-time/src/time.c', line 744
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 828
       
       static mrb_value
       mrb_time_mon(mrb_state *mrb, mrb_value self)
      @@ -2574,7 +2542,7 @@ 

      - #monthObject + #monthObject @@ -2598,17 +2566,17 @@

       
       
      -744
      -745
      -746
      -747
      -748
      -749
      -750
      -751
      +828 +829 +830 +831 +832 +833 +834 +835

      -
      # File 'mrbgems/mruby-time/src/time.c', line 744
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 828
       
       static mrb_value
       mrb_time_mon(mrb_state *mrb, mrb_value self)
      @@ -2677,7 +2645,7 @@ 

      - #secObject + #secObject @@ -2701,17 +2669,17 @@

       
       
      -755
      -756
      -757
      -758
      -759
      -760
      -761
      -762
      +839 +840 +841 +842 +843 +844 +845 +846

      -
      # File 'mrbgems/mruby-time/src/time.c', line 755
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 839
       
       static mrb_value
       mrb_time_sec(mrb_state *mrb, mrb_value self)
      @@ -2831,7 +2799,7 @@ 

      - #to_fObject + #to_fObject @@ -2855,17 +2823,17 @@

       
       
      -767
      -768
      -769
      -770
      -771
      -772
      -773
      -774
      +851 +852 +853 +854 +855 +856 +857 +858

      -
      # File 'mrbgems/mruby-time/src/time.c', line 767
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 851
       
       static mrb_value
       mrb_time_to_f(mrb_state *mrb, mrb_value self)
      @@ -2883,7 +2851,7 @@ 

      - #to_iObject + #to_iObject @@ -2891,7 +2859,7 @@

      -

      Returns a Fixnum with the time since the epoch in seconds.

      +

      Returns an Integer with the time since the epoch in seconds.

      @@ -2907,20 +2875,22 @@

       
       
      -778
      -779
      -780
      -781
      -782
      -783
      -784
      -785
      -786
      -787
      -788
      +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875

      -
      # File 'mrbgems/mruby-time/src/time.c', line 778
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 863
       
       static mrb_value
       mrb_time_to_i(mrb_state *mrb, mrb_value self)
      @@ -2928,9 +2898,11 @@ 

      struct mrb_time *tm; tm = time_get_ptr(mrb, self); +#ifndef MRB_WITHOUT_FLOAT if (tm->sec > MRB_INT_MAX || tm->sec < MRB_INT_MIN) { return mrb_float_value(mrb, (mrb_float)tm->sec); } +#endif return mrb_fixnum_value((mrb_int)tm->sec); }

      -
      # File 'mrbgems/mruby-time/src/time.c', line 560
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 948
       
       static mrb_value
      -mrb_time_asctime(mrb_state *mrb, mrb_value self)
      +mrb_time_to_s(mrb_state *mrb, mrb_value self)
       {
      +  char buf[64];
         struct mrb_time *tm = time_get_ptr(mrb, self);
      -  struct tm *d = &tm->datetime;
      -  int len;
      -
      -#if defined(MRB_DISABLE_STDIO)
      -  char *s;
      -# ifdef NO_ASCTIME_R
      -  s = asctime(d);
      -# else
      -  char buf[32];
      -  s = asctime_r(d, buf);
      -# endif
      -  len = strlen(s)-1;            /* truncate the last newline */
      -#else
      -  char buf[256];
      -
      -  len = snprintf(buf, sizeof(buf), "%s %s %02d %02d:%02d:%02d %s%d",
      -    wday_names[d->tm_wday], mon_names[d->tm_mon], d->tm_mday,
      -    d->tm_hour, d->tm_min, d->tm_sec,
      -    tm->timezone == MRB_TIMEZONE_UTC ? "UTC " : "",
      -    d->tm_year + 1900);
      -#endif
      +  mrb_bool utc = tm->timezone == MRB_TIMEZONE_UTC;
      +  size_t len = (utc ? time_to_s_utc : time_to_s_local)(mrb, tm, buf, sizeof(buf));
         return mrb_str_new(mrb, buf, len);
       }
      -
      # File 'mrbgems/mruby-time/src/time.c', line 792
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 879
       
       static mrb_value
       mrb_time_usec(mrb_state *mrb, mrb_value self)
      @@ -3127,9 +3065,11 @@ 

      struct mrb_time *tm; tm = time_get_ptr(mrb, self); +#ifndef MRB_WITHOUT_FLOAT if (tm->usec > MRB_INT_MAX || tm->usec < MRB_INT_MIN) { return mrb_float_value(mrb, (mrb_float)tm->usec); } +#endif return mrb_fixnum_value((mrb_int)tm->usec); }

      -
      # File 'mrbgems/mruby-time/src/time.c', line 806
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 895
       
       static mrb_value
       mrb_time_utc(mrb_state *mrb, mrb_value self)
      @@ -3233,17 +3173,17 @@ 

       
       
      -819
      -820
      -821
      -822
      -823
      -824
      -825
      -826
      +908 +909 +910 +911 +912 +913 +914 +915

      -
      # File 'mrbgems/mruby-time/src/time.c', line 819
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 908
       
       static mrb_value
       mrb_time_utc_p(mrb_state *mrb, mrb_value self)
      @@ -3261,7 +3201,7 @@ 

      - #wdayObject + #wdayObject @@ -3285,17 +3225,17 @@

       
       
      -512
      -513
      -514
      -515
      -516
      -517
      -518
      -519
      +597 +598 +599 +600 +601 +602 +603 +604

      -
      # File 'mrbgems/mruby-time/src/time.c', line 512
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 597
       
       static mrb_value
       mrb_time_wday(mrb_state *mrb, mrb_value self)
      @@ -3364,7 +3304,7 @@ 

      - #ydayObject + #ydayObject @@ -3388,17 +3328,17 @@

       
       
      -523
      -524
      -525
      -526
      -527
      -528
      -529
      -530
      +608 +609 +610 +611 +612 +613 +614 +615

      -
      # File 'mrbgems/mruby-time/src/time.c', line 523
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 608
       
       static mrb_value
       mrb_time_yday(mrb_state *mrb, mrb_value self)
      @@ -3416,7 +3356,7 @@ 

      - #yearObject + #yearObject @@ -3440,17 +3380,17 @@

       
       
      -534
      -535
      -536
      -537
      -538
      -539
      -540
      -541
      +619 +620 +621 +622 +623 +624 +625 +626

      -
      # File 'mrbgems/mruby-time/src/time.c', line 534
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 619
       
       static mrb_value
       mrb_time_year(mrb_state *mrb, mrb_value self)
      @@ -3468,7 +3408,7 @@ 

      - #zoneObject + #zoneObject @@ -3492,21 +3432,21 @@

       
       
      -545
      -546
      -547
      -548
      -549
      -550
      -551
      -552
      -553
      -554
      -555
      -556
      +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641

      -
      # File 'mrbgems/mruby-time/src/time.c', line 545
      +      
      # File 'mrbgems/mruby-time/src/time.c', line 630
       
       static mrb_value
       mrb_time_zone(mrb_state *mrb, mrb_value self)
      @@ -3530,9 +3470,9 @@ 

      diff --git a/docs/api/TrueClass.html b/docs/api/TrueClass.html index 13c42f5..634cf8c 100644 --- a/docs/api/TrueClass.html +++ b/docs/api/TrueClass.html @@ -6,7 +6,7 @@ Class: TrueClass - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -73,10 +73,10 @@
      Inherits:
      - Object + Object
        -
      • Object
      • +
      • Object
      • @@ -327,7 +327,7 @@

        - #^(obj) ⇒ Object + #^(obj) ⇒ Object @@ -383,7 +383,7 @@

        - #to_sObject + #to_sObject @@ -421,7 +421,7 @@

        static mrb_value true_to_s(mrb_state *mrb, mrb_value obj) { - return mrb_str_new_lit(mrb, "true"); + return mrb_str_new_lit_frozen(mrb, "true"); }

      -
      # File 'mrbgems/mruby-method/src/method.c', line 47
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 51
       
       static mrb_value
       method_eql(mrb_state *mrb, mrb_value self)
      @@ -449,22 +493,22 @@ 

      if (mrb_class(mrb, self) != mrb_class(mrb, other)) return mrb_false_value(); - klass = mrb_class_ptr(IV_GET(self, "@klass")); - if (klass != mrb_class_ptr(IV_GET(other, "@klass"))) + klass = mrb_class_ptr(IV_GET(self, "_klass")); + if (klass != mrb_class_ptr(IV_GET(other, "_klass"))) return mrb_false_value(); - owner = mrb_class_ptr(IV_GET(self, "@owner")); - if (owner != mrb_class_ptr(IV_GET(other, "@owner"))) + owner = mrb_class_ptr(IV_GET(self, "_owner")); + if (owner != mrb_class_ptr(IV_GET(other, "_owner"))) return mrb_false_value(); - receiver = IV_GET(self, "@recv"); - if (!mrb_obj_equal(mrb, receiver, IV_GET(other, "@recv"))) + receiver = IV_GET(self, "_recv"); + if (!mrb_obj_equal(mrb, receiver, IV_GET(other, "_recv"))) return mrb_false_value(); - orig_proc = IV_GET(self, "proc"); - other_proc = IV_GET(other, "proc"); + orig_proc = IV_GET(self, "_proc"); + other_proc = IV_GET(other, "_proc"); if (mrb_nil_p(orig_proc) && mrb_nil_p(other_proc)) { - if (mrb_symbol(IV_GET(self, "@name")) == mrb_symbol(IV_GET(other, "@name"))) + if (mrb_symbol(IV_GET(self, "_name")) == mrb_symbol(IV_GET(other, "_name"))) return mrb_true_value(); else return mrb_false_value(); @@ -500,7 +544,7 @@

      - #arityObject + #arityObject @@ -512,45 +556,23 @@

       
       
      -211
      -212
      -213
      -214
      -215
      -216
      -217
      -218
      -219
      -220
      -221
      -222
      -223
      -224
      -225
      -226
      -227
      -228
      +238 +239 +240 +241 +242 +243 +244

      -
      # File 'mrbgems/mruby-method/src/method.c', line 211
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 238
       
       static mrb_value
       method_arity(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "proc"));
      -  struct RProc *rproc;
      -  struct RClass *orig;
      -  mrb_value ret;
      -
      -  if (mrb_nil_p(proc))
      -    return mrb_fixnum_value(-1);
      -
      -  rproc = mrb_proc_ptr(proc);
      -  orig = rproc->c;
      -  rproc->c = mrb->proc_class;
      -  ret = mrb_funcall(mrb, proc, "arity", 0);
      -  rproc->c = orig;
      -  return ret;
      +  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_proc"));
      +  mrb_int arity = mrb_nil_p(proc) ? -1 : mrb_proc_arity(mrb_proc_ptr(proc));
      +  return mrb_fixnum_value(arity);
       }
      -
      # File 'mrbgems/mruby-method/src/method.c', line 14
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 28
       
       static mrb_value
       unbound_method_bind(mrb_state *mrb, mrb_value self)
       {
         struct RObject *me;
      -  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@owner"));
      -  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@name"));
      -  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "proc"));
      -  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@klass"));
      +  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner"));
      +  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name"));
      +  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_proc"));
      +  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_klass"));
         mrb_value recv;
       
         mrb_get_args(mrb, "o", &recv);
      -
      -  if (mrb_type(owner) != MRB_TT_MODULE &&
      -      mrb_class_ptr(owner) != mrb_obj_class(mrb, recv) &&
      -      !mrb_obj_is_kind_of(mrb, recv, mrb_class_ptr(owner))) {
      -        if (mrb_type(owner) == MRB_TT_SCLASS) {
      -          mrb_raise(mrb, E_TYPE_ERROR, "singleton method called for a different object");
      -        } else {
      -          const char *s = mrb_class_name(mrb, mrb_class_ptr(owner));
      -          mrb_raisef(mrb, E_TYPE_ERROR, "bind argument must be an instance of %S", mrb_str_new_static(mrb, s, strlen(s)));
      -        }
      -  }
      +  bind_check(mrb, recv, owner);
         me = method_object_alloc(mrb, mrb_class_get(mrb, "Method"));
      -  mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "@owner"), owner);
      -  mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "@recv"), recv);
      -  mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "@name"), name);
      -  mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "proc"), proc);
      -  mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "@klass"), klass);
      +  mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_owner"), owner);
      +  mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_recv"), recv);
      +  mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_name"), name);
      +  mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_proc"), proc);
      +  mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_klass"), klass);
       
         return mrb_obj_value(me);
       }
      +
      + +
      +

      + + #bind_callObject + + + + + +

      + + + + +
      +
      +
      +
      +152
      +153
      +154
      +155
      +156
      +157
      +158
      +159
      +160
      +161
      +162
      +163
      +164
      +165
      +
      +
      # File 'mrbgems/mruby-method/src/method.c', line 152
      +
      +static mrb_value
      +method_bcall(mrb_state *mrb, mrb_value self)
      +{
      +  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_proc"));
      +  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name"));
      +  mrb_value recv = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_recv"));
      +  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner"));
      +  mrb_int argc;
      +  mrb_value *argv, block;
      +
      +  mrb_get_args(mrb, "o*&", &recv, &argv, &argc, &block);
      +  bind_check(mrb, recv, owner);
      +  return mcall(mrb, recv, proc, name, mrb_class_ptr(owner), argc, argv, block);
      +}
      +
      +
      + +
      +

      + + #eql?Boolean + + + + + +

      +
      + + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + + + +
      +
      +
      +
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +
      +
      # File 'mrbgems/mruby-method/src/method.c', line 51
      +
      +static mrb_value
      +method_eql(mrb_state *mrb, mrb_value self)
      +{
      +  mrb_value other, receiver, orig_proc, other_proc;
      +  struct RClass *owner, *klass;
      +  struct RProc *orig_rproc, *other_rproc;
      +
      +  mrb_get_args(mrb, "o", &other);
      +  if (!mrb_obj_is_instance_of(mrb, other, mrb_class(mrb, self)))
      +    return mrb_false_value();
      +
      +  if (mrb_class(mrb, self) != mrb_class(mrb, other))
      +    return mrb_false_value();
      +
      +  klass = mrb_class_ptr(IV_GET(self, "_klass"));
      +  if (klass != mrb_class_ptr(IV_GET(other, "_klass")))
      +    return mrb_false_value();
      +
      +  owner = mrb_class_ptr(IV_GET(self, "_owner"));
      +  if (owner != mrb_class_ptr(IV_GET(other, "_owner")))
      +    return mrb_false_value();
      +
      +  receiver = IV_GET(self, "_recv");
      +  if (!mrb_obj_equal(mrb, receiver, IV_GET(other, "_recv")))
      +    return mrb_false_value();
      +
      +  orig_proc = IV_GET(self, "_proc");
      +  other_proc = IV_GET(other, "_proc");
      +  if (mrb_nil_p(orig_proc) && mrb_nil_p(other_proc)) {
      +    if (mrb_symbol(IV_GET(self, "_name")) == mrb_symbol(IV_GET(other, "_name")))
      +      return mrb_true_value();
      +    else
      +      return mrb_false_value();
      +  }
      +
      +  if (mrb_nil_p(orig_proc))
      +    return mrb_false_value();
      +  if (mrb_nil_p(other_proc))
      +    return mrb_false_value();
      +
      +  orig_rproc = mrb_proc_ptr(orig_proc);
      +  other_rproc = mrb_proc_ptr(other_proc);
      +  if (MRB_PROC_CFUNC_P(orig_rproc)) {
      +    if (!MRB_PROC_CFUNC_P(other_rproc))
      +      return mrb_false_value();
      +    if (orig_rproc->body.func != other_rproc->body.func)
      +      return mrb_false_value();
      +  }
      +  else {
      +    if (MRB_PROC_CFUNC_P(other_rproc))
      +      return mrb_false_value();
      +    if (orig_rproc->body.irep != other_rproc->body.irep)
      +      return mrb_false_value();
      +  }
      +
      +  return mrb_true_value();
      +}
      +

      - #inspectObject + #inspectObject @@ -658,22 +875,6 @@

       
       
      -271
      -272
      -273
      -274
      -275
      -276
      -277
      -278
      -279
      -280
      -281
      -282
      -283
      -284
      -285
      -286
       287
       288
       289
      @@ -684,17 +885,33 @@ 

      294 295 296 -297

      +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313

      -
      # File 'mrbgems/mruby-method/src/method.c', line 271
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 287
       
       static mrb_value
       method_to_s(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@owner"));
      -  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@klass"));
      -  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@name"));
      +  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner"));
      +  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_klass"));
      +  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name"));
         mrb_value str = mrb_str_new_lit(mrb, "#<");
         struct RClass *rklass;
       
      @@ -702,16 +919,16 @@ 

      mrb_str_cat_lit(mrb, str, ": "); rklass = mrb_class_ptr(klass); if (mrb_class_ptr(owner) == rklass) { - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, owner, "to_s", 0)); + mrb_str_concat(mrb, str, owner); mrb_str_cat_lit(mrb, str, "#"); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, name, "to_s", 0)); + mrb_str_concat(mrb, str, name); } else { mrb_str_cat_cstr(mrb, str, mrb_class_name(mrb, rklass)); mrb_str_cat_lit(mrb, str, "("); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, owner, "to_s", 0)); + mrb_str_concat(mrb, str, owner); mrb_str_cat_lit(mrb, str, ")#"); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, name, "to_s", 0)); + mrb_str_concat(mrb, str, name); } mrb_str_cat_lit(mrb, str, ">"); return str; @@ -724,7 +941,7 @@

      - #nameObject + #nameObject @@ -736,16 +953,20 @@

       
       
      -6
      -7
      -8
      +401 +402 +403 +404 +405

      -
      # File 'mrbgems/mruby-method/mrblib/unbound_method.rb', line 6
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 401
       
      -def name
      -  @name
      -end
      +static mrb_value +method_name(mrb_state *mrb, mrb_value self) +{ + return mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name")); +}
      @@ -754,7 +975,7 @@

      - #ownerObject + #ownerObject @@ -766,16 +987,20 @@

       
       
      -2
      -3
      -4
      +389 +390 +391 +392 +393

      -
      # File 'mrbgems/mruby-method/mrblib/unbound_method.rb', line 2
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 389
       
      -def owner
      -  @owner
      -end
      +static mrb_value +method_owner(mrb_state *mrb, mrb_value self) +{ + return mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner")); +}
      @@ -784,7 +1009,7 @@

      - #parametersObject + #parametersObject @@ -796,35 +1021,35 @@

       
       
      -249
      -250
      -251
      -252
      -253
      -254
      -255
      -256
      -257
      -258
      -259
      -260
      -261
      -262
      -263
      -264
       265
       266
       267
       268
      -269
      +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285

      -
      # File 'mrbgems/mruby-method/src/method.c', line 249
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 265
       
       static mrb_value
       method_parameters(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "proc"));
      +  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_proc"));
         struct RProc *rproc;
         struct RClass *orig;
         mrb_value ret;
      @@ -850,7 +1075,7 @@ 

      - #source_locationObject + #source_locationObject @@ -862,32 +1087,32 @@

       
       
      -230
      -231
      -232
      -233
      -234
      -235
      -236
      -237
      -238
      -239
      -240
      -241
      -242
      -243
      -244
      -245
       246
      -247
      +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263

      -
      # File 'mrbgems/mruby-method/src/method.c', line 230
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 246
       
       static mrb_value
       method_source_location(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "proc"));
      +  mrb_value proc = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_proc"));
         struct RProc *rproc;
         struct RClass *orig;
         mrb_value ret;
      @@ -910,7 +1135,7 @@ 

      - #super_methodObject + #super_methodObject @@ -922,33 +1147,6 @@

       
       
      -170
      -171
      -172
      -173
      -174
      -175
      -176
      -177
      -178
      -179
      -180
      -181
      -182
      -183
      -184
      -185
      -186
      -187
      -188
      -189
      -190
      -191
      -192
      -193
      -194
      -195
      -196
       197
       198
       199
      @@ -961,18 +1159,45 @@ 

      206 207 208 -209

      +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236

      -
      # File 'mrbgems/mruby-method/src/method.c', line 170
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 197
       
       static mrb_value
       method_super_method(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value recv = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@recv"));
      -  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@klass"));
      -  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@owner"));
      -  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@name"));
      +  mrb_value recv = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_recv"));
      +  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_klass"));
      +  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner"));
      +  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name"));
         struct RClass *super, *rklass;
         struct RProc *proc;
         struct RObject *me;
      @@ -998,11 +1223,11 @@ 

      super = super->c; me = method_object_alloc(mrb, mrb_obj_class(mrb, self)); - mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "@owner"), mrb_obj_value(super)); - mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "@recv"), recv); - mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "@name"), name); - mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "proc"), mrb_obj_value(proc)); - mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "@klass"), mrb_obj_value(rklass)); + mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_owner"), mrb_obj_value(super)); + mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_recv"), recv); + mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_name"), name); + mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_proc"), mrb_obj_value(proc)); + mrb_obj_iv_set(mrb, me, mrb_intern_lit(mrb, "_klass"), mrb_obj_value(rklass)); return mrb_obj_value(me); }

      @@ -1014,7 +1239,7 @@

      - #to_sObject + #to_sObject @@ -1026,22 +1251,6 @@

       
       
      -271
      -272
      -273
      -274
      -275
      -276
      -277
      -278
      -279
      -280
      -281
      -282
      -283
      -284
      -285
      -286
       287
       288
       289
      @@ -1052,17 +1261,33 @@ 

      294 295 296 -297

      +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313

      -
      # File 'mrbgems/mruby-method/src/method.c', line 271
      +      
      # File 'mrbgems/mruby-method/src/method.c', line 287
       
       static mrb_value
       method_to_s(mrb_state *mrb, mrb_value self)
       {
      -  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@owner"));
      -  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@klass"));
      -  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@name"));
      +  mrb_value owner = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner"));
      +  mrb_value klass = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_klass"));
      +  mrb_value name = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name"));
         mrb_value str = mrb_str_new_lit(mrb, "#<");
         struct RClass *rklass;
       
      @@ -1070,16 +1295,16 @@ 

      mrb_str_cat_lit(mrb, str, ": "); rklass = mrb_class_ptr(klass); if (mrb_class_ptr(owner) == rklass) { - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, owner, "to_s", 0)); + mrb_str_concat(mrb, str, owner); mrb_str_cat_lit(mrb, str, "#"); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, name, "to_s", 0)); + mrb_str_concat(mrb, str, name); } else { mrb_str_cat_cstr(mrb, str, mrb_class_name(mrb, rklass)); mrb_str_cat_lit(mrb, str, "("); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, owner, "to_s", 0)); + mrb_str_concat(mrb, str, owner); mrb_str_cat_lit(mrb, str, ")#"); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, name, "to_s", 0)); + mrb_str_concat(mrb, str, name); } mrb_str_cat_lit(mrb, str, ">"); return str; @@ -1094,9 +1319,9 @@

      diff --git a/docs/api/_index.html b/docs/api/_index.html index 0b5c3aa..8843b26 100644 --- a/docs/api/_index.html +++ b/docs/api/_index.html @@ -4,7 +4,7 @@ - Documentation by YARD 0.9.19 + Documentation by YARD 0.9.20 @@ -56,7 +56,7 @@
      -

      Documentation by YARD 0.9.19

      +

      Documentation by YARD 0.9.20

      Alphabetic Index

      @@ -158,6 +158,11 @@

      Namespace Listing A-Z

      +
    1581. + Complex + +
    1582. +
    1583. Constants @@ -223,13 +228,6 @@

      Namespace Listing A-Z

    1584. -
    1585. - FileError - - (File) - -
    1586. -
    1587. FileTest @@ -408,13 +406,6 @@

      Namespace Listing A-Z

    1588. -
    1589. - NoFileError - - (File) - -
    1590. -
    1591. NoMemoryError @@ -443,11 +434,6 @@

      Namespace Listing A-Z

    1592. O
    1593. diff --git a/docs/api/class_list.html b/docs/api/class_list.html index 2ddaeb1..09bb080 100644 --- a/docs/api/class_list.html +++ b/docs/api/class_list.html @@ -51,7 +51,7 @@

      Class List

      diff --git a/docs/api/file.AUTHORS.html b/docs/api/file.AUTHORS.html index d3d9aaa..22e7aba 100644 --- a/docs/api/file.AUTHORS.html +++ b/docs/api/file.AUTHORS.html @@ -6,7 +6,7 @@ File: AUTHORS - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -108,9 +108,9 @@ diff --git a/docs/api/file.CONTRIBUTING.html b/docs/api/file.CONTRIBUTING.html index f40bd58..c50cd5f 100644 --- a/docs/api/file.CONTRIBUTING.html +++ b/docs/api/file.CONTRIBUTING.html @@ -6,7 +6,7 @@ File: CONTRIBUTING - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -98,9 +98,16 @@

      Comply with C99 (ISO/IEC 9899:1999)

      -

      Although we target C99, Visual C++ is also an important target for mruby. For -this reason a declaration of a local variable has to be at the beginning of a -scope block.

      +

      Although we target C99, we’ve heard some compilers in the embedded environment +still requires declarations of local variables to be at the beginning of a +scope. Until we confirm the situation has changed, we use the old-style +variable declaration.

      + +

      Visual C++ is also an important target for mruby (supported version is 2013 or +later). For this reason features that are not supported by Visual C++ may not +be used (e.g. %z of strftime()).

      + +

      NOTE: Old GCC requires -std=gnu99 option to enable C99 support.

      Reduce library dependencies to a minimum

      @@ -136,9 +143,9 @@

      Comply with the Ruby sta diff --git a/docs/api/file.LICENSE.html b/docs/api/file.LICENSE.html index eecdfa8..32e0ae2 100644 --- a/docs/api/file.LICENSE.html +++ b/docs/api/file.LICENSE.html @@ -6,7 +6,7 @@ File: LICENSE - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -83,9 +83,9 @@ diff --git a/docs/api/file.README.html b/docs/api/file.README.html index a90ea78..0ab8144 100644 --- a/docs/api/file.README.html +++ b/docs/api/file.README.html @@ -6,7 +6,7 @@ File: README - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -66,7 +66,7 @@

      What is mruby

      mruby is the lightweight implementation of the Ruby language complying to (part -of) the ISO standard. Its syntax is Ruby 1.9 compatible.

      +of) the ISO standard. Its syntax is Ruby 2.x compatible.

      mruby can be linked and embedded within your application. We provide the interpreter program “mruby” and the interactive mruby shell “mirb” as examples. @@ -80,7 +80,7 @@

      What is mruby

      How to get mruby

      -

      The stable version 2.0.1 of mruby can be downloaded via the following URL: https://github.com/mruby/mruby/archive/2.0.1.zip

      +

      The stable version 2.1.0 of mruby can be downloaded via the following URL: https://github.com/mruby/mruby/archive/2.1.0.zip

      The latest development version of mruby can be downloaded via the following URL: https://github.com/mruby/mruby/zipball/master

      @@ -102,7 +102,7 @@

      Mailing list

      How to compile and install (mruby and gems)

      -

      See the doc/guides/compile.md file.

      +

      See the compile.md file.

      Running Tests

      @@ -116,16 +116,31 @@

      Running Tests

      $ ruby ./minirake test
       
      +

      Building documentation

      + +

      There are two sets of documentation in mruby: the mruby API (generated by yard) and C API (Doxygen)

      + +

      To build both of them, simply go

      + +
      rake doc
      +
      + +

      You can also view them in your browser

      + +
      rake view_api
      +rake view_capi
      +
      +

      How to customize mruby (mrbgems)

      mruby contains a package manager called mrbgems. To create extensions in C and/or Ruby you should create a GEM. For a documentation of how to -use mrbgems consult the file doc/guides/mrbgems.md. For example code of -how to use mrbgems look into the folder examples/mrbgems/.

      +use mrbgems consult the file mrbgems.md. +For example code of how to use mrbgems look into the folder examples/mrbgems/.

      License

      -

      mruby is released under the MIT License.

      +

      mruby is released under the MIT License.

      Note for License

      @@ -146,7 +161,7 @@

      Note for License

      How to Contribute

      -

      See the contribution guidelines, and then send a pull +

      See the contribution guidelines, and then send a pull request to http://github.com/mruby/mruby. We consider you have granted non-exclusive right to your contributed code under MIT license. If you want to be named as one of mruby developers, please include an update to the AUTHORS @@ -155,9 +170,9 @@

      How to Contribute

      diff --git a/docs/api/file.compile.html b/docs/api/file.compile.html index 1e9eab2..5e474e9 100644 --- a/docs/api/file.compile.html +++ b/docs/api/file.compile.html @@ -6,7 +6,7 @@ File: compile - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -69,11 +69,11 @@

      Prerequisites

      To compile mruby out of the source code you need the following tools: -* C Compiler (i.e. gcc) -* Linker (i.e. gcc) -* Archive utility (i.e. ar) -* Parser generator (i.e. bison) -* Ruby 1.8 or 1.9 (i.e. ruby or jruby)

      +* C Compiler (e.g. gcc) +* Linker (e.g. gcc) +* Archive utility (e.g. ar) +* Parser generator (e.g. bison) +* Ruby 2.0 or later (e.g. ruby or jruby)

      Optional: * GIT (to update mruby source and integrate mrbgems easier) @@ -528,7 +528,7 @@

      Build Configuration Examples

      Minimal Library

      To build a minimal mruby library you need to use the Cross Compiling -feature due to the reason that there are functions (i.e. stdio) which +feature due to the reason that there are functions (e.g. stdio) which can’t be disabled for the main build.

      ```ruby @@ -542,7 +542,7 @@

      Minimal Library

      This configuration defines a cross compile build called ‘Minimal’ which is using the GCC and compiles for the host machine. It also disables -all usages of stdio and doesn’t compile any binaries (i.e. mrbc).

      +all usages of stdio and doesn’t compile any binaries (e.g. mrbc).

      Test Environment

      @@ -554,9 +554,9 @@

      Test Environment

      diff --git a/docs/api/file.debugger.html b/docs/api/file.debugger.html index f6ac849..bf8c2b0 100644 --- a/docs/api/file.debugger.html +++ b/docs/api/file.debugger.html @@ -6,7 +6,7 @@ File: debugger - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -101,7 +101,7 @@

      2.1 Building mrdb

      bash $ mrdb --version -mruby 2.0.1 (2019-4-4) +mruby 2.1.0 (2019-11-19)

      2.2 Basic Operation

      @@ -480,9 +480,9 @@

      Step Command

      diff --git a/docs/api/file.gc-arena-howto.html b/docs/api/file.gc-arena-howto.html index 5cbf298..0776a58 100644 --- a/docs/api/file.gc-arena-howto.html +++ b/docs/api/file.gc-arena-howto.html @@ -6,7 +6,7 @@ File: gc-arena-howto - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -243,9 +243,9 @@ diff --git a/docs/api/file.mrbconf.html b/docs/api/file.mrbconf.html index ffd34a2..52ab1f8 100644 --- a/docs/api/file.mrbconf.html +++ b/docs/api/file.mrbconf.html @@ -6,7 +6,7 @@ File: mrbconf - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -113,15 +113,21 @@

      Primitive type configuration.

      * When defined single precision floating point type(C type float) is used as mrb_float. * Else double precision floating point type(C type double) is used as mrb_float.

      +

      MRB_WITHOUT_FLOAT +* When defined removes floating point numbers from mruby. +* It makes mruby easier to handle in “Microcontroller without FPU” and “Kernel Space”.

      +

      MRB_INT16 * When defined int16_t will be defined as mrb_int. -* Conflicts with MRB_INT64.

      +* Conflicts with MRB_INT32 and MRB_INT64.

      + +

      MRB_INT32 +* When defined, or both MRB_INT16 and MRB_INT64 are not defined on 32-bit CPU mode, int32_t will be defined as mrb_int. +* Conflicts with MRB_INT16 and MRB_INT64.

      MRB_INT64 -* When defined int64_t will be defined as mrb_int. -* Conflicts with MRB_INT16. -* When MRB_INT16 or MRB_INT64 isn’t defined int(most of the times 32-bit integer) -will be defined as mrb_int.

      +* When defined, or both MRB_INT16 and MRB_INT32 are not defined on 64-bit CPU mode, int64_t will be defined as mrb_int. +* Conflicts with MRB_INT16 and MRB_INT32.

      Garbage collector configuration.

      @@ -178,7 +184,7 @@

      mrb_value configuration.

      MRB_NAN_BOXING * If defined represent mrb_value in boxed double. -* Conflicts with MRB_USE_FLOAT.

      +* Conflicts with MRB_USE_FLOAT and MRB_WITHOUT_FLOAT.

      MRB_WORD_BOXING * If defined represent mrb_value as a word. @@ -189,6 +195,22 @@

      Instance variable configuration.

      * Default value is 4. * Specifies size of each segment in segment list.

      +

      Reduce heap memory configuration.

      + +

      MRB_USE_LINK_TIME_RO_DATA_P +* Only available on ELF platforms. +* If you specify the address of a read-only section when creating a symbol or string, that string will be used as it is. +* Heap memory can be saved. +* Uses __ehdr_start and __init_array_start. +* It must be __ehdr_start < data_addr < __init_array_start.

      + +

      MRB_USE_CUSTOM_RO_DATA_P +* Takes precedence over MRB_USE_LINK_TIME_RO_DATA_P. +* Please try if MRB_USE_LINK_TIME_RO_DATA_P is not available. +* The mrb_ro_data_p() function is implemented by the user in an arbitrary file. +* The prototype declaration is mrb_bool mrb_ro_data_p(const char *ptr). +* Return TRUE if ptr is in read-only section, otherwise return FALSE.

      +

      Other configuration.

      MRB_UTF8_STRING * Adds UTF-8 encoding support to character-oriented String instance methods. @@ -207,12 +229,29 @@

      Other configuration.

      MRB_STR_BUF_MIN_SIZE * Default value is 128. * Specifies initial capacity of RString created by mrb_str_buf_new function..

      + +

      MRB_METHOD_CACHE +* Improve performance for method dispatch.

      + +

      MRB_METHOD_CACHE_SIZE +* Default value is 128. +* Ignored if MRB_METHOD_CACHE is not defined. +* Need to be the power of 2.

      + +

      MRB_METHOD_T_STRUCT +* Use C struct to represent mrb_method_t +* No MRB_METHOD_T_STRUCT requires highest 2 bits of function pointers to be zero +* Define this macro on machines that use higher bits of pointers

      + +

      MRB_ENABLE_ALL_SYMBOLS +* Make it available Symbols.all_symbols in mrbgems/mruby-symbol-ext +* Increase heap memory usage.

      diff --git a/docs/api/file.mrbgems.html b/docs/api/file.mrbgems.html index 2277e93..3f3bd9a 100644 --- a/docs/api/file.mrbgems.html +++ b/docs/api/file.mrbgems.html @@ -6,7 +6,7 @@ File: mrbgems - — Documentation by YARD 0.9.19 + — Documentation by YARD 0.9.20 @@ -100,6 +100,11 @@

      Usage

      conf.gem :mgem => 'yaml' # 'mruby-' prefix could be omitted

      +

      For specifying commit hash to checkout use :checksum_hash option: +ruby +conf.gem mgem: 'mruby-redis', checksum_hash: '3446d19fc4a3f9697b5ddbf2a904f301c42f2f4e' +

      +

      If there is missing dependencies, mrbgem dependencies solver will reference mrbgem from core or mgem-list.

      @@ -418,9 +423,9 @@

      Example

      diff --git a/docs/api/frames.html b/docs/api/frames.html index 2caef9d..60223fe 100644 --- a/docs/api/frames.html +++ b/docs/api/frames.html @@ -2,7 +2,7 @@ - Documentation by YARD 0.9.19 + Documentation by YARD 0.9.20 + + From 0bfd52f13dc384e1bca22f13d9951c835991a7a1 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Thu, 24 Dec 2020 07:27:02 +1000 Subject: [PATCH 027/250] Create CODEOWNERS refs https://github.com/mruby/mruby/pull/5242 --- CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..9f91caa --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @matz From b34eaf2a3a17f4c372c45dad3b78247a76067125 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Thu, 24 Dec 2020 10:18:37 +1000 Subject: [PATCH 028/250] Add Jekyll Sitemap This creates both a `sitemap.xml` and a `robots.txt` file in the web root --- Gemfile | 6 +++++- Gemfile.lock | 1 + _config.yml | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 08108e8..205d605 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,10 @@ source 'https://rubygems.org' -gem 'github-pages' +gem 'github-pages', group: :jekyll_plugins + +group :jekyll_plugins do + gem 'jekyll-sitemap' +end group :scripts do gem 'mgem' diff --git a/Gemfile.lock b/Gemfile.lock index 3fc6b66..ce95056 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -266,6 +266,7 @@ PLATFORMS DEPENDENCIES git github-pages + jekyll-sitemap mgem yard-coderay yard-mruby diff --git a/_config.yml b/_config.yml index 8210404..1b98cdb 100644 --- a/_config.yml +++ b/_config.yml @@ -11,6 +11,8 @@ highlighter: rouge url: https://mruby.org repository: https://github.com/mruby/mruby.github.io include: _index.html +plugins: + - jekyll-sitemap exclude: - Gemfile - Gemfile.lock From e4fb0a3954907b1f53b9dbc619a00c26e8e41b61 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Fri, 25 Dec 2020 22:42:41 +1000 Subject: [PATCH 029/250] Exclude CODEOWNERS file from Jekyll build --- _config.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/_config.yml b/_config.yml index 8210404..0022c14 100644 --- a/_config.yml +++ b/_config.yml @@ -12,8 +12,9 @@ url: https://mruby.org repository: https://github.com/mruby/mruby.github.io include: _index.html exclude: -- Gemfile -- Gemfile.lock -- README.md -- gen_mgemdata.rb -- vendor + - CODEOWNERS + - Gemfile + - Gemfile.lock + - README.md + - gen_mgemdata.rb + - vendor From 6a25e26c38b0b77fd8e37144f7c875e164c180c7 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sat, 26 Dec 2020 17:07:44 +1000 Subject: [PATCH 030/250] Exclude gen_mrbdoc.rb from Jekyll build --- _config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/_config.yml b/_config.yml index 0022c14..fbeeb8d 100644 --- a/_config.yml +++ b/_config.yml @@ -17,4 +17,5 @@ exclude: - Gemfile.lock - README.md - gen_mgemdata.rb + - gen_mrbdoc.rb - vendor From c78f7c127f715c30163c53b9fed17e91cc9de6a8 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sun, 27 Dec 2020 14:18:21 +1000 Subject: [PATCH 031/250] Embed YouTube video - An Introduction to mRuby | Ruby Creator Yukihiro "Matz" Matsumoto on about page https://www.youtube.com/watch?v=Xa08hqK7ozs Add mruby3.0 video --- about/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/about/index.html b/about/index.html index 49ae9cc..19a6256 100644 --- a/about/index.html +++ b/about/index.html @@ -17,4 +17,7 @@

      About mruby

      {% include _latest_news.html %} + + + From e08fda53d8f1d953059077bc3dae2c4178da4157 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 30 Dec 2020 07:57:17 +0900 Subject: [PATCH 032/250] Update CNAME --- CNAME | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CNAME b/CNAME index da95eec..cd91bbf 100644 --- a/CNAME +++ b/CNAME @@ -1 +1 @@ -mruby.org +www.mruby.org \ No newline at end of file From 156cfc60a5acd47892897094642bb80945573553 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 30 Dec 2020 08:10:20 +0900 Subject: [PATCH 033/250] Update CNAME --- CNAME | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CNAME b/CNAME index cd91bbf..386f361 100644 --- a/CNAME +++ b/CNAME @@ -1 +1 @@ -www.mruby.org \ No newline at end of file +mruby.org \ No newline at end of file From 03418eb53844ce41f3d5789c87e6d3f86508faef Mon Sep 17 00:00:00 2001 From: spectralapps <56676505+spectralapps@users.noreply.github.com> Date: Tue, 5 Jan 2021 19:41:08 -0300 Subject: [PATCH 034/250] Fix broken navbar --- _includes/navigation.html | 54 +++++++++++++++++---------------------- css/main.css | 6 +++-- 2 files changed, 27 insertions(+), 33 deletions(-) diff --git a/_includes/navigation.html b/_includes/navigation.html index 2258e71..6646053 100644 --- a/_includes/navigation.html +++ b/_includes/navigation.html @@ -1,34 +1,26 @@ - diff --git a/css/main.css b/css/main.css index ffa319f..6f20fc1 100644 --- a/css/main.css +++ b/css/main.css @@ -8,6 +8,8 @@ a { .navbar-header img { margin-left: 160px; + top:0; + position: absolute; } .footer { @@ -25,7 +27,7 @@ a { right: 0px; left: 0px; z-index: 100; - height: 90px; + height: unset; } .navbar-mruby .navbar-brand { @@ -48,7 +50,7 @@ a { } .navbar-mruby .navbar-nav > li > a { - padding: 17px 22px; + padding: 15px 22px!important; color: #ce2812; } .navbar-mruby .navbar-nav > li > a:hover, .navbar-mruby .navbar-nav > li > a:focus { From 50afbb0798252064e435041ae348b64c1bd4bdd1 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 3 Feb 2021 15:39:31 +0900 Subject: [PATCH 035/250] Update `Gemfile.lock` for `nokogiri`. Fixes dependabot alert. --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ce95056..b60c426 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -213,7 +213,7 @@ GEM jekyll-seo-tag (~> 2.1) minitest (5.14.2) multipart-post (2.1.1) - nokogiri (1.10.10) + nokogiri (~> 1.11.0) mini_portile2 (~> 2.4.0) octokit (4.18.0) faraday (>= 0.9) From 723a3090ffd142dc169492ac9e0177fc8e75fa48 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 3 Feb 2021 15:40:18 +0900 Subject: [PATCH 036/250] update data/mgems.yml file. --- _data/mgems.yml | 58 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/_data/mgems.yml b/_data/mgems.yml index 6c14020..0e2beac 100644 --- a/_data/mgems.yml +++ b/_data/mgems.yml @@ -23,9 +23,9 @@ - name: mruby-ansi-colors description: Extends String class to use ANSI color escape codes. author: Mav7 - website: https://github.com/Mav7/mruby-ansi-colors + website: https://github.com/mruby-Forum/mruby-ansi-colors protocol: git - repository: https://github.com/Mav7/mruby-ansi-colors.git + repository: https://github.com/mruby-Forum/mruby-ansi-colors.git repooptions: - name: mruby-apr description: Cross platform standard library components à la MRI @@ -282,6 +282,13 @@ protocol: git repository: https://github.com/mobiruby/mruby-cocoa.git repooptions: +- name: mruby-complex + description: Complex numbers. + author: Paolo Bosetti, University of Trento + website: https://github.com/pbosetti/mruby-complex + protocol: git + repository: https://github.com/pbosetti/mruby-complex.git + repooptions: - name: mruby-concurrently description: A concurrency framework based on fibers author: Christopher Aue @@ -828,6 +835,13 @@ protocol: git repository: https://github.com/FlavourSys/mruby-inotify.git repooptions: +- name: mruby-io + description: IO, File class implementation + author: iij + website: https://github.com/iij/mruby-io + protocol: git + repository: https://github.com/iij/mruby-io.git + repooptions: - name: mruby-io-console description: The implementation of io/console as CRuby. author: ksss @@ -1052,6 +1066,14 @@ protocol: git repository: https://github.com/take-cheeze/mruby-marshal.git repooptions: +- name: mruby-marshal-c + description: Marshal module for mruby written in C-language with full object-link + & symbol link support + author: Lanza Schneider + website: https://github.com/LanzaSchneider/mruby-marshal-c + protocol: git + repository: https://github.com/LanzaSchneider/mruby-marshal-c.git + repooptions: - name: mruby-marshal-fast description: Marshal module for mruby written in C, with speed advantages author: Carlo Prelz @@ -1067,7 +1089,7 @@ repository: https://github.com/listrophy/mruby-matrix.git repooptions: - name: mruby-maxminddb - description: mruby [GeoIP2 MaxMind DB](http://maxmind.github.io/MaxMind-DB/) reader + description: mruby [GeoIP2 MaxMind DB](https://maxmind.github.io/MaxMind-DB/) reader author: Kenichi Mitsugi website: https://github.com/happysiro/mruby-maxminddb protocol: git @@ -1313,6 +1335,13 @@ protocol: git repository: https://github.com/IceDragon200/mruby-oui repooptions: +- name: mruby-pack + description: Array#pack implementation + author: Internet Initiative Japan., Inc. + website: https://github.com/iij/mruby-pack + protocol: git + repository: https://github.com/iij/mruby-pack.git + repooptions: - name: mruby-passwdqc description: A Password quality checker author: Hendrik Beskow @@ -1502,6 +1531,13 @@ protocol: git repository: https://github.com/UniTN-Mechatronics/mruby-raspberry.git repooptions: +- name: mruby-rational + description: Rational class + author: Daisuke YAMAGUCHI + website: https://github.com/dyama/mruby-rational + protocol: git + repository: https://github.com/dyama/mruby-rational.git + repooptions: - name: mruby-rcon description: resource management mrbgem using cgroup author: MATSUMOTO Ryosuke @@ -1759,6 +1795,13 @@ protocol: git repository: https://github.com/ksss/mruby-siphash.git repooptions: +- name: mruby-sleep + description: Sleep Module + author: MATSUMOTO Ryosuke + website: https://github.com/matsumotory/mruby-sleep + protocol: git + repository: https://github.com/matsumotory/mruby-sleep.git + repooptions: - name: mruby-smallhttp description: Small http-client gem for mruby author: Nazarii Sheremet @@ -1766,6 +1809,13 @@ protocol: git repository: https://github.com/nsheremet/mruby-smallhttp.git repooptions: +- name: mruby-socket + description: Socket library for mruby + author: iij + website: https://github.com/iij/mruby-socket + protocol: git + repository: https://github.com/iij/mruby-socket.git + repooptions: - name: mruby-spdy description: SPDY module for mruby author: MATSUMOTO Ryosuke @@ -1783,7 +1833,7 @@ repository: https://github.com/k0kubun/mruby-specinfra.git repooptions: - name: mruby-sqlite - description: "(Another) SQLite3 mrbgem, aiming for compatibility with MRI's sqlite3 + description: "(Another) SQLite3 mrbgem, aiming for compatability with MRI's sqlite3 gem." author: Jared Breeden website: https://github.com/jbreeden/mruby-sqlite From 821042c663548a51cb9bca763e38899ebfb6da40 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sat, 13 Feb 2021 18:43:00 +1000 Subject: [PATCH 037/250] feat: add Dependabot config file and configure Ruby updates with bundler --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..41964bb --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# Basic set up + +version: 2 +updates: + + # Maintain dependencies for Ruby + - package-ecosystem: "bundler" + directory: "/" + schedule: + interval: "daily" From ce9fbae2b7f037e8c5a9f66d1b7dbf924566bcba Mon Sep 17 00:00:00 2001 From: mimaki Date: Fri, 5 Mar 2021 17:54:18 +0900 Subject: [PATCH 038/250] mruby 3.0.0 released. --- .../2021-03-05-mruby-3.0.0-released.markdown | 135 ++++++++++++++++++ downloads/index.html | 2 +- index.html | 2 +- 3 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 _posts/2021-03-05-mruby-3.0.0-released.markdown diff --git a/_posts/2021-03-05-mruby-3.0.0-released.markdown b/_posts/2021-03-05-mruby-3.0.0-released.markdown new file mode 100644 index 0000000..49cc775 --- /dev/null +++ b/_posts/2021-03-05-mruby-3.0.0-released.markdown @@ -0,0 +1,135 @@ +--- +layout: post +title: "mruby 3.0.- released" +date: 2021-03-05 00:00:00 +categories: releases +--- + +# mruby 3.0.0 + +We are announcing the first stable release of mruby 3.0 series - [mruby 3.0.0](https://github.com/mruby/mruby/releases/tag/3.0.0). + +With mruby 3.0, the memory used of the mruby VM has been significantly reduced, and we have succeeded in significantly saving memory. +Previous versions required several hundred KB of RAM, but mruby 3.0 can launch an application with about 100 KB of RAM. + +Describes the new features and changes in mruby 3.0. +The main changes in mruby 3.0 are also described in [doc/mruby3.md](https://github.com/mruby/mruby/blob/master/doc/mruby3.md). + +--- + +# New Features + +## Core Language Features + +- Implement endless-def. [Ruby:Feature#16746](https://bugs.ruby-lang.org/issues/16746) +- Replace `R-assignment` by `single-line pattern matching`. [Ruby:Feature#15921](https://bugs.ruby-lang.org/issues/15921) +- Support squiggly heredocs. [#5246](https://github.com/mruby/mruby/pull/5246) + +## Features for mruby Developer + +- Add new C APIs + - `mrbc_cleanup_local_variables()` - Clean up local variables on mrbc_context. [#4931](https://github.com/mruby/mruby/pull/4931) + - Add functions that take symbols as arguments. + - `mrb_define_singleton_method_id()` + - `mrb_define_class_method_id()` + - `mrb_define_module_function_id()` + - `mrb_undef_method_id()` + - `mrb_undef_class_method_id()` + - `mrb_define_const_id()` + - `mrb_funcall_id()` + - Add functions for symbol checking that return mrb_sym value. + - `mrb_intern_check()` + - `mrb_intern_check_cstr()` + - `mrb_intern_check_str()` + - `mrb_fiber_resume()` - Allow context switch from C module. + +--- + +# Update Features + +## Reduce memory usage + +- Preallocate Symbols + The mruby 3.0 can now significantly reduce RAM usage by allocating symbols to static memory area at compile time. See [doc/guides/symbol.md](https://github.com/mruby/mruby/blob/master/doc/guides/symbol.md) for more information. +- Reduce memory usage of Hash objects. [f2d8db39](https://github.com/mruby/mruby/commit/f2d8db39) +- Reduce memory usage when calling methods. [#5272](https://github.com/mruby/mruby/pull/5272) + +## Updated build process + +The old build configuration file `build_config.rb` has been reconfigured to a file in the `build_config` directory. +For example, the following typical build configuration is available. + +- `default`: the default configuration +- `host-gprof`: compiles with `gprof` for performance tuning +- `host-m32`: compiles in gcc 32bit mode on 64bit platforms +- `boxing`: compiles all three boxing options +- `clang-asan`: compiles with clang's Address Sanitizer + +You can specify the mruby build configuration by building mruby with the `rake` build, specifying the build configuration file in the environment variable `MRUBY_CONFIG`. + +## Core Libraries + +- Add new libraries. + - `mruby-catch` - Support `Kernel.#catch` and `Kernel.#throw`. [7eaaee54](https://github.com/mruby/mruby/commit/7eaaee54) + - `mruby-os-memsize` - Support `ObjectSpace.memsize_of` and `ObjectSpace.memsize_of_all`. [#5032](https://github.com/mruby/mruby/pull/5032) [#5040](https://github.com/mruby/mruby/pull/5040) [#5041](https://github.com/mruby/mruby/pull/5041) +- Add `Array.new([])` initialization. (mruby-array) +- Add `Hash#except` (mruby-hash-ext) +- Update `IO#popen` to use keyword arguments. (mruby-io) +- Make `Module#include` and `Module#prepend` behave like Ruby 3.0. [3972df57](https://github.com/mruby/mruby/commit/3972df57) + +## Tools + +- Allow to mixed and specify `*.rb` and `*.mrb` in `mruby` interpreter. [a045b6b8](https://github.com/mruby/mruby/commit/a045b6b8) +- Add `irep` C struct dump from `mrbc` with `-S` option. + +## Features for mruby Developer + +- Add new specifier `c` to `mrb_get_args()` for receive Class/Module. + +--- + +# Breaking Changes + +## mruby VM and bytecode + +Due to improvements in the binary format, mruby binaries are no longer backward compatible. +To run the mruby binaries on mruby 3.0, recompile with the mruby 3.0 `mrbc`. + +- Upgrade mruby VM version `RITE_VM_VER` to `0300` (means mruby 3.0). +- Upgrade mruby binary version `RITE_BINARY_FORMAT_VER` to `0200`. + +## Recognize Integer system + +`Integer` has been changed to a specification similar to CRuby. + +- Integrate `Finxnum` and `Integer`. +- Remove `Integral`. +- `int / int -> int` +- Add APIs for `Integer`. APIs for`Fixnum` (`mrb_fixnum_xxx()`) is also left for compatibility. + - `mrb_fixnum()` -> `mrb_integer()` + - `mrb_fixnum_value()` -> `mrb_int_value()` + - `mrb_fixnum_p()` -> `mrb_integer_p()` + +--- + +# Major bug fixes + +- Fix take over file scope variables with `mruby` and `mirb` command. [#4933](https://github.com/mruby/mruby/issues/4933) +- Fix performing `block_given?` from inside an orphan block always returns false. [#5039](https://github.com/mruby/mruby/issues/5039) +- Fix segmentation fault in Mruby interpreter making it crash [#5046](https://github.com/mruby/mruby/issues/5046) +- Fix splat operator to frozen Array raises FrozenError. [#5067](https://github.com/mruby/mruby/issues/5067) +- Fix wrong behavior of File.extname when the filename starts or ends with a period. (mruby-io) [#5077](https://github.com/mruby/mruby/issues/5077) +- Fix #parameters mistakes keyword "splat" for a block parameter. [#5066](https://github.com/mruby/mruby/issues/5066) +- Fix mruby-io doesn't work in processes started as Windows service. [#5114](https://github.com/mruby/mruby/issues/5114) +- Fix resuming fiber from C seems to loop infinitely. [#5261](https://github.com/mruby/mruby/issues/5261) +- Fix invalid UTF-8 string length. [#5269](https://github.com/mruby/mruby/issues/5269) +- Fix avoid syntax error when EXPR_MID appears in conditional operator. [#5290](https://github.com/mruby/mruby/issues/5290) +- Fix symbols like numbered parameters in blocks get a syntax error. [#5295](https://github.com/mruby/mruby/issues/5295) +- Avoid infinite loops when converting objects to strings. [01a8d849](https://github.com/mruby/mruby/commit/01a8d849) +- Fix module order of `#include`. [ruby-bug:7844](https://bugs.ruby-lang.org/issues/7844) + +--- + +We have done 983 commits to 274 files with 16,929 additions and 11,685 deletions since mruby 2.1.2. For more detail of the updates, [see Commit Log](https://github.com/mruby/mruby/compare/2.1.2...3.0.0). + +Thanks to all the contributors who have worked on bug fixes and improvements in the release of `mruby 3.0.0`. diff --git a/downloads/index.html b/downloads/index.html index 46574c2..f7c252b 100644 --- a/downloads/index.html +++ b/downloads/index.html @@ -7,7 +7,7 @@

      Downloads

      - Current stable: mruby 2.1.2 + Current stable: mruby 3.0.0

      diff --git a/index.html b/index.html index 79720ee..4d560fb 100644 --- a/index.html +++ b/index.html @@ -11,7 +11,7 @@

      From 2fb7cff0b0f0db00c82e12d0f5093514ace8eabf Mon Sep 17 00:00:00 2001 From: mimaki Date: Fri, 5 Mar 2021 18:00:58 +0900 Subject: [PATCH 039/250] Fix typo. --- _posts/2021-03-05-mruby-3.0.0-released.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/2021-03-05-mruby-3.0.0-released.markdown b/_posts/2021-03-05-mruby-3.0.0-released.markdown index 49cc775..bd3b199 100644 --- a/_posts/2021-03-05-mruby-3.0.0-released.markdown +++ b/_posts/2021-03-05-mruby-3.0.0-released.markdown @@ -1,6 +1,6 @@ --- layout: post -title: "mruby 3.0.- released" +title: "mruby 3.0.0 released" date: 2021-03-05 00:00:00 categories: releases --- From d136dea0ecc6e3e18eb812a6a9410423e362a545 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Thu, 24 Dec 2020 12:21:06 +1000 Subject: [PATCH 040/250] Add Jekyll RSS - Use Jekyll Feed - Strip whitespace from the Gemfile - Add `rss.xml` in the web root --- Gemfile | 7 ++-- Gemfile.lock | 70 ++++++++++++++++++++++---------------- _config.yml | 1 + _includes/footer.html | 5 +++ images/icons/rss-feed.png | Bin 0 -> 1138 bytes rss.xml | 31 +++++++++++++++++ 6 files changed, 81 insertions(+), 33 deletions(-) create mode 100644 images/icons/rss-feed.png create mode 100644 rss.xml diff --git a/Gemfile b/Gemfile index 205d605..07e5dc0 100644 --- a/Gemfile +++ b/Gemfile @@ -3,12 +3,13 @@ source 'https://rubygems.org' gem 'github-pages', group: :jekyll_plugins group :jekyll_plugins do + gem 'jekyll-feed' gem 'jekyll-sitemap' end -group :scripts do - gem 'mgem' - gem 'git' +group :scripts do + gem 'mgem' + gem 'git' # API Docs gem 'yard-mruby' diff --git a/Gemfile.lock b/Gemfile.lock index b60c426..2b132ef 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - activesupport (6.0.3.3) + activesupport (6.0.3.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -17,8 +17,8 @@ GEM colorator (1.1.0) commonmarker (0.17.13) ruby-enum (~> 0.5) - concurrent-ruby (1.1.7) - dnsruby (1.61.4) + concurrent-ruby (1.1.8) + dnsruby (1.61.5) simpleidn (~> 0.1) em-websocket (0.5.2) eventmachine (>= 0.12.9) @@ -27,21 +27,24 @@ GEM ffi (>= 1.3.0) eventmachine (1.2.7) execjs (2.7.0) - faraday (1.0.1) + faraday (1.3.0) + faraday-net_http (~> 1.0) multipart-post (>= 1.2, < 3) - ffi (1.13.1) + ruby2_keywords + faraday-net_http (1.0.1) + ffi (1.14.2) forwardable-extended (2.6.0) gemoji (3.0.1) - git (1.7.0) + git (1.8.1) rchardet (~> 1.8) - github-pages (208) - github-pages-health-check (= 1.16.1) + github-pages (212) + github-pages-health-check (= 1.17.0) jekyll (= 3.9.0) jekyll-avatar (= 0.7.0) jekyll-coffeescript (= 1.1.1) jekyll-commonmark-ghpages (= 0.1.6) jekyll-default-layout (= 0.1.4) - jekyll-feed (= 0.15.0) + jekyll-feed (= 0.15.1) jekyll-gist (= 1.5.0) jekyll-github-metadata (= 2.13.0) jekyll-mentions (= 1.6.0) @@ -52,7 +55,7 @@ GEM jekyll-relative-links (= 0.6.1) jekyll-remote-theme (= 0.4.2) jekyll-sass-converter (= 1.5.2) - jekyll-seo-tag (= 2.6.1) + jekyll-seo-tag (= 2.7.1) jekyll-sitemap (= 1.4.0) jekyll-swiss (= 1.0.0) jekyll-theme-architect (= 0.1.1) @@ -76,13 +79,13 @@ GEM mercenary (~> 0.3) minima (= 2.5.1) nokogiri (>= 1.10.4, < 2.0) - rouge (= 3.23.0) + rouge (= 3.26.0) terminal-table (~> 1.4) - github-pages-health-check (1.16.1) + github-pages-health-check (1.17.0) addressable (~> 2.3) dnsruby (~> 1.60) octokit (~> 4.0) - public_suffix (~> 3.0) + public_suffix (>= 2.0.2, < 5.0) typhoeus (~> 1.3) html-pipeline (2.14.0) activesupport (>= 2) @@ -117,7 +120,7 @@ GEM rouge (>= 2.0, < 4.0) jekyll-default-layout (0.1.4) jekyll (~> 3.0) - jekyll-feed (0.15.0) + jekyll-feed (0.15.1) jekyll (>= 3.7, < 5.0) jekyll-gist (1.5.0) octokit (~> 4.2) @@ -143,8 +146,8 @@ GEM rubyzip (>= 1.3.0, < 3.0) jekyll-sass-converter (1.5.2) sass (~> 3.4) - jekyll-seo-tag (2.6.1) - jekyll (>= 3.3, < 5.0) + jekyll-seo-tag (2.7.1) + jekyll (>= 3.8, < 5.0) jekyll-sitemap (1.4.0) jekyll (>= 3.7, < 5.0) jekyll-swiss (1.0.0) @@ -201,34 +204,39 @@ GEM kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) liquid (4.0.3) - listen (3.2.1) + listen (3.4.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.3.6) mgem (0.3.0) - mini_portile2 (2.4.0) + mini_portile2 (2.5.0) minima (2.5.1) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.14.2) + minitest (5.14.4) multipart-post (2.1.1) - nokogiri (~> 1.11.0) - mini_portile2 (~> 2.4.0) - octokit (4.18.0) + nokogiri (1.11.1) + mini_portile2 (~> 2.5.0) + racc (~> 1.4) + nokogiri (1.11.1-x86_64-darwin) + racc (~> 1.4) + octokit (4.20.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (3.1.1) + public_suffix (4.0.6) + racc (1.5.2) rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) rchardet (1.8.0) rexml (3.2.4) - rouge (3.23.0) - ruby-enum (0.8.0) + rouge (3.26.0) + ruby-enum (0.9.0) i18n + ruby2_keywords (0.0.4) rubyzip (2.3.0) safe_yaml (1.0.5) sass (3.7.4) @@ -239,37 +247,39 @@ GEM sawyer (0.8.2) addressable (>= 2.3.5) faraday (> 0.8, < 2.0) - simpleidn (0.1.1) + simpleidn (0.2.1) unf (~> 0.1.4) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) thread_safe (0.3.6) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (1.2.7) + tzinfo (1.2.9) thread_safe (~> 0.1) unf (0.1.4) unf_ext unf_ext (0.0.7.7) unicode-display_width (1.7.0) - yard (0.9.25) + yard (0.9.26) yard-coderay (0.1.0) coderay yard yard-mruby (0.3.0) yard (~> 0.9.0) - zeitwerk (2.4.0) + zeitwerk (2.4.2) PLATFORMS ruby + x86_64-darwin-19 DEPENDENCIES git github-pages + jekyll-feed jekyll-sitemap mgem yard-coderay yard-mruby BUNDLED WITH - 2.1.4 + 2.2.0 diff --git a/_config.yml b/_config.yml index 9f2ea7d..5957e95 100644 --- a/_config.yml +++ b/_config.yml @@ -12,6 +12,7 @@ url: https://mruby.org repository: https://github.com/mruby/mruby.github.io include: _index.html plugins: + - jekyll-feed - jekyll-sitemap exclude: - CODEOWNERS diff --git a/_includes/footer.html b/_includes/footer.html index 1d11e75..0bbe72f 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -2,4 +2,9 @@
      mruby-logo provided by h2so5
      +
      + + RSS feed + +
      diff --git a/images/icons/rss-feed.png b/images/icons/rss-feed.png new file mode 100644 index 0000000000000000000000000000000000000000..830c66b56dfb2ca97406ce8f1b527b92bada0f49 GIT binary patch literal 1138 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAIjKx9jP7LeL$-D$|T2doC(|mmy zw18|523AHP24;{FAY@>aVqgWc85q16rQz%#Mh&PMCI*J~Oa>OHnkXO*0vSb_NC}B~KT}5D(tFQ}*WfC5jx2p5N^y#r!qYDnUp(Gsntf zLWjiBqzm?KN97;fo#~@ycF{w34O^$n4FSgspMLLszjM~^x1V3NuMIDzExZJG87Uf(22~Iw>A?CmOuC7^y>~~n(d!>y<%4B97=u>~dBh&tC-vQSh4BH*K zv+}w8#I7f7doKLTyMldQbK}O@QK8`zMY?O8KD`WaO7nXhwYDtxy4;~<58Pk;kl^WC ze5dL6gX9<6-s*Hl$lv)a_S;bJpxht6*o)^U=}(w9d&7mc4YM<>V>^W{$o1f?>56k>(%U?v&LwVVuiJWT^P=h-N|tP4$IYi7 znEIzFcjAl9XKhOVS}r!(xbCyz3k4hgTKW46PS#D&;kMP8|2QuH;nT?C+rK8BO&9uW znZv#G_2eJLuVv0Re-;1Y&+}TT)yM35%8P}sCzqdof3xJ-#hK+r!hc1-obq!j + + + {{ site.title | xml_escape }} + {{ site.description | xml_escape }} + {{ site.url }}{{ site.baseurl }}/ + + {{ site.time | date_to_rfc822 }} + {{ site.time | date_to_rfc822 }} + Jekyll v{{ jekyll.version }} + {% for post in site.posts %} + + {{ post.title | xml_escape }} + + {{ post.content | xml_escape }} + {{ post.date | date_to_rfc822 }} + {{ post.url | prepend: site.baseurl | prepend: site.url }} + {{ post.url | prepend: site.baseurl | prepend: site.url }} + {% for tag in post.tags %} + {{ tag | xml_escape }} + {% endfor %} + {% for cat in post.categories %} + {{ cat | xml_escape }} + {% endfor %} + + {% endfor %} + + \ No newline at end of file From fabc65b806156948b06373abc3416b836f093c23 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Fri, 5 Mar 2021 19:31:52 +0900 Subject: [PATCH 041/250] Fix typo --- _posts/2021-03-05-mruby-3.0.0-released.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_posts/2021-03-05-mruby-3.0.0-released.markdown b/_posts/2021-03-05-mruby-3.0.0-released.markdown index bd3b199..2df3be0 100644 --- a/_posts/2021-03-05-mruby-3.0.0-released.markdown +++ b/_posts/2021-03-05-mruby-3.0.0-released.markdown @@ -102,10 +102,10 @@ To run the mruby binaries on mruby 3.0, recompile with the mruby 3.0 `mrbc`. `Integer` has been changed to a specification similar to CRuby. -- Integrate `Finxnum` and `Integer`. +- Integrate `Fixnum` and `Integer`. - Remove `Integral`. - `int / int -> int` -- Add APIs for `Integer`. APIs for`Fixnum` (`mrb_fixnum_xxx()`) is also left for compatibility. +- Add APIs for `Integer`. APIs for `Fixnum` (`mrb_fixnum_xxx()`) is also left for compatibility. - `mrb_fixnum()` -> `mrb_integer()` - `mrb_fixnum_value()` -> `mrb_int_value()` - `mrb_fixnum_p()` -> `mrb_integer_p()` From aa34f5517f1a9058d5255e8a392ce6a7bf3cac4f Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sun, 27 Dec 2020 02:06:56 +1000 Subject: [PATCH 042/250] refactor: move the CSS and images to a separate assets folder Create a bash script called `server` to run `bundle exec jekyll serve` with `./server` --- Gemfile.lock | 69 ++++++++++-------- _includes/header.html | 4 +- _includes/icons.html | 8 +- _includes/navigation.html | 56 +++++++------- {css => assets/css}/main.css | 2 +- {css => assets/css}/syntax.css | 0 .../images}/icons/android-chrome-192x192.png | Bin .../images}/icons/android-chrome-512x512.png | Bin .../images}/icons/apple-touch-icon.png | Bin .../images}/icons/favicon-16x16.png | Bin .../images}/icons/favicon-32x32.png | Bin .../images}/icons/site.webmanifest | 4 +- {images => assets/images}/mruby_header.png | Bin .../images}/mruby_logo_red_header.png | Bin .../images}/mruby_logo_red_icon.png | Bin {images => assets/images}/navigation_bg.png | Bin index.html | 2 +- server | 3 + 18 files changed, 83 insertions(+), 65 deletions(-) rename {css => assets/css}/main.css (97%) rename {css => assets/css}/syntax.css (100%) rename {images => assets/images}/icons/android-chrome-192x192.png (100%) rename {images => assets/images}/icons/android-chrome-512x512.png (100%) rename {images => assets/images}/icons/apple-touch-icon.png (100%) rename {images => assets/images}/icons/favicon-16x16.png (100%) rename {images => assets/images}/icons/favicon-32x32.png (100%) rename {images => assets/images}/icons/site.webmanifest (53%) rename {images => assets/images}/mruby_header.png (100%) rename {images => assets/images}/mruby_logo_red_header.png (100%) rename {images => assets/images}/mruby_logo_red_icon.png (100%) rename {images => assets/images}/navigation_bg.png (100%) create mode 100755 server diff --git a/Gemfile.lock b/Gemfile.lock index b60c426..1bf2bea 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - activesupport (6.0.3.3) + activesupport (6.0.3.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -17,8 +17,8 @@ GEM colorator (1.1.0) commonmarker (0.17.13) ruby-enum (~> 0.5) - concurrent-ruby (1.1.7) - dnsruby (1.61.4) + concurrent-ruby (1.1.8) + dnsruby (1.61.5) simpleidn (~> 0.1) em-websocket (0.5.2) eventmachine (>= 0.12.9) @@ -27,21 +27,24 @@ GEM ffi (>= 1.3.0) eventmachine (1.2.7) execjs (2.7.0) - faraday (1.0.1) + faraday (1.3.0) + faraday-net_http (~> 1.0) multipart-post (>= 1.2, < 3) - ffi (1.13.1) + ruby2_keywords + faraday-net_http (1.0.1) + ffi (1.14.2) forwardable-extended (2.6.0) gemoji (3.0.1) - git (1.7.0) + git (1.8.1) rchardet (~> 1.8) - github-pages (208) - github-pages-health-check (= 1.16.1) + github-pages (212) + github-pages-health-check (= 1.17.0) jekyll (= 3.9.0) jekyll-avatar (= 0.7.0) jekyll-coffeescript (= 1.1.1) jekyll-commonmark-ghpages (= 0.1.6) jekyll-default-layout (= 0.1.4) - jekyll-feed (= 0.15.0) + jekyll-feed (= 0.15.1) jekyll-gist (= 1.5.0) jekyll-github-metadata (= 2.13.0) jekyll-mentions (= 1.6.0) @@ -52,7 +55,7 @@ GEM jekyll-relative-links (= 0.6.1) jekyll-remote-theme (= 0.4.2) jekyll-sass-converter (= 1.5.2) - jekyll-seo-tag (= 2.6.1) + jekyll-seo-tag (= 2.7.1) jekyll-sitemap (= 1.4.0) jekyll-swiss (= 1.0.0) jekyll-theme-architect (= 0.1.1) @@ -76,13 +79,13 @@ GEM mercenary (~> 0.3) minima (= 2.5.1) nokogiri (>= 1.10.4, < 2.0) - rouge (= 3.23.0) + rouge (= 3.26.0) terminal-table (~> 1.4) - github-pages-health-check (1.16.1) + github-pages-health-check (1.17.0) addressable (~> 2.3) dnsruby (~> 1.60) octokit (~> 4.0) - public_suffix (~> 3.0) + public_suffix (>= 2.0.2, < 5.0) typhoeus (~> 1.3) html-pipeline (2.14.0) activesupport (>= 2) @@ -117,7 +120,7 @@ GEM rouge (>= 2.0, < 4.0) jekyll-default-layout (0.1.4) jekyll (~> 3.0) - jekyll-feed (0.15.0) + jekyll-feed (0.15.1) jekyll (>= 3.7, < 5.0) jekyll-gist (1.5.0) octokit (~> 4.2) @@ -143,8 +146,8 @@ GEM rubyzip (>= 1.3.0, < 3.0) jekyll-sass-converter (1.5.2) sass (~> 3.4) - jekyll-seo-tag (2.6.1) - jekyll (>= 3.3, < 5.0) + jekyll-seo-tag (2.7.1) + jekyll (>= 3.8, < 5.0) jekyll-sitemap (1.4.0) jekyll (>= 3.7, < 5.0) jekyll-swiss (1.0.0) @@ -201,34 +204,39 @@ GEM kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) liquid (4.0.3) - listen (3.2.1) + listen (3.4.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.3.6) mgem (0.3.0) - mini_portile2 (2.4.0) + mini_portile2 (2.5.0) minima (2.5.1) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.14.2) + minitest (5.14.4) multipart-post (2.1.1) - nokogiri (~> 1.11.0) - mini_portile2 (~> 2.4.0) - octokit (4.18.0) + nokogiri (1.11.1) + mini_portile2 (~> 2.5.0) + racc (~> 1.4) + nokogiri (1.11.1-x86_64-darwin) + racc (~> 1.4) + octokit (4.20.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (3.1.1) + public_suffix (4.0.6) + racc (1.5.2) rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) rchardet (1.8.0) rexml (3.2.4) - rouge (3.23.0) - ruby-enum (0.8.0) + rouge (3.26.0) + ruby-enum (0.9.0) i18n + ruby2_keywords (0.0.4) rubyzip (2.3.0) safe_yaml (1.0.5) sass (3.7.4) @@ -239,29 +247,30 @@ GEM sawyer (0.8.2) addressable (>= 2.3.5) faraday (> 0.8, < 2.0) - simpleidn (0.1.1) + simpleidn (0.2.1) unf (~> 0.1.4) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) thread_safe (0.3.6) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (1.2.7) + tzinfo (1.2.9) thread_safe (~> 0.1) unf (0.1.4) unf_ext unf_ext (0.0.7.7) unicode-display_width (1.7.0) - yard (0.9.25) + yard (0.9.26) yard-coderay (0.1.0) coderay yard yard-mruby (0.3.0) yard (~> 0.9.0) - zeitwerk (2.4.0) + zeitwerk (2.4.2) PLATFORMS ruby + x86_64-darwin-19 DEPENDENCIES git @@ -272,4 +281,4 @@ DEPENDENCIES yard-mruby BUNDLED WITH - 2.1.4 + 2.2.0 diff --git a/_includes/header.html b/_includes/header.html index 99526ce..a3ab86b 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -12,7 +12,7 @@ - + - + diff --git a/_includes/icons.html b/_includes/icons.html index a3ac776..2fdf10a 100644 --- a/_includes/icons.html +++ b/_includes/icons.html @@ -2,7 +2,7 @@ - - - - + + + + diff --git a/_includes/navigation.html b/_includes/navigation.html index 6646053..6b67e0f 100644 --- a/_includes/navigation.html +++ b/_includes/navigation.html @@ -1,26 +1,32 @@ -