From 446e71eccb09f7746fca13de5bd56ab98fe42089 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 09:16:21 +0100 Subject: [PATCH 01/39] Add .worktrees to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 48b8628..0e48758 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ _site mruby /.bundle/ /vendor/ +.worktrees From 955037fb6725c5e7a987c9844fdecbade44e6a71 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 13:11:44 +0100 Subject: [PATCH 02/39] New redesign --- _data/release.yml | 2 + _includes/redesign_footer.html | 13 + _includes/redesign_head.html | 21 ++ _includes/redesign_nav.html | 22 ++ _layouts/redesign.html | 25 ++ assets/css/redesign.css | 535 +++++++++++++++++++++++++++++++++ index.html | 53 +++- 7 files changed, 655 insertions(+), 16 deletions(-) create mode 100644 _data/release.yml create mode 100644 _includes/redesign_footer.html create mode 100644 _includes/redesign_head.html create mode 100644 _includes/redesign_nav.html create mode 100644 _layouts/redesign.html create mode 100644 assets/css/redesign.css diff --git a/_data/release.yml b/_data/release.yml new file mode 100644 index 0000000..b4ec6e2 --- /dev/null +++ b/_data/release.yml @@ -0,0 +1,2 @@ +version: "3.4.0" +date: "2025-04-20" diff --git a/_includes/redesign_footer.html b/_includes/redesign_footer.html new file mode 100644 index 0000000..819d51c --- /dev/null +++ b/_includes/redesign_footer.html @@ -0,0 +1,13 @@ + diff --git a/_includes/redesign_head.html b/_includes/redesign_head.html new file mode 100644 index 0000000..1260641 --- /dev/null +++ b/_includes/redesign_head.html @@ -0,0 +1,21 @@ + + +{{ page.title }} + + + + + + + + + + + + + + + + + +{% include icons.html %} diff --git a/_includes/redesign_nav.html b/_includes/redesign_nav.html new file mode 100644 index 0000000..0aa4286 --- /dev/null +++ b/_includes/redesign_nav.html @@ -0,0 +1,22 @@ + diff --git a/_layouts/redesign.html b/_layouts/redesign.html new file mode 100644 index 0000000..cdfee95 --- /dev/null +++ b/_layouts/redesign.html @@ -0,0 +1,25 @@ + + + + {% include redesign_head.html %} + + + {% include redesign_nav.html %} +
+ {{ content }} +
+ {% include redesign_footer.html %} + + + diff --git a/assets/css/redesign.css b/assets/css/redesign.css new file mode 100644 index 0000000..06f425d --- /dev/null +++ b/assets/css/redesign.css @@ -0,0 +1,535 @@ +/* ============================================================ + mruby.org — Redesign CSS + Swiss Clean aesthetic: Space Grotesk + Inter, mruby red + ============================================================ */ + +/* ------------------------------------------------------------ + CSS Custom Properties + ------------------------------------------------------------ */ +:root { + --color-white: #ffffff; + --color-black: #0d0d0d; + --color-red: #ce2812; + --color-red-hover: #b52310; + --color-bg-warm: #f5f3f0; + --color-bg-dark: #111110; + --color-border: #e0dbd5; + --color-border-dark: #222222; + --color-muted: #6b6560; + --color-muted-secondary: #9d9894; + --color-text-body: #3d3a37; + --color-hover-overlay: rgba(0, 0, 0, 0.02); + --color-nav-shadow: rgba(0, 0, 0, 0.08); + --color-footer-muted: #5a5550; + --color-footer-muted-hover: #8a8580; + + --font-heading: 'Space Grotesk', system-ui, sans-serif; + --font-body: 'Inter', system-ui, sans-serif; + + --nav-height: 56px; + --container-padding: 80px; + --container-max-width: 1200px; +} + +/* ------------------------------------------------------------ + Reset + ------------------------------------------------------------ */ +*, +*::before, +*::after { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +html { + -webkit-text-size-adjust: 100%; +} + +body { + display: flex; + flex-direction: column; + min-height: 100vh; + font-family: var(--font-body); + font-size: 16px; + line-height: 1.6; + color: var(--color-text-body); + background: var(--color-white); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +main { + flex: 1; +} + +a { + color: inherit; + text-decoration: none; +} + +img { + max-width: 100%; + height: auto; + display: block; +} + +ul { + list-style: none; +} + +/* ------------------------------------------------------------ + Navigation + ------------------------------------------------------------ */ +.site-nav { + position: sticky; + top: 0; + z-index: 100; + height: var(--nav-height); + background: var(--color-white); + border-bottom: 1px solid var(--color-border); + display: flex; + align-items: center; +} + +.site-nav__inner { + width: 100%; + max-width: calc(var(--container-max-width) + 2 * var(--container-padding)); + margin: 0 auto; + padding: 0 var(--container-padding); + display: flex; + align-items: center; + justify-content: space-between; + gap: 32px; +} + +.site-nav__brand { + display: flex; + align-items: center; + gap: 10px; + flex-shrink: 0; +} + +.site-nav__brand img { + width: 28px; + height: 28px; + object-fit: contain; +} + +.site-nav__wordmark { + font-family: var(--font-heading); + font-weight: 700; + font-size: 18px; + letter-spacing: -0.02em; + color: var(--color-black); + line-height: 1; +} + +.site-nav__links { + display: flex; + align-items: center; + gap: 4px; +} + +.site-nav__links a { + font-family: var(--font-body); + font-size: 14px; + font-weight: 400; + color: var(--color-muted); + padding: 6px 12px; + border-radius: 6px; + transition: color 0.15s ease, background 0.15s ease; + white-space: nowrap; +} + +.site-nav__links a:hover { + color: var(--color-black); + background: var(--color-bg-warm); +} + +.site-nav__hamburger { + display: none; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 5px; + width: 40px; + height: 40px; + background: none; + border: none; + cursor: pointer; + padding: 8px; + border-radius: 6px; + flex-shrink: 0; +} + +.site-nav__hamburger:hover { + background: var(--color-bg-warm); +} + +.site-nav__hamburger span { + display: block; + width: 20px; + height: 2px; + background: var(--color-black); + border-radius: 2px; + transition: transform 0.2s ease, opacity 0.2s ease; +} + +.site-nav__hamburger[aria-expanded="true"] span:nth-child(1) { + transform: translateY(7px) rotate(45deg); +} + +.site-nav__hamburger[aria-expanded="true"] span:nth-child(2) { + opacity: 0; +} + +.site-nav__hamburger[aria-expanded="true"] span:nth-child(3) { + transform: translateY(-7px) rotate(-45deg); +} + +/* ------------------------------------------------------------ + Hero Section + ------------------------------------------------------------ */ +.hero { + background: var(--color-bg-warm); + padding: 88px var(--container-padding) 100px; + border-bottom: 1px solid var(--color-border); +} + +.hero__inner { + max-width: var(--container-max-width); + margin: 0 auto; +} + +.hero__content { + max-width: 600px; +} + +.hero__eyebrow { + display: flex; + align-items: center; + gap: 8px; + font-family: var(--font-body); + font-size: 11px; + font-weight: 600; + letter-spacing: 0.1em; + text-transform: uppercase; + color: var(--color-red); + margin-bottom: 24px; +} + +.hero__eyebrow-dot { + font-size: 10px; + line-height: 1; +} + +.hero__headline { + font-family: var(--font-heading); + font-size: 64px; + font-weight: 700; + letter-spacing: -0.03em; + line-height: 1.0; + color: var(--color-black); + margin-bottom: 28px; +} + +.hero__description { + font-size: 16px; + line-height: 1.65; + color: var(--color-muted); + margin-bottom: 40px; + max-width: 460px; +} + +.hero__actions { + display: flex; + align-items: center; + gap: 12px; + flex-wrap: wrap; +} + +.btn { + display: inline-flex; + align-items: center; + justify-content: center; + font-family: var(--font-heading); + font-size: 15px; + font-weight: 600; + letter-spacing: -0.01em; + line-height: 18px; + border-radius: 0; + padding: 17px 32px; + transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; + cursor: pointer; + border: 1.5px solid transparent; + white-space: nowrap; +} + +.btn--primary { + background: var(--color-red); + color: var(--color-white); + border-color: var(--color-red); +} + +.btn--primary:hover { + background: var(--color-red-hover); + border-color: var(--color-red-hover); + color: var(--color-white); +} + +.btn--outline { + background: transparent; + color: var(--color-black); + border-color: var(--color-black); +} + +.btn--outline:hover { + border-color: var(--color-muted); + background: var(--color-hover-overlay); + color: var(--color-black); +} + +/* ------------------------------------------------------------ + Latest News Section + ------------------------------------------------------------ */ +.latest-news { + padding: 72px var(--container-padding) 88px; + background: var(--color-white); +} + +.latest-news__inner { + max-width: var(--container-max-width); + margin: 0 auto; +} + +.latest-news__header { + display: flex; + align-items: baseline; + justify-content: space-between; + margin-bottom: 20px; +} + +.latest-news__heading { + font-family: var(--font-heading); + font-size: 36px; + font-weight: 700; + letter-spacing: -0.025em; + color: var(--color-black); + line-height: 1; +} + +.latest-news__all-link { + font-size: 14px; + font-weight: 400; + color: var(--color-red); + transition: opacity 0.15s ease; +} + +.latest-news__all-link:hover { + opacity: 0.75; +} + +.latest-news__divider { + height: 1px; + background: var(--color-border); + margin-bottom: 32px; +} + +/* Card grid */ +.news-cards { + display: grid; + grid-template-columns: repeat(3, 1fr); +} + +.news-card { + border: 1px solid var(--color-border); + padding: 28px 28px 32px; + display: flex; + flex-direction: column; + gap: 12px; +} + +.news-card + .news-card { + border-left: none; +} + +.news-card__date { + font-family: var(--font-body); + font-size: 11px; + font-weight: 500; + letter-spacing: 0.06em; + color: var(--color-muted-secondary); + text-transform: uppercase; +} + +.news-card__title { + font-family: var(--font-heading); + font-size: 18px; + font-weight: 600; + letter-spacing: -0.02em; + line-height: 1.3; + color: var(--color-black); + flex: 1; +} + +.news-card__read-more { + font-size: 13px; + font-weight: 400; + color: var(--color-red); + transition: opacity 0.15s ease; + margin-top: 4px; +} + +.news-card__read-more:hover { + opacity: 0.75; +} + +/* ------------------------------------------------------------ + Footer + ------------------------------------------------------------ */ +.site-footer { + background: var(--color-bg-dark); + border-top: 1px solid var(--color-border-dark); + padding: 20px var(--container-padding); +} + +.site-footer__inner { + max-width: calc(var(--container-max-width) + 2 * var(--container-padding)); + margin: 0 auto; + display: flex; + align-items: center; + justify-content: space-between; + gap: 24px; +} + +.site-footer__attribution { + font-size: 12px; + color: var(--color-footer-muted); + line-height: 1; +} + +.site-footer__attribution a { + color: var(--color-footer-muted); + transition: color 0.15s ease; +} + +.site-footer__attribution a:hover { + color: var(--color-footer-muted-hover); +} + +.site-footer__feeds { + display: flex; + align-items: center; + gap: 20px; +} + +.site-footer__feeds a { + font-size: 12px; + color: var(--color-footer-muted); + transition: color 0.15s ease; + white-space: nowrap; +} + +.site-footer__feeds a:hover { + color: var(--color-footer-muted-hover); +} + +/* ------------------------------------------------------------ + Responsive — ≤1024px + ------------------------------------------------------------ */ +@media (max-width: 1024px) { + :root { + --container-padding: 40px; + } + + .hero__headline { + font-size: 48px; + } +} + +/* ------------------------------------------------------------ + Responsive — ≤768px + ------------------------------------------------------------ */ +@media (max-width: 768px) { + :root { + --container-padding: 24px; + } + + .site-nav__hamburger { + display: flex; + } + + .site-nav__links { + display: none; + position: absolute; + top: var(--nav-height); + left: 0; + right: 0; + background: var(--color-white); + border-bottom: 1px solid var(--color-border); + flex-direction: column; + align-items: stretch; + padding: 12px 24px; + gap: 4px; + box-shadow: 0 4px 12px var(--color-nav-shadow); + } + + .site-nav__links.is-open { + display: flex; + } + + .site-nav__links a { + padding: 10px 12px; + font-size: 15px; + } + + .hero { + padding: 56px var(--container-padding) 64px; + } + + .hero__headline { + font-size: 36px; + } + + .hero__actions { + flex-direction: column; + align-items: stretch; + } + + .hero__actions .btn { + justify-content: center; + } + + .latest-news__heading { + font-size: 28px; + } + + .news-cards { + grid-template-columns: 1fr; + } + + .news-card + .news-card { + border-left: 1px solid var(--color-border); + border-top: none; + } + + .site-footer__inner { + flex-direction: column; + align-items: flex-start; + gap: 12px; + } +} + +/* ------------------------------------------------------------ + Responsive — ≤480px + ------------------------------------------------------------ */ +@media (max-width: 480px) { + :root { + --container-padding: 16px; + } + + .hero__headline { + font-size: 28px; + } +} diff --git a/index.html b/index.html index 0b16f73..2802250 100644 --- a/index.html +++ b/index.html @@ -1,22 +1,43 @@ --- -layout: default -title: mruby +layout: redesign +title: mruby - Lightweight Ruby --- -
-
- -

- mruby is the lightweight implementation of the Ruby language complying with part of the ISO standard. mruby can be linked and embedded within your application. -

- -
- Download 3.4.0 Source -   or   - Find on GitHub +
+
+
+ OPEN SOURCE · LIGHTWEIGHT · EMBEDDABLE +

Lightweight Ruby for Everywhere

+

+ mruby is the lightweight implementation of the Ruby language, complying with part of the ISO standard. Designed to be embedded within your application. +

+
+
- {% include _latest_news.html %} - -
+
+
+
+

Latest News

+ All releases +
+
+
    + {% for post in site.posts limit:3 %} +
  • + +

    {{ post.title }}

    + — Read more +
  • + {% endfor %} +
+
+
From efbe22d4785bedf7fec2a5ec28c40322ac8119b1 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 14:08:34 +0100 Subject: [PATCH 03/39] Redesign downloads page --- _data/release.yml | 2 - _data/releases.yml | 103 +++++++++ _includes/redesign_nav.html | 10 +- assets/css/redesign.css | 412 ++++++++++++++++++++++++++++++++++++ downloads/index.html | 110 +++++++++- gen_releasedata.rb | 68 ++++++ index.html | 6 +- 7 files changed, 693 insertions(+), 18 deletions(-) delete mode 100644 _data/release.yml create mode 100644 _data/releases.yml create mode 100644 gen_releasedata.rb diff --git a/_data/release.yml b/_data/release.yml deleted file mode 100644 index b4ec6e2..0000000 --- a/_data/release.yml +++ /dev/null @@ -1,2 +0,0 @@ -version: "3.4.0" -date: "2025-04-20" diff --git a/_data/releases.yml b/_data/releases.yml new file mode 100644 index 0000000..8bd0132 --- /dev/null +++ b/_data/releases.yml @@ -0,0 +1,103 @@ +--- +- version: 4.0.0-rc + date: '2026-03-05' + prerelease: true +- version: 3.4.0 + date: '2025-04-20' + prerelease: false +- version: 3.4.0-rc2 + date: '2025-03-17' + prerelease: true +- version: 3.4.0-rc + date: '2025-03-10' + prerelease: true +- version: 3.3.0 + date: '2024-02-14' + prerelease: false +- version: 3.3.0-rc2 + date: '2024-01-04' + prerelease: true +- version: 3.3.0-rc + date: '2023-12-29' + prerelease: true +- version: 3.2.0 + date: '2023-02-24' + prerelease: false +- version: 3.2.0-rc4 + date: '2023-02-08' + prerelease: true +- version: 3.2.0-rc3 + date: '2023-01-23' + prerelease: true +- version: 3.2.0-rc2 + date: '2023-01-18' + prerelease: true +- version: 3.2.0-rc + date: '2023-01-13' + prerelease: true +- version: 3.1.0 + date: '2022-05-12' + prerelease: false +- version: 3.1.0-rc2 + date: '2022-03-31' + prerelease: true +- version: 3.1.0-rc + date: '2022-01-17' + prerelease: true +- version: 3.0.0 + date: '2021-03-05' + prerelease: false +- version: 3.0.0-rc + date: '2021-02-03' + prerelease: true +- version: 3.0.0-preview + date: '2020-10-16' + prerelease: true +- version: 2.1.2 + date: '2020-08-06' + prerelease: false +- version: 2.1.2-rc2 + date: '2020-07-29' + prerelease: true +- version: 2.1.2-rc + date: '2020-07-01' + prerelease: true +- version: 2.1.1 + date: '2020-06-04' + prerelease: false +- version: 2.1.1-rc2 + date: '2020-05-07' + prerelease: true +- version: 2.1.1-rc + date: '2020-04-10' + prerelease: true +- version: 2.1.0 + date: '2019-11-10' + prerelease: false +- version: 2.1.0-rc + date: '2019-10-18' + prerelease: true +- version: 2.0.1 + date: '2019-04-04' + prerelease: false +- version: 2.0.0 + date: '2018-12-10' + prerelease: false +- version: 1.4.1 + date: '2018-04-27' + prerelease: false +- version: 1.4.0 + date: '2018-01-16' + prerelease: false +- version: 1.3.0 + date: '2017-07-04' + prerelease: false +- version: 1.2.0 + date: '2015-11-18' + prerelease: false +- version: 1.1.0 + date: '2014-11-19' + prerelease: false +- version: 1.0.0 + date: '2014-02-09' + prerelease: false diff --git a/_includes/redesign_nav.html b/_includes/redesign_nav.html index 0aa4286..ec787c1 100644 --- a/_includes/redesign_nav.html +++ b/_includes/redesign_nav.html @@ -12,11 +12,11 @@
diff --git a/assets/css/redesign.css b/assets/css/redesign.css index 06f425d..9d6257a 100644 --- a/assets/css/redesign.css +++ b/assets/css/redesign.css @@ -147,6 +147,15 @@ ul { background: var(--color-bg-warm); } +.site-nav__links a[aria-current="page"] { + color: var(--color-black); + font-weight: 600; + text-decoration: underline; + text-decoration-color: var(--color-red); + text-decoration-thickness: 2px; + text-underline-offset: 3px; +} + .site-nav__hamburger { display: none; flex-direction: column; @@ -435,6 +444,356 @@ ul { color: var(--color-footer-muted-hover); } +/* ------------------------------------------------------------ + Page Header (inner pages) + ------------------------------------------------------------ */ +.page-header { + padding: 80px var(--container-padding) 64px; +} + +.page-header__inner { + max-width: var(--container-max-width); + margin: 0 auto; +} + +.page-header__eyebrow { + display: flex; + align-items: center; + gap: 8px; + font-family: var(--font-heading); + font-size: 12px; + font-weight: 500; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--color-red); + margin-bottom: 20px; +} + +.page-header__eyebrow-dot { + width: 8px; + height: 8px; + border-radius: 50%; + background: var(--color-red); + flex-shrink: 0; +} + +.page-header__heading { + font-family: var(--font-heading); + font-size: 56px; + font-weight: 700; + letter-spacing: -0.03em; + line-height: 1.2; + color: var(--color-black); + margin-bottom: 16px; +} + +.page-header__description { + font-size: 17px; + line-height: 1.65; + color: var(--color-muted); + max-width: 560px; +} + +.page-header__description a { + color: var(--color-red); + transition: opacity 0.15s ease; +} + +.page-header__description a:hover { + opacity: 0.75; +} + +/* ------------------------------------------------------------ + Downloads — Current Release + ------------------------------------------------------------ */ +.downloads-current { + padding: 0 var(--container-padding) 80px; +} + +.downloads-current__inner { + max-width: var(--container-max-width); + margin: 0 auto; +} + +.release-card { + display: flex; + align-items: flex-start; + padding: 48px 56px; + gap: 80px; + background: var(--color-bg-warm); + border-left: 4px solid var(--color-red); +} + +.release-card__info { + display: flex; + flex-direction: column; + gap: 12px; + flex-shrink: 0; +} + +.release-card__label { + font-family: var(--font-body); + font-size: 12px; + font-weight: 500; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--color-red); + line-height: 16px; +} + +.release-card__version { + font-family: var(--font-heading); + font-size: 48px; + font-weight: 700; + letter-spacing: -0.03em; + line-height: 1; + color: var(--color-black); +} + +.release-card__date { + font-size: 13px; + color: var(--color-muted); + line-height: 16px; +} + +.release-card__downloads { + display: flex; + flex-direction: column; + gap: 16px; + flex: 1; +} + +.release-card__downloads-label { + font-family: var(--font-heading); + font-size: 14px; + font-weight: 600; + letter-spacing: 0.02em; + text-transform: uppercase; + color: var(--color-black); + line-height: 18px; + margin-bottom: 4px; +} + +.download-row { + display: flex; + align-items: center; + justify-content: space-between; + padding: 16px 20px; + background: var(--color-white); + border: 1px solid var(--color-border); +} + +.download-row + .download-row { + border-top: none; +} + +.download-row__info { + display: flex; + align-items: center; + gap: 12px; +} + +.download-row__name { + font-family: var(--font-heading); + font-size: 15px; + font-weight: 600; + color: var(--color-black); + line-height: 18px; +} + +.download-row__filename { + font-size: 12px; + color: var(--color-muted); + line-height: 16px; +} + +.download-btn { + display: inline-flex; + align-items: center; + justify-content: center; + height: 36px; + padding: 0 20px; + background: var(--color-red); + color: var(--color-white); + font-family: var(--font-heading); + font-size: 13px; + font-weight: 600; + line-height: 16px; + transition: background 0.15s ease; + white-space: nowrap; + flex-shrink: 0; +} + +.download-btn:hover { + background: var(--color-red-hover); + color: var(--color-white); +} + +.download-more { + display: flex; + align-items: center; + gap: 8px; + padding: 14px 20px; + background: var(--color-white); + border: 1px dashed var(--color-border); + font-size: 13px; + line-height: 16px; +} + +.download-more__text { + color: var(--color-muted); +} + +.download-more__link { + font-weight: 500; + color: var(--color-red); + transition: opacity 0.15s ease; +} + +.download-more__link:hover { + opacity: 0.75; +} + +/* ------------------------------------------------------------ + Downloads — Upcoming Release + ------------------------------------------------------------ */ +.upcoming-releases { + padding: 0 var(--container-padding) 64px; +} + +.upcoming-releases__inner { + max-width: var(--container-max-width); + margin: 0 auto; +} + +.upcoming-releases__header { + display: flex; + align-items: center; + gap: 12px; + margin-bottom: 32px; + padding-bottom: 20px; + border-bottom: 1px solid var(--color-border); +} + +.upcoming-releases__heading { + font-family: var(--font-heading); + font-size: 28px; + font-weight: 700; + letter-spacing: -0.02em; + line-height: 34px; + color: var(--color-black); +} + +.upcoming-releases__tag { + font-size: 11px; + font-weight: 500; + letter-spacing: 0.06em; + text-transform: uppercase; + color: var(--color-muted-secondary); + border: 1px solid var(--color-border); + padding: 2px 8px; + line-height: 18px; +} + +/* ------------------------------------------------------------ + Downloads — Previous Releases + ------------------------------------------------------------ */ +.prev-releases { + padding: 0 var(--container-padding) 96px; +} + +.prev-releases__inner { + max-width: var(--container-max-width); + margin: 0 auto; +} + +.prev-releases__header { + margin-bottom: 32px; + padding-bottom: 20px; + border-bottom: 1px solid var(--color-border); +} + +.prev-releases__heading { + font-family: var(--font-heading); + font-size: 28px; + font-weight: 700; + letter-spacing: -0.02em; + line-height: 34px; + color: var(--color-black); +} + +.releases-table__head { + display: flex; + align-items: center; + padding: 12px 0; + border-bottom: 1px solid var(--color-border); +} + +.releases-table__col-version { + width: 140px; + flex-shrink: 0; + font-size: 11px; + font-weight: 500; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--color-muted); + line-height: 14px; +} + +.releases-table__col-date { + flex: 1; + font-size: 11px; + font-weight: 500; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--color-muted); + line-height: 14px; +} + +.release-row { + display: flex; + align-items: center; + padding: 18px 0; + border-bottom: 1px solid var(--color-bg-warm); +} + +.release-row:last-child { + border-bottom: none; +} + +.release-row__version { + width: 140px; + flex-shrink: 0; + font-family: var(--font-heading); + font-size: 15px; + font-weight: 600; + color: var(--color-black); + line-height: 18px; +} + +.release-row__version--muted { + color: var(--color-muted); +} + +.release-row__date { + flex: 1; + font-size: 14px; + color: var(--color-muted); + line-height: 18px; +} + +.release-row__link { + font-size: 14px; + font-weight: 500; + color: var(--color-red); + transition: opacity 0.15s ease; +} + +.release-row__link:hover { + opacity: 0.75; +} + + /* ------------------------------------------------------------ Responsive — ≤1024px ------------------------------------------------------------ */ @@ -446,6 +805,19 @@ ul { .hero__headline { font-size: 48px; } + + .page-header__heading { + font-size: 40px; + } + + .release-card { + gap: 48px; + padding: 40px 40px; + } + + .release-card__version { + font-size: 40px; + } } /* ------------------------------------------------------------ @@ -519,6 +891,34 @@ ul { align-items: flex-start; gap: 12px; } + + .page-header__heading { + font-size: 32px; + } + + .release-card { + flex-direction: column; + gap: 32px; + padding: 32px 28px; + } + + .release-card__version { + font-size: 36px; + } + + .release-card__downloads-label { + margin-bottom: 0; + } + + .download-row { + flex-wrap: wrap; + gap: 12px; + } + + .releases-table__col-version, + .release-row__version { + width: 100px; + } } /* ------------------------------------------------------------ @@ -532,4 +932,16 @@ ul { .hero__headline { font-size: 28px; } + + .page-header__heading { + font-size: 28px; + } + + .release-card { + padding: 24px 20px; + } + + .release-card__version { + font-size: 32px; + } } diff --git a/downloads/index.html b/downloads/index.html index 4981bf3..6d9c9f6 100644 --- a/downloads/index.html +++ b/downloads/index.html @@ -1,13 +1,105 @@ --- -layout: default -title: mruby - downloads +layout: redesign +title: mruby - Downloads --- -
-
-

Downloads

-

- Current stable: mruby 3.4.0 -

+{% assign current = site.data.releases | where: "prerelease", false | first %} +{% assign all_stable = site.data.releases | where: "prerelease", false %} + +{% comment %} Collect any prereleases that are newer than the current stable {% endcomment %} +{% assign upcoming = "" | split: "" %} +{% assign collecting = true %} +{% for release in site.data.releases %} + {% if collecting %} + {% if release.version == current.version %} + {% assign collecting = false %} + {% elsif release.prerelease %} + {% assign upcoming = upcoming | push: release %} + {% endif %} + {% endif %} +{% endfor %} + + + +
+
+
+
+ Current Stable + {{ current.version }} + Released {{ current.date | date: "%-d %b %Y" }} +
+
+
Download
+
+
+ Source .zip + mruby-{{ current.version }}.zip · via GitHub +
+ Download +
+
+
+ Source .tar.gz + mruby-{{ current.version }}.tar.gz · via GitHub +
+ Download +
+
+ More assets and checksums available on + GitHub Releases → +
+
+
+
+
+ +{% if upcoming.size > 0 %} +
+
+
+

Upcoming Release

+ Pre-release +
+
+ Version + Date +
+ {% for release in upcoming %} +
+ {{ release.version }} + {{ release.date | date: "%-d %b %Y" }} + Changelog → +
+ {% endfor %} +
+
+{% endif %} + +
+
+
+

Previous Releases

+
+
+ Version + Date +
+ {% for release in all_stable %}{% unless forloop.first %} +
+ {{ release.version }} + {{ release.date | date: "%-d %b %Y" }} + Changelog → +
+ {% endunless %}{% endfor %}
-
+ diff --git a/gen_releasedata.rb b/gen_releasedata.rb new file mode 100644 index 0000000..0fa50f3 --- /dev/null +++ b/gen_releasedata.rb @@ -0,0 +1,68 @@ +# Regenerate _data/releases.yml from GitHub API. +# +# All pages derive the current stable release from the first non-prerelease +# entry in this file. Run this script after each new release or RC tag. +# +# Stable release dates are sourced from blog post filenames where available, +# falling back to the GitHub commit date for releases without a post. +# +# Usage: +# bundle exec ruby gen_releasedata.rb +# +# Requires a GitHub token via GH_TOKEN env var or `gh auth token`. + +require 'net/http' +require 'json' +require 'yaml' + +REPO = 'mruby/mruby' +DATA_FILE = File.join(__dir__, '_data', 'releases.yml') + +def gh_get(path) + uri = URI("https://api.github.com#{path}") + token = ENV['GH_TOKEN'] || `gh auth token 2>/dev/null`.strip + headers = { + 'Accept' => 'application/vnd.github.v3+json', + 'User-Agent' => 'mruby-site', + 'Authorization' => "Bearer #{token}" + } + Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http| + JSON.parse(http.get(uri.request_uri, headers).body) + end +end + +# Derive release dates from blog post filenames (format: YYYY-MM-DD-mruby-X.Y.Z-released.*) +post_dates = {} +Dir.glob(File.join(__dir__, '_posts', '*.{markdown,md}')).each do |f| + if (m = File.basename(f).match(/^(\d{4}-\d{2}-\d{2})-mruby-([\d.]+)-released/)) + post_dates[m[2]] = m[1] + end +end + +# Fetch all tags (paginated) +tags = [] +page = 1 +loop do + batch = gh_get("/repos/#{REPO}/tags?per_page=100&page=#{page}") + break if batch.empty? + tags.concat(batch) + break if batch.size < 100 + page += 1 +end + +# Keep all version-like tags (stable + rc/preview) +versioned = tags.select { |t| t['name'].match?(/^\d/) } + +releases = versioned.map do |tag| + version = tag['name'] + prerelease = !version.match?(/^\d+\.\d+\.\d+$/) + date = post_dates[version] || begin + commit = gh_get("/repos/#{REPO}/commits/#{tag['commit']['sha']}") + commit.dig('commit', 'committer', 'date')&.slice(0, 10) + end + $stdout.puts " #{version}: #{date}#{' (prerelease)' if prerelease}" + { 'version' => version, 'date' => date, 'prerelease' => prerelease } +end + +File.write(DATA_FILE, releases.to_yaml) +$stdout.puts "\nWritten #{releases.size} releases to #{DATA_FILE}" diff --git a/index.html b/index.html index 2802250..f60a53b 100644 --- a/index.html +++ b/index.html @@ -3,6 +3,8 @@ title: mruby - Lightweight Ruby --- +{% assign current_release = site.data.releases | where: "prerelease", false | first %} +
@@ -12,8 +14,8 @@

Lightweight Ruby for Everywhere

mruby is the lightweight implementation of the Ruby language, complying with part of the ISO standard. Designed to be embedded within your application.

- - Download {{ site.data.release.version }} + + Download {{ current_release.version }} View on GitHub From 94c514d02e52ae86871a4bd33a2ac1d31a3a35e8 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 14:43:00 +0100 Subject: [PATCH 04/39] Redesign Documentation --- assets/css/redesign.css | 293 ++++++++++++++++++ .../executing-ruby-code-with-mruby.md | 1 + docs/index.html | 87 ++++++ docs/index.md | 28 -- 4 files changed, 381 insertions(+), 28 deletions(-) create mode 100644 docs/index.html delete mode 100644 docs/index.md diff --git a/assets/css/redesign.css b/assets/css/redesign.css index 9d6257a..13b43bf 100644 --- a/assets/css/redesign.css +++ b/assets/css/redesign.css @@ -794,6 +794,272 @@ ul { } +/* ------------------------------------------------------------ + Page Header — Warm variant (Documentation) + ------------------------------------------------------------ */ +.page-header--warm { + background: var(--color-bg-warm); + border-bottom: 1px solid var(--color-border); +} + +.page-header__inner--split { + display: flex; + align-items: flex-end; + justify-content: space-between; + gap: 40px; +} + +.page-header__meta { + display: flex; + align-items: center; + gap: 8px; + flex-shrink: 0; + padding-bottom: 4px; +} + +.page-header__meta-label { + font-size: 14px; + color: var(--color-muted); + line-height: 18px; +} + +.page-header__meta-version { + font-family: var(--font-heading); + font-size: 14px; + font-weight: 600; + color: var(--color-black); + line-height: 18px; +} + +/* ------------------------------------------------------------ + Documentation — Content Grid + ------------------------------------------------------------ */ +.docs-grid { + padding: 80px var(--container-padding); +} + +.docs-grid__inner { + max-width: var(--container-max-width); + margin: 0 auto; + display: grid; + grid-template-columns: 1fr 1fr; + gap: 80px; +} + +/* Articles column */ +.docs-articles { + display: flex; + flex-direction: column; + gap: 48px; +} + +/* Source note */ +.docs-source-note { + padding: 28px 32px; + background: var(--color-bg-warm); + border-left: 3px solid var(--color-border); + display: flex; + flex-direction: column; + gap: 14px; +} + +.docs-source-note__text { + font-size: 15px; + line-height: 1.65; + color: var(--color-muted); +} + +.docs-badge { + display: inline-block; + padding: 1px 6px; + background: var(--color-white); + font-family: var(--font-heading); + font-size: 14px; + font-weight: 600; + color: var(--color-black); + line-height: 26px; +} + +.docs-source-note__link { + display: flex; + align-items: center; + gap: 6px; + font-size: 13px; + font-weight: 500; + color: var(--color-red); + line-height: 16px; + transition: opacity 0.15s ease; +} + +.docs-source-note__link:hover { + opacity: 0.75; +} + +.docs-source-note__dash { + width: 16px; + height: 1px; + background: var(--color-red); + flex-shrink: 0; +} + +/* Section heading pattern */ +.docs-section { + display: flex; + flex-direction: column; + gap: 24px; +} + +.docs-section__header { + display: flex; + align-items: center; + gap: 12px; + padding-bottom: 20px; + border-bottom: 1px solid var(--color-border); +} + +.docs-section__bar { + width: 20px; + height: 2px; + background: var(--color-red); + flex-shrink: 0; +} + +.docs-section__heading { + font-family: var(--font-heading); + font-size: 22px; + font-weight: 700; + letter-spacing: -0.01em; + color: var(--color-black); + line-height: 28px; +} + +/* Article row */ +.docs-article-row { + display: flex; + align-items: center; + justify-content: space-between; + padding: 20px 24px; + border: 1px solid var(--color-border); + gap: 32px; + transition: background 0.15s ease; +} + +.docs-article-row:hover { + background: var(--color-bg-warm); +} + +.docs-article-row__info { + display: flex; + flex-direction: column; + gap: 6px; +} + +.docs-article-row__title { + font-family: var(--font-heading); + font-size: 16px; + font-weight: 600; + letter-spacing: -0.01em; + color: var(--color-black); + line-height: 20px; +} + +.docs-article-row__desc { + font-size: 13px; + color: var(--color-muted); + line-height: 16px; +} + +.docs-article-row__link { + font-size: 13px; + font-weight: 500; + color: var(--color-red); + line-height: 16px; + flex-shrink: 0; + white-space: nowrap; +} + +/* Components column */ +.docs-components { + display: flex; + flex-direction: column; + gap: 24px; +} + +/* Component card */ +.docs-component-card { + display: flex; + align-items: flex-start; + justify-content: space-between; + padding: 28px 32px; + gap: 24px; + transition: opacity 0.15s ease; +} + +.docs-component-card:hover { + opacity: 0.88; +} + +.docs-component-card--warm { + background: var(--color-bg-warm); +} + +.docs-component-card--bordered { + border: 1px solid var(--color-border); +} + +.docs-component-card__info { + display: flex; + flex-direction: column; + gap: 8px; +} + +.docs-component-card__title { + font-family: var(--font-heading); + font-size: 18px; + font-weight: 700; + letter-spacing: -0.01em; + color: var(--color-black); + line-height: 22px; +} + +.docs-component-card__desc { + font-size: 14px; + color: var(--color-muted); + line-height: 22px; +} + +.docs-component-card__tags { + display: flex; + flex-wrap: wrap; + gap: 6px; + margin-top: 8px; +} + +.docs-component-tag { + display: inline-block; + padding: 3px 8px; + background: var(--color-white); + font-family: var(--font-heading); + font-size: 13px; + font-weight: 600; + color: var(--color-red); + line-height: 16px; +} + +.docs-component-tag--muted { + color: var(--color-muted); +} + +.docs-component-card__link { + font-size: 13px; + font-weight: 500; + color: var(--color-red); + line-height: 16px; + flex-shrink: 0; + margin-top: 4px; + white-space: nowrap; +} + /* ------------------------------------------------------------ Responsive — ≤1024px ------------------------------------------------------------ */ @@ -818,6 +1084,14 @@ ul { .release-card__version { font-size: 40px; } + + .docs-grid { + padding: 64px var(--container-padding); + } + + .docs-grid__inner { + gap: 48px; + } } /* ------------------------------------------------------------ @@ -919,6 +1193,25 @@ ul { .release-row__version { width: 100px; } + + .page-header__inner--split { + flex-direction: column; + align-items: flex-start; + gap: 24px; + } + + .page-header__meta { + padding-bottom: 0; + } + + .docs-grid__inner { + grid-template-columns: 1fr; + gap: 48px; + } + + .docs-grid { + padding: 48px var(--container-padding); + } } /* ------------------------------------------------------------ diff --git a/docs/articles/executing-ruby-code-with-mruby.md b/docs/articles/executing-ruby-code-with-mruby.md index f537da9..acab9be 100644 --- a/docs/articles/executing-ruby-code-with-mruby.md +++ b/docs/articles/executing-ruby-code-with-mruby.md @@ -1,6 +1,7 @@ --- layout: post title: Executing Ruby code with mruby +description: "REPL, .rb files, C embedding, bytecode \u2014 four execution methods compared" categories: articles --- diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..5508b9f --- /dev/null +++ b/docs/index.html @@ -0,0 +1,87 @@ +--- +layout: redesign +title: mruby - Documentation +--- + +{% assign current = site.data.releases | where: "prerelease", false | first %} + + + +
+ +
diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index c4cf8d3..0000000 --- a/docs/index.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -layout: default -title: mruby - docs ---- - -# Documentation - -At the moment the source code ([`mruby/doc/`][mruby-doc]) includes further -documentation about compiling, configuring (`mrbconf`), debugging (`mrdb`), -and extending (`mrbgems`) mruby. - -[mruby-doc]: https://github.com/mruby/mruby/tree/master/doc - -## Articles - -
-{% for page in site.pages %} - {% if page.categories contains 'articles' %} - {% capture article %} - [{{ page.title }}]({{ page.url }}) {% endcapture %} - {{ article | markdownify }} - {% endif %} -{% endfor %} -
- -## Components - -- [API docs](api) -- [mruby, mruby/c Common I/O API Guidelines and Community-developed Libraries](https://github.com/mruby/microcontroller-peripheral-interface-guide) From 8bd1145f4b627933647eccd29714c66fcfdba2f6 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 15:12:19 +0100 Subject: [PATCH 05/39] Add .libs-* CSS classes for Libraries page redesign --- assets/css/redesign.css | 274 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 274 insertions(+) diff --git a/assets/css/redesign.css b/assets/css/redesign.css index 13b43bf..23f2995 100644 --- a/assets/css/redesign.css +++ b/assets/css/redesign.css @@ -1238,3 +1238,277 @@ ul { font-size: 32px; } } + +/* ------------------------------------------------------------ + Libraries — Page Header + ------------------------------------------------------------ */ +.libs-header { + background: var(--color-bg-warm); + border-bottom: 1px solid var(--color-border); + padding: 80px var(--container-padding) 56px; +} + +.libs-header__inner { + max-width: var(--container-max-width); + margin: 0 auto; + display: flex; + align-items: flex-end; + justify-content: space-between; + gap: 40px; +} + +.libs-header__count { + display: flex; + align-items: center; + gap: 12px; + flex-shrink: 0; + padding-bottom: 4px; +} + +.libs-header__count-number { + font-family: var(--font-heading); + font-size: 36px; + font-weight: 700; + letter-spacing: -0.03em; + line-height: 1; + color: var(--color-black); +} + +.libs-header__count-label { + font-size: 14px; + line-height: 1.4; + color: var(--color-muted); +} + +/* ------------------------------------------------------------ + Libraries — Toolbar + ------------------------------------------------------------ */ +.libs-toolbar { + background: var(--color-white); + border-bottom: 1px solid var(--color-border); + padding: 24px var(--container-padding); +} + +.libs-toolbar__inner { + max-width: var(--container-max-width); + margin: 0 auto; + display: flex; + align-items: center; + justify-content: space-between; + gap: 24px; +} + +.libs-search { + display: flex; + align-items: center; + width: 400px; + height: 40px; + padding: 0 16px; + gap: 12px; + background: #FAF9F8; + border: 1.5px solid var(--color-border); + flex-shrink: 0; +} + +.libs-search__icon { + flex-shrink: 0; + color: var(--color-muted-secondary); +} + +.libs-search__input { + flex: 1; + border: none; + background: transparent; + font-family: var(--font-body); + font-size: 14px; + color: var(--color-text-body); + outline: none; + line-height: 18px; +} + +.libs-search__input::placeholder { + color: var(--color-muted-secondary); +} + +.libs-toolbar__count { + font-size: 13px; + color: var(--color-muted); + white-space: nowrap; + line-height: 16px; +} + +/* ------------------------------------------------------------ + Libraries — Gem Grid + ------------------------------------------------------------ */ +.libs-grid { + padding: 0 var(--container-padding) 0; + background: var(--color-bg-warm); +} + +.libs-grid__inner { + max-width: var(--container-max-width); + margin: 0 auto; + padding: 32px 0; +} + +.libs-grid__rows { + display: flex; + flex-direction: column; + gap: 1px; + background: var(--color-border); +} + +.libs-row { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 1px; + background: var(--color-border); +} + +.libs-card { + padding: 28px 32px; + background: var(--color-white); + display: flex; + flex-direction: column; + gap: 10px; +} + +.libs-card[hidden] { + display: none; +} + +.libs-card__header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 12px; +} + +.libs-card__name { + font-family: var(--font-heading); + font-size: 15px; + font-weight: 600; + letter-spacing: -0.01em; + color: var(--color-red); + line-height: 18px; + transition: opacity 0.15s ease; +} + +.libs-card__name:hover { + opacity: 0.75; +} + +.libs-card__author { + font-family: var(--font-body); + font-size: 11px; + font-weight: 400; + letter-spacing: 0.04em; + text-transform: uppercase; + color: var(--color-muted-secondary); + line-height: 14px; + flex-shrink: 0; + margin-top: 2px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 120px; +} + +.libs-card__description { + font-size: 14px; + line-height: 22px; + color: var(--color-muted); +} + +/* ------------------------------------------------------------ + Libraries — Footer Row + ------------------------------------------------------------ */ +.libs-footer { + border-top: 1px solid var(--color-border); + background: var(--color-white); + padding: 48px var(--container-padding); + text-align: center; +} + +.libs-footer__inner { + max-width: var(--container-max-width); + margin: 0 auto; + display: flex; + align-items: center; + justify-content: center; + gap: 6px; + flex-wrap: wrap; +} + +.libs-footer__text { + font-size: 14px; + color: var(--color-muted); + line-height: 18px; +} + +.libs-footer__link { + font-size: 14px; + font-weight: 500; + color: var(--color-red); + line-height: 18px; + transition: opacity 0.15s ease; +} + +.libs-footer__link:hover { + opacity: 0.75; +} + +/* No results state */ +.libs-no-results { + display: none; + padding: 64px 32px; + text-align: center; + background: var(--color-white); +} + +.libs-no-results.is-visible { + display: block; +} + +.libs-no-results__text { + font-size: 15px; + color: var(--color-muted); +} + +/* ------------------------------------------------------------ + Libraries — Responsive ≤768px + ------------------------------------------------------------ */ +@media (max-width: 768px) { + .libs-header__inner { + flex-direction: column; + align-items: flex-start; + gap: 24px; + } + + .libs-header__count { + padding-bottom: 0; + } + + .libs-search { + width: 100%; + } + + .libs-toolbar__inner { + flex-direction: column; + align-items: stretch; + gap: 12px; + } + + .libs-row { + grid-template-columns: repeat(2, 1fr); + } +} + +/* ------------------------------------------------------------ + Libraries — Responsive ≤480px + ------------------------------------------------------------ */ +@media (max-width: 480px) { + .libs-row { + grid-template-columns: 1fr; + } +} From 1f3898a212760facb45ead36cd10f02e5c478595 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 15:15:32 +0100 Subject: [PATCH 06/39] Fix CSS quality issues in .libs-* block --- assets/css/redesign.css | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/assets/css/redesign.css b/assets/css/redesign.css index 23f2995..1200720 100644 --- a/assets/css/redesign.css +++ b/assets/css/redesign.css @@ -1305,7 +1305,7 @@ ul { height: 40px; padding: 0 16px; gap: 12px; - background: #FAF9F8; + background: var(--color-bg-warm); border: 1.5px solid var(--color-border); flex-shrink: 0; } @@ -1330,6 +1330,10 @@ ul { color: var(--color-muted-secondary); } +.libs-search:focus-within { + border-color: var(--color-black); +} + .libs-toolbar__count { font-size: 13px; color: var(--color-muted); @@ -1341,7 +1345,7 @@ ul { Libraries — Gem Grid ------------------------------------------------------------ */ .libs-grid { - padding: 0 var(--container-padding) 0; + padding: 0 var(--container-padding); background: var(--color-bg-warm); } @@ -1373,6 +1377,10 @@ ul { gap: 10px; } +.libs-card:hover { + background: var(--color-bg-warm); +} + .libs-card[hidden] { display: none; } @@ -1458,7 +1466,9 @@ ul { opacity: 0.75; } -/* No results state */ +/* ------------------------------------------------------------ + Libraries — No Results + ------------------------------------------------------------ */ .libs-no-results { display: none; padding: 64px 32px; From 518ed21c8f8805d39bf98d5272596908ebfd43a3 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 15:18:26 +0100 Subject: [PATCH 07/39] Redesign Libraries page with mrbgems grid and JS search --- libraries/index.html | 165 +++++++++++++++++++++++++++++++++---------- 1 file changed, 129 insertions(+), 36 deletions(-) diff --git a/libraries/index.html b/libraries/index.html index eccb18e..a0f0b18 100644 --- a/libraries/index.html +++ b/libraries/index.html @@ -1,43 +1,136 @@ --- -layout: default -title: mruby - libraries +layout: redesign +title: mruby - Libraries --- -
-
- +{% assign total = site.data.mgems | size %} + +
+
+
+
+ + Libraries +
+

mrbgems

+

+ mrbgems is mruby's package manager. See the + mrbgems doc + for how to use it. +

+
+
+ {{ total }} + community
libraries
+
-
-
-
-

- mrbgems is mruby's package manager. See the mrbgems doc for more information about how to use it. -

+
+ +
+
+ + Showing {{ total }} libraries
-
-
-
- - - - - - - - {% for mgem_data in site.data.mgems %} - - - - - - {% endfor %} - -
NameDescriptionAuthor
- {{ mgem_data.name }} - - {{ mgem_data.description }} - - {{ mgem_data.author }} -
+ + +
+
+
+ {% assign gems = site.data.mgems %} + {% assign row_size = 3 %} + {% assign row_index = 0 %} + {% for mgem in gems %} + {% assign mod = row_index | modulo: row_size %} + {% if mod == 0 %}
{% endif %} + +
+ {{ mgem.name }} + {{ mgem.author }} +
+

{{ mgem.description }}

+
+ {% assign row_index = row_index | plus: 1 %} + {% assign mod_end = row_index | modulo: row_size %} + {% if mod_end == 0 or forloop.last %}
{% endif %} + {% endfor %} +
+
+

No libraries match your search.

+
+
+
+ + + + From d283daec97a193812c36a3a4b1249c5165a47742 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 15:32:18 +0100 Subject: [PATCH 08/39] Fix author arrays, HTML escaping, null guard, and code quality in Libraries page --- libraries/index.html | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/libraries/index.html b/libraries/index.html index a0f0b18..bbf0e80 100644 --- a/libraries/index.html +++ b/libraries/index.html @@ -55,16 +55,17 @@

mrbgems

{% for mgem in gems %} {% assign mod = row_index | modulo: row_size %} {% if mod == 0 %}
{% endif %} + {% if mgem.author.first %}{% assign mgem_author = mgem.author | join: ", " %}{% else %}{% assign mgem_author = mgem.author %}{% endif %}
{{ mgem.name }} - {{ mgem.author }} + {{ mgem_author }}

{{ mgem.description }}

@@ -79,12 +80,12 @@

mrbgems

- + - \ No newline at end of file + diff --git a/assets/css/redesign.css b/assets/css/redesign.css index 6598636..3153d6b 100644 --- a/assets/css/redesign.css +++ b/assets/css/redesign.css @@ -2076,3 +2076,312 @@ ul { width: 100%; } } + +/* ------------------------------------------------------------ + Article — Header + ------------------------------------------------------------ */ +.article-header { + background: var(--color-bg-warm); + border-bottom: 1px solid var(--color-border); + padding: 64px var(--container-padding) 56px; +} + +.article-header__inner { + max-width: var(--container-max-width); + margin: 0 auto; +} + +.article-header__meta { + display: flex; + align-items: center; + gap: 10px; + font-size: 13px; + line-height: 1; + margin-bottom: 24px; +} + +.article-header__category { + font-weight: 500; + color: var(--color-muted); +} + +.article-header__meta-sep { + color: var(--color-muted-secondary); +} + +.article-header__date { + color: var(--color-muted); +} + +.article-header__title { + font-family: var(--font-heading); + font-size: 56px; + font-weight: 700; + letter-spacing: -0.03em; + line-height: 1.1; + color: var(--color-black); + max-width: 800px; +} + +/* ------------------------------------------------------------ + Article — Body Layout + ------------------------------------------------------------ */ +.article-body { + padding: 80px var(--container-padding); +} + +.article-body__inner { + max-width: var(--container-max-width); + margin: 0 auto; + display: flex; + gap: 64px; + align-items: flex-start; +} + +/* ------------------------------------------------------------ + Article — Table of Contents + ------------------------------------------------------------ */ +.article-toc { + width: 220px; + flex-shrink: 0; + position: sticky; + top: calc(var(--nav-height) + 32px); +} + +.article-toc__label { + font-family: var(--font-heading); + font-size: 11px; + font-weight: 600; + letter-spacing: 0.1em; + text-transform: uppercase; + color: var(--color-muted-secondary); + margin-bottom: 16px; + line-height: 14px; +} + +.article-toc__list { + display: flex; + flex-direction: column; + gap: 2px; +} + +.article-toc__item { + border-left: 2px solid var(--color-border); +} + +.article-toc__item--active { + border-left-color: var(--color-red); +} + +.article-toc__item--active .article-toc__link { + color: var(--color-red); +} + +.article-toc__link { + display: block; + font-size: 13px; + color: var(--color-muted); + padding: 6px 0 6px 12px; + line-height: 1.4; + transition: color 0.15s ease; +} + +.article-toc__link:hover { + color: var(--color-black); +} + +.article-toc__item--sub .article-toc__link { + font-size: 12px; + padding-left: 24px; +} + +/* ------------------------------------------------------------ + Article — Content (rendered Markdown) + ------------------------------------------------------------ */ +.article-content { + flex: 1; + min-width: 0; +} + +.article-content h1, +.article-content h2, +.article-content h3 { + scroll-margin-top: calc(var(--nav-height) + 32px); +} + +.article-content h1 { + display: flex; + align-items: center; + gap: 14px; + font-family: var(--font-heading); + font-size: 28px; + font-weight: 700; + letter-spacing: -0.02em; + line-height: 1.2; + color: var(--color-black); + padding-bottom: 20px; + border-bottom: 1px solid var(--color-border); + margin-top: 56px; + margin-bottom: 20px; +} + +.article-content h1:first-child { + margin-top: 0; +} + +.article-content h1::before { + content: ''; + display: block; + width: 20px; + height: 2px; + background: var(--color-red); + flex-shrink: 0; +} + +.article-content h2 { + font-family: var(--font-heading); + font-size: 20px; + font-weight: 700; + letter-spacing: -0.01em; + color: var(--color-black); + margin-top: 32px; + margin-bottom: 12px; +} + +.article-content h3 { + font-family: var(--font-heading); + font-size: 17px; + font-weight: 600; + color: var(--color-black); + margin-top: 24px; + margin-bottom: 10px; +} + +.article-content p { + font-size: 16px; + line-height: 1.65; + color: var(--color-muted); + margin-bottom: 16px; +} + +.article-content a { + color: var(--color-red); + transition: opacity 0.15s ease; +} + +.article-content a:hover { + opacity: 0.75; +} + +.article-content ul, +.article-content ol { + list-style: none; + margin-bottom: 24px; +} + +.article-content li { + font-size: 15px; + line-height: 1.55; + color: var(--color-text-body); + padding: 12px 0; + border-bottom: 1px solid var(--color-bg-warm); +} + +.article-content li:first-child { + border-top: 1px solid var(--color-bg-warm); +} + +.article-content li a { + color: var(--color-red); +} + +.article-content code { + background: var(--color-border); + padding: 1px 6px; + border-radius: 3px; + font-size: 0.875em; + font-weight: 600; + color: var(--color-text-body); + font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; +} + +.article-content pre { + background: var(--color-bg-warm); + border: 1px solid var(--color-border); + padding: 20px 24px; + overflow-x: auto; + margin-bottom: 24px; +} + +.article-content pre code { + background: none; + padding: 0; + font-size: 14px; +} + +.article-content strong { + font-weight: 600; + color: var(--color-black); +} + +.article-content em { + font-style: italic; +} + +.article-content hr { + border: none; + border-top: 1px solid var(--color-border); + margin: 40px 0; +} + +/* ------------------------------------------------------------ + Article — Responsive ≤1024px + ------------------------------------------------------------ */ +@media (max-width: 1024px) { + .article-toc { + display: none; + } + + .article-body__inner { + gap: 0; + } + + .article-header__title { + font-size: 44px; + } +} + +/* ------------------------------------------------------------ + Article — Responsive ≤768px + ------------------------------------------------------------ */ +@media (max-width: 768px) { + .article-header { + padding: 48px var(--container-padding) 40px; + } + + .article-header__title { + font-size: 36px; + } + + .article-body { + padding: 48px var(--container-padding); + } + + .article-content h1 { + font-size: 22px; + margin-top: 40px; + } +} + +/* ------------------------------------------------------------ + Article — Responsive ≤480px + ------------------------------------------------------------ */ +@media (max-width: 480px) { + .article-header__title { + font-size: 28px; + } + + .article-content h1 { + font-size: 20px; + } +} From 3204d7b55824e444a4a41d3ce02d598ee9fad7b9 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 17:56:35 +0100 Subject: [PATCH 15/39] Fix team CSS: remove no-op display:block, add 480px heading size --- assets/css/redesign.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/css/redesign.css b/assets/css/redesign.css index 3153d6b..d012dee 100644 --- a/assets/css/redesign.css +++ b/assets/css/redesign.css @@ -1908,7 +1908,6 @@ ul { } .team-section__bar { - display: block; width: 20px; height: 2px; background: var(--color-red); @@ -2072,6 +2071,10 @@ ul { Team — Responsive ≤480px ------------------------------------------------------------ */ @media (max-width: 480px) { + .team-header__heading { + font-size: 28px; + } + .team-member { width: 100%; } From ccc8900705c759fef3b9f25697ea775efb1a10c7 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 17:58:35 +0100 Subject: [PATCH 16/39] Fix nav link to /team/, fill member grid using CSS auto-fill --- _includes/redesign_nav.html | 2 +- assets/css/redesign.css | 18 ++---------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/_includes/redesign_nav.html b/_includes/redesign_nav.html index 55ea8ff..6d6321a 100644 --- a/_includes/redesign_nav.html +++ b/_includes/redesign_nav.html @@ -16,7 +16,7 @@
  • Documentation
  • Libraries
  • About
  • -
  • Team
  • +
  • Team
  • diff --git a/assets/css/redesign.css b/assets/css/redesign.css index d012dee..b370b59 100644 --- a/assets/css/redesign.css +++ b/assets/css/redesign.css @@ -1931,8 +1931,8 @@ ul { } .team-members__grid { - display: flex; - flex-wrap: wrap; + display: grid; + grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1px; background: var(--color-border); margin-bottom: 80px; @@ -1942,11 +1942,9 @@ ul { display: flex; flex-direction: column; align-items: center; - width: 256px; padding: 32px 24px; gap: 12px; background: var(--color-white); - flex-shrink: 0; transition: background 0.15s ease; } @@ -2048,10 +2046,6 @@ ul { .team-header__heading { font-size: 40px; } - - .team-member { - width: calc(25% - 1px); - } } /* ------------------------------------------------------------ @@ -2061,10 +2055,6 @@ ul { .team-header__heading { font-size: 32px; } - - .team-member { - width: calc(50% - 1px); - } } /* ------------------------------------------------------------ @@ -2074,10 +2064,6 @@ ul { .team-header__heading { font-size: 28px; } - - .team-member { - width: 100%; - } } /* ------------------------------------------------------------ From ff9f5bd380ca39a56f4db7dce54d9ca2010798ad Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 18:51:38 +0100 Subject: [PATCH 17/39] Refactor reusable components --- _layouts/post.html | 14 +- _sass/_page-header.scss | 223 ++++++++++++ about/index.html | 8 +- assets/css/{redesign.css => redesign.scss} | 384 +-------------------- docs/index.html | 8 +- downloads/index.html | 2 +- index.html | 14 +- libraries/index.html | 14 +- team/index.html | 14 +- 9 files changed, 271 insertions(+), 410 deletions(-) create mode 100644 _sass/_page-header.scss rename assets/css/{redesign.css => redesign.scss} (84%) diff --git a/_layouts/post.html b/_layouts/post.html index e4c89c7..5454fd4 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -6,8 +6,8 @@ {% include redesign_nav.html %}
    -
    -
    +
    +
    {% assign first_cat = page.categories | first %} {% if first_cat.size > 1 %} {% assign display_cat = first_cat | capitalize %} @@ -15,13 +15,13 @@ {% assign display_cat = page.categories | capitalize %} {% endif %} {% if display_cat or page.date %} -
    - {% if display_cat %}{{ display_cat }}{% endif %} - {% if display_cat and page.date %}{% endif %} - {% if page.date %}{% endif %} +
    + {% if display_cat %}{{ display_cat }}{% endif %} + {% if display_cat and page.date %}{% endif %} + {% if page.date %}{% endif %}
    {% endif %} -

    {{ page.title }}

    +

    {{ page.title }}

    diff --git a/_sass/_page-header.scss b/_sass/_page-header.scss new file mode 100644 index 0000000..b036d9d --- /dev/null +++ b/_sass/_page-header.scss @@ -0,0 +1,223 @@ +/* ============================================================ + .page-header — Unified BEM Component + Variants: --hero, --plain, --article, --split + ============================================================ */ + +/* ------------------------------------------------------------ + Base + ------------------------------------------------------------ */ +.page-header { + background: var(--color-bg-warm); + border-bottom: 1px solid var(--color-border); + padding: 80px var(--container-padding) 56px; + + /* --plain: no background, no border (downloads) */ + &--plain { + background: transparent; + border-bottom: none; + } + + /* --hero: larger padding, tighter heading line-height */ + &--hero { + padding-top: 88px; + padding-bottom: 100px; + } + + /* --article: tighter top padding, used in post layout */ + &--article { + padding-top: 64px; + padding-bottom: 56px; + } + + /* --split: flex split with aside on right */ + &--split &__inner { + display: flex; + align-items: flex-end; + justify-content: space-between; + gap: 40px; + } +} + +/* ------------------------------------------------------------ + Inner Container + ------------------------------------------------------------ */ +.page-header__inner { + max-width: var(--container-max-width); + margin: 0 auto; +} + +/* Left column in split layouts (implicit — no special style needed) */ +.page-header__content { + min-width: 0; +} + +/* Right column in split layouts */ +.page-header__aside { + flex-shrink: 0; + padding-bottom: 4px; +} + +/* ------------------------------------------------------------ + Eyebrow + ------------------------------------------------------------ */ +.page-header__eyebrow { + display: flex; + align-items: center; + gap: 8px; + font-family: var(--font-heading); + font-size: 12px; + font-weight: 500; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--color-red); + margin-bottom: 20px; +} + +.page-header__eyebrow-dot { + width: 8px; + height: 8px; + border-radius: 50%; + background: var(--color-red); + flex-shrink: 0; +} + +/* ------------------------------------------------------------ + Heading + ------------------------------------------------------------ */ +.page-header__heading { + font-family: var(--font-heading); + font-size: 56px; + font-weight: 700; + letter-spacing: -0.03em; + line-height: 1.1; + color: var(--color-black); + margin-bottom: 20px; + + .page-header--hero & { + font-size: 64px; + line-height: 1.0; + margin-bottom: 28px; + } + + .page-header--article & { + margin-bottom: 0; + max-width: 800px; + } +} + +/* ------------------------------------------------------------ + Description + ------------------------------------------------------------ */ +.page-header__description { + font-size: 17px; + line-height: 1.65; + color: var(--color-muted); + max-width: 560px; + + .page-header--hero & { + max-width: 460px; + margin-bottom: 40px; + } + + a { + color: var(--color-red); + transition: opacity 0.15s ease; + + &:hover { + opacity: 0.75; + } + } +} + +/* ------------------------------------------------------------ + Actions (hero CTA buttons) + ------------------------------------------------------------ */ +.page-header__actions { + display: flex; + align-items: center; + gap: 12px; + flex-wrap: wrap; +} + +/* ------------------------------------------------------------ + Meta line (article layout: category · sep · date) + ------------------------------------------------------------ */ +.page-header__meta { + display: flex; + align-items: center; + gap: 10px; + font-size: 13px; + line-height: 1; + margin-bottom: 24px; +} + +.page-header__meta-category { + font-weight: 500; + color: var(--color-muted); +} + +.page-header__meta-sep { + color: var(--color-muted-secondary); +} + +.page-header__meta-date { + color: var(--color-muted); +} + +/* ------------------------------------------------------------ + Responsive — ≤1024px + ------------------------------------------------------------ */ +@media (max-width: 1024px) { + .page-header--hero .page-header__heading { + font-size: 48px; + } + + .page-header__heading { + font-size: 40px; + } + + .page-header--split .page-header__inner { + flex-direction: column; + align-items: flex-start; + gap: 24px; + } +} + +/* ------------------------------------------------------------ + Responsive — ≤768px + ------------------------------------------------------------ */ +@media (max-width: 768px) { + .page-header--hero { + padding: 56px var(--container-padding) 64px; + } + + .page-header--hero .page-header__heading { + font-size: 36px; + } + + .page-header__heading { + font-size: 32px; + } + + .page-header--hero .page-header__actions { + flex-direction: column; + align-items: stretch; + } + + .page-header--hero .page-header__actions .btn { + justify-content: center; + } + + .page-header__aside { + padding-bottom: 0; + } +} + +/* ------------------------------------------------------------ + Responsive — ≤480px + ------------------------------------------------------------ */ +@media (max-width: 480px) { + .page-header__heading { + font-size: 28px; + } +} diff --git a/about/index.html b/about/index.html index a7831d6..72d6b73 100644 --- a/about/index.html +++ b/about/index.html @@ -3,14 +3,14 @@ title: mruby — About --- -
    -
    +
    {% include footer.html %} diff --git a/_layouts/post.html b/_layouts/post.html index 5454fd4..0bcffc1 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -5,7 +5,7 @@ {% include redesign_nav.html %} -
    +
    {% assign first_cat = page.categories | first %} @@ -53,6 +53,11 @@

    {{ page.title }}

    } // TOC generation + // Add role="list" to article lists (VoiceOver Safari removes list semantics with list-style:none) + document.querySelectorAll('.article-content ul, .article-content ol').forEach(function (el) { + el.setAttribute('role', 'list'); + }); + var content = document.querySelector('.article-content'); var tocNav = document.getElementById('article-toc-nav'); var tocAside = document.getElementById('article-toc'); @@ -66,6 +71,7 @@

    {{ page.title }}

    var list = document.createElement('ul'); list.className = 'article-toc__list'; + list.setAttribute('role', 'list'); headings.forEach(function (h) { if (!h.id) return; var li = document.createElement('li'); diff --git a/_layouts/redesign.html b/_layouts/redesign.html index cdfee95..db032cf 100644 --- a/_layouts/redesign.html +++ b/_layouts/redesign.html @@ -5,7 +5,7 @@ {% include redesign_nav.html %} -
    +
    {{ content }}
    {% include redesign_footer.html %} diff --git a/_sass/_article.scss b/_sass/_article.scss index 6eade9d..0e43e35 100644 --- a/_sass/_article.scss +++ b/_sass/_article.scss @@ -132,6 +132,9 @@ .article-content a { color: var(--color-red); + text-decoration: underline; + text-decoration-color: currentColor; + text-underline-offset: 2px; transition: opacity 0.15s ease; } @@ -139,6 +142,16 @@ opacity: 0.75; } +.article-content a:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: 2px; +} + +.article-toc__link:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: 2px; +} + .article-content ul, .article-content ol { list-style: none; diff --git a/_sass/_buttons.scss b/_sass/_buttons.scss index bea6afb..6325bf6 100644 --- a/_sass/_buttons.scss +++ b/_sass/_buttons.scss @@ -38,3 +38,8 @@ background: var(--color-hover-overlay); color: var(--color-black); } + +.btn:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: 2px; +} diff --git a/_sass/_documentation.scss b/_sass/_documentation.scss index 6b0a52a..dbf5c1b 100644 --- a/_sass/_documentation.scss +++ b/_sass/_documentation.scss @@ -128,6 +128,12 @@ background: var(--color-bg-warm); } +.docs-article-row:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: -2px; + background: var(--color-bg-warm); +} + .docs-article-row__info { display: flex; flex-direction: column; @@ -177,6 +183,16 @@ opacity: 0.88; } +.docs-component-card:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: -2px; +} + +.docs-source-note__link:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: 2px; +} + .docs-component-card--warm { background: var(--color-bg-warm); } diff --git a/_sass/_downloads.scss b/_sass/_downloads.scss index 52827d3..208345d 100644 --- a/_sass/_downloads.scss +++ b/_sass/_downloads.scss @@ -121,6 +121,11 @@ color: var(--color-white); } +.download-btn:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: 2px; +} + .download-more { display: flex; align-items: center; @@ -279,6 +284,11 @@ opacity: 0.75; } +.release-row__link:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: 2px; +} + @media (max-width: 1024px) { .release-card { gap: 48px; diff --git a/_sass/_footer.scss b/_sass/_footer.scss index 36f7fd1..af6981d 100644 --- a/_sass/_footer.scss +++ b/_sass/_footer.scss @@ -45,6 +45,12 @@ color: var(--color-footer-muted-hover); } +.site-footer__attribution a:focus-visible, +.site-footer__feeds a:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: 2px; +} + @media (max-width: 768px) { .site-footer__inner { flex-direction: column; diff --git a/_sass/_latest-news.scss b/_sass/_latest-news.scss index 7474777..b59bd24 100644 --- a/_sass/_latest-news.scss +++ b/_sass/_latest-news.scss @@ -35,6 +35,11 @@ opacity: 0.75; } +.latest-news__all-link:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: 2px; +} + .latest-news__divider { height: 1px; background: var(--color-border); @@ -59,6 +64,12 @@ background: var(--color-bg-warm); } +.news-card:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: -2px; + background: var(--color-bg-warm); +} + .news-card + .news-card { border-left: none; } diff --git a/_sass/_navigation.scss b/_sass/_navigation.scss index b99d0d7..fdbfd16 100644 --- a/_sass/_navigation.scss +++ b/_sass/_navigation.scss @@ -1,3 +1,20 @@ +.skip-link { + position: absolute; + top: -100%; + left: 0; + z-index: 1000; + padding: 8px 16px; + background: var(--color-red); + color: var(--color-white); + font-size: 14px; + font-weight: 600; + text-decoration: none; +} + +.skip-link:focus { + top: 0; +} + .site-nav { position: sticky; top: 0; @@ -64,6 +81,12 @@ background: var(--color-bg-warm); } +.site-nav__links a:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: 2px; + color: var(--color-black); +} + .site-nav__links a[aria-current="page"] { color: var(--color-black); font-weight: 600; @@ -93,6 +116,16 @@ background: var(--color-bg-warm); } +.site-nav__hamburger:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: 2px; +} + +.site-nav__brand:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: 2px; +} + .site-nav__hamburger span { display: block; width: 20px; diff --git a/_sass/_reset.scss b/_sass/_reset.scss index 02b3e80..d90ab47 100644 --- a/_sass/_reset.scss +++ b/_sass/_reset.scss @@ -41,3 +41,14 @@ img { ul { list-style: none; } + +@media (prefers-reduced-motion: reduce) { + *, + *::before, + *::after { + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.01ms !important; + scroll-behavior: auto !important; + } +} diff --git a/_sass/_team.scss b/_sass/_team.scss index 6fee097..e45cee7 100644 --- a/_sass/_team.scss +++ b/_sass/_team.scss @@ -11,6 +11,11 @@ opacity: 0.75; } +.team-header__link:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: 2px; +} + .team-section__inner { max-width: var(--container-max-width); margin: 0 auto; @@ -67,6 +72,12 @@ background: var(--color-bg-warm); } +.team-member:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: -2px; + background: var(--color-bg-warm); +} + .team-member__avatar { width: 72px; height: 72px; @@ -144,3 +155,8 @@ .team-developers__more:hover { opacity: 0.75; } + +.team-developers__more:focus-visible { + outline: 2px solid var(--color-red); + outline-offset: 2px; +} diff --git a/_sass/_variables.scss b/_sass/_variables.scss index aa6a2c7..763482f 100644 --- a/_sass/_variables.scss +++ b/_sass/_variables.scss @@ -8,12 +8,12 @@ --color-border: #e0dbd5; --color-border-dark: #222222; --color-muted: #6b6560; - --color-muted-secondary: #9d9894; + --color-muted-secondary: #736e69; --color-text-body: #3d3a37; --color-hover-overlay: rgba(0, 0, 0, 0.02); --color-nav-shadow: rgba(0, 0, 0, 0.08); - --color-footer-muted: #5a5550; - --color-footer-muted-hover: #8a8580; + --color-footer-muted: #8a8580; + --color-footer-muted-hover: #b0aca8; --font-heading: 'Space Grotesk', system-ui, sans-serif; --font-body: 'Inter', system-ui, sans-serif; diff --git a/assets/css/main.css b/assets/css/main.css index 7520293..339fd9c 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -83,7 +83,7 @@ a { } .navbar-mruby .navbar-link:hover { color: #f00; - background-color: 000; + background-color: #000; } @media (max-width: 950px) { diff --git a/downloads/index.html b/downloads/index.html index 354646e..b87ced4 100644 --- a/downloads/index.html +++ b/downloads/index.html @@ -44,14 +44,14 @@

    Get mruby

    Source .zip mruby-{{ current.version }}.zip · via GitHub
    -
    Download + Download
    Source .tar.gz mruby-{{ current.version }}.tar.gz · via GitHub
    - Download + Download
    More assets and checksums available on diff --git a/libraries/index.html b/libraries/index.html index 6634cd8..649af8f 100644 --- a/libraries/index.html +++ b/libraries/index.html @@ -43,7 +43,7 @@

    mrbgems

    autocomplete="off" >
    - Showing {{ total }} libraries + Showing {{ total }} libraries
    diff --git a/team/index.html b/team/index.html index ede8cd8..4313fbc 100644 --- a/team/index.html +++ b/team/index.html @@ -24,7 +24,7 @@

    The people behind mruby

    - Organization Members +

    Organization Members

    {%- for member in site.data.team -%} @@ -46,7 +46,7 @@

    The people behind mruby

    - mruby Developers +

    mruby Developers

    — from the AUTHORS file
    From 56fa6e9f34686e252148ee8c1f642fbcf4d7f1e1 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 19:39:32 +0100 Subject: [PATCH 23/39] Build docs/api via Rake --- .gitignore | 1 + Gemfile | 1 + Gemfile.lock | 2 + Rakefile | 128 + _data/mgems.yml | 737 +- docs/api/.nojekyll | 0 docs/api/Addrinfo.html | 1840 --- docs/api/ArgumentError.html | 164 - docs/api/Array.html | 8450 ------------ docs/api/BasicSocket.html | 1992 --- docs/api/Comparable.html | 712 - docs/api/Complex.html | 1285 -- docs/api/EOFError.html | 160 - docs/api/Enumerable.html | 4782 ------- docs/api/Enumerator.html | 2149 --- docs/api/Enumerator/Chain.html | 538 - docs/api/Enumerator/Generator.html | 319 - docs/api/Enumerator/Lazy.html | 1104 -- docs/api/Enumerator/Yielder.html | 350 - docs/api/Exception.html | 820 -- docs/api/FalseClass.html | 721 - docs/api/Fiber.html | 813 -- docs/api/File.html | 1955 --- docs/api/File/Constants.html | 217 - docs/api/FileTest.html | 125 - docs/api/Fixnum.html | 1825 --- docs/api/Float.html | 2877 ---- docs/api/FloatDomainError.html | 160 - docs/api/FrozenError.html | 128 - docs/api/GC.html | 109 - docs/api/Hash.html | 6535 --------- docs/api/IO.html | 3754 ----- docs/api/IOError.html | 168 - docs/api/IPSocket.html | 478 - docs/api/IndexError.html | 168 - docs/api/Integer.html | 544 - docs/api/Integral.html | 1592 --- docs/api/Kernel.html | 7293 ---------- docs/api/KeyError.html | 160 - docs/api/LocalJumpError.html | 164 - docs/api/Math.html | 2868 ---- docs/api/Method.html | 1618 --- docs/api/Module.html | 768 -- docs/api/NameError.html | 326 - docs/api/NilClass.html | 1163 -- docs/api/NoMemoryError.html | 144 - docs/api/NoMethodError.html | 337 - docs/api/NotImplementedError.html | 152 - docs/api/Numeric.html | 924 -- docs/api/ObjectSpace.html | 109 - docs/api/Proc.html | 520 - docs/api/Random.html | 381 - docs/api/Range.html | 680 - docs/api/RangeError.html | 168 - docs/api/Rational.html | 678 - docs/api/RegexpError.html | 164 - docs/api/ScriptError.html | 160 - docs/api/Socket.html | 1170 -- docs/api/Socket/Constants.html | 114 - docs/api/Socket/Option.html | 957 -- docs/api/SocketError.html | 152 - docs/api/StandardError.html | 160 - docs/api/StopIteration.html | 240 - docs/api/String.html | 12784 ------------------ docs/api/Struct.html | 2300 ---- docs/api/Symbol.html | 1269 -- docs/api/SystemStackError.html | 156 - docs/api/TCPServer.html | 528 - docs/api/TCPSocket.html | 381 - docs/api/Time.html | 3480 ----- docs/api/TrueClass.html | 585 - docs/api/TypeError.html | 164 - docs/api/UDPSocket.html | 564 - docs/api/UNIXServer.html | 531 - docs/api/UNIXSocket.html | 590 - docs/api/UnboundMethod.html | 1329 -- docs/api/_index.html | 646 - docs/api/class_list.html | 59 - docs/api/css/common.css | 1 - docs/api/css/full_list.css | 58 - docs/api/css/mruby.css | 0 docs/api/css/style.css | 496 - docs/api/file.AUTHORS.html | 118 - docs/api/file.CONTRIBUTING.html | 153 - docs/api/file.LICENSE.html | 93 - docs/api/file.README.html | 180 - docs/api/file.compile.html | 564 - docs/api/file.debugger.html | 490 - docs/api/file.gc-arena-howto.html | 253 - docs/api/file.mrbconf.html | 259 - docs/api/file.mrbgems.html | 433 - docs/api/file_list.html | 104 - docs/api/frames.html | 17 - docs/api/function_list.html | 2627 ---- docs/api/header_list.html | 277 - docs/api/headers.html | 142 - docs/api/headers/mrbconf.h.html | 195 - docs/api/headers/mruby.h.html | 7615 ----------- docs/api/headers/mruby_2Farray.h.html | 2011 --- docs/api/headers/mruby_2Fboxing_nan.h.html | 116 - docs/api/headers/mruby_2Fboxing_no.h.html | 191 - docs/api/headers/mruby_2Fboxing_word.h.html | 267 - docs/api/headers/mruby_2Fclass.h.html | 428 - docs/api/headers/mruby_2Fcommon.h.html | 192 - docs/api/headers/mruby_2Fcompile.h.html | 659 - docs/api/headers/mruby_2Fdata.h.html | 325 - docs/api/headers/mruby_2Fdebug.h.html | 259 - docs/api/headers/mruby_2Fdump.h.html | 410 - docs/api/headers/mruby_2Ferror.h.html | 529 - docs/api/headers/mruby_2Fext_2Fio.h.html | 96 - docs/api/headers/mruby_2Fgc.h.html | 189 - docs/api/headers/mruby_2Fhash.h.html | 1621 --- docs/api/headers/mruby_2Firep.h.html | 417 - docs/api/headers/mruby_2Fistruct.h.html | 218 - docs/api/headers/mruby_2Fkhash.h.html | 352 - docs/api/headers/mruby_2Fnumeric.h.html | 463 - docs/api/headers/mruby_2Fobject.h.html | 146 - docs/api/headers/mruby_2Fopcode.h.html | 342 - docs/api/headers/mruby_2Fproc.h.html | 493 - docs/api/headers/mruby_2Frange.h.html | 315 - docs/api/headers/mruby_2Fre.h.html | 101 - docs/api/headers/mruby_2Fstring.h.html | 2453 ---- docs/api/headers/mruby_2Fthrow.h.html | 131 - docs/api/headers/mruby_2Ftime.h.html | 133 - docs/api/headers/mruby_2Fvalue.h.html | 918 -- docs/api/headers/mruby_2Fvariable.h.html | 964 -- docs/api/headers/mruby_2Fversion.h.html | 383 - docs/api/index.html | 180 - docs/api/js/app.js | 303 - docs/api/js/full_list.js | 216 - docs/api/js/jquery.js | 4 - docs/api/js/mruby.js | 0 docs/api/method_list.html | 6835 ---------- docs/api/top-level-namespace.html | 365 - 134 files changed, 550 insertions(+), 131189 deletions(-) create mode 100644 Rakefile delete mode 100644 docs/api/.nojekyll delete mode 100644 docs/api/Addrinfo.html delete mode 100644 docs/api/ArgumentError.html delete mode 100644 docs/api/Array.html delete mode 100644 docs/api/BasicSocket.html delete mode 100644 docs/api/Comparable.html delete mode 100644 docs/api/Complex.html delete mode 100644 docs/api/EOFError.html delete mode 100644 docs/api/Enumerable.html delete mode 100644 docs/api/Enumerator.html delete mode 100644 docs/api/Enumerator/Chain.html delete mode 100644 docs/api/Enumerator/Generator.html delete mode 100644 docs/api/Enumerator/Lazy.html delete mode 100644 docs/api/Enumerator/Yielder.html delete mode 100644 docs/api/Exception.html delete mode 100644 docs/api/FalseClass.html delete mode 100644 docs/api/Fiber.html delete mode 100644 docs/api/File.html delete mode 100644 docs/api/File/Constants.html delete mode 100644 docs/api/FileTest.html delete mode 100644 docs/api/Fixnum.html delete mode 100644 docs/api/Float.html delete mode 100644 docs/api/FloatDomainError.html delete mode 100644 docs/api/FrozenError.html delete mode 100644 docs/api/GC.html delete mode 100644 docs/api/Hash.html delete mode 100644 docs/api/IO.html delete mode 100644 docs/api/IOError.html delete mode 100644 docs/api/IPSocket.html delete mode 100644 docs/api/IndexError.html delete mode 100644 docs/api/Integer.html delete mode 100644 docs/api/Integral.html delete mode 100644 docs/api/Kernel.html delete mode 100644 docs/api/KeyError.html delete mode 100644 docs/api/LocalJumpError.html delete mode 100644 docs/api/Math.html delete mode 100644 docs/api/Method.html delete mode 100644 docs/api/Module.html delete mode 100644 docs/api/NameError.html delete mode 100644 docs/api/NilClass.html delete mode 100644 docs/api/NoMemoryError.html delete mode 100644 docs/api/NoMethodError.html delete mode 100644 docs/api/NotImplementedError.html delete mode 100644 docs/api/Numeric.html delete mode 100644 docs/api/ObjectSpace.html delete mode 100644 docs/api/Proc.html delete mode 100644 docs/api/Random.html delete mode 100644 docs/api/Range.html delete mode 100644 docs/api/RangeError.html delete mode 100644 docs/api/Rational.html delete mode 100644 docs/api/RegexpError.html delete mode 100644 docs/api/ScriptError.html delete mode 100644 docs/api/Socket.html delete mode 100644 docs/api/Socket/Constants.html delete mode 100644 docs/api/Socket/Option.html delete mode 100644 docs/api/SocketError.html delete mode 100644 docs/api/StandardError.html delete mode 100644 docs/api/StopIteration.html delete mode 100644 docs/api/String.html delete mode 100644 docs/api/Struct.html delete mode 100644 docs/api/Symbol.html delete mode 100644 docs/api/SystemStackError.html delete mode 100644 docs/api/TCPServer.html delete mode 100644 docs/api/TCPSocket.html delete mode 100644 docs/api/Time.html delete mode 100644 docs/api/TrueClass.html delete mode 100644 docs/api/TypeError.html delete mode 100644 docs/api/UDPSocket.html delete mode 100644 docs/api/UNIXServer.html delete mode 100644 docs/api/UNIXSocket.html delete mode 100644 docs/api/UnboundMethod.html delete mode 100644 docs/api/_index.html delete mode 100644 docs/api/class_list.html delete mode 100644 docs/api/css/common.css delete mode 100644 docs/api/css/full_list.css delete mode 100644 docs/api/css/mruby.css delete mode 100644 docs/api/css/style.css delete mode 100644 docs/api/file.AUTHORS.html delete mode 100644 docs/api/file.CONTRIBUTING.html delete mode 100644 docs/api/file.LICENSE.html delete mode 100644 docs/api/file.README.html delete mode 100644 docs/api/file.compile.html delete mode 100644 docs/api/file.debugger.html delete mode 100644 docs/api/file.gc-arena-howto.html delete mode 100644 docs/api/file.mrbconf.html delete mode 100644 docs/api/file.mrbgems.html delete mode 100644 docs/api/file_list.html delete mode 100644 docs/api/frames.html delete mode 100644 docs/api/function_list.html delete mode 100644 docs/api/header_list.html delete mode 100644 docs/api/headers.html delete mode 100644 docs/api/headers/mrbconf.h.html delete mode 100644 docs/api/headers/mruby.h.html delete mode 100644 docs/api/headers/mruby_2Farray.h.html delete mode 100644 docs/api/headers/mruby_2Fboxing_nan.h.html delete mode 100644 docs/api/headers/mruby_2Fboxing_no.h.html delete mode 100644 docs/api/headers/mruby_2Fboxing_word.h.html delete mode 100644 docs/api/headers/mruby_2Fclass.h.html delete mode 100644 docs/api/headers/mruby_2Fcommon.h.html delete mode 100644 docs/api/headers/mruby_2Fcompile.h.html delete mode 100644 docs/api/headers/mruby_2Fdata.h.html delete mode 100644 docs/api/headers/mruby_2Fdebug.h.html delete mode 100644 docs/api/headers/mruby_2Fdump.h.html delete mode 100644 docs/api/headers/mruby_2Ferror.h.html delete mode 100644 docs/api/headers/mruby_2Fext_2Fio.h.html delete mode 100644 docs/api/headers/mruby_2Fgc.h.html delete mode 100644 docs/api/headers/mruby_2Fhash.h.html delete mode 100644 docs/api/headers/mruby_2Firep.h.html delete mode 100644 docs/api/headers/mruby_2Fistruct.h.html delete mode 100644 docs/api/headers/mruby_2Fkhash.h.html delete mode 100644 docs/api/headers/mruby_2Fnumeric.h.html delete mode 100644 docs/api/headers/mruby_2Fobject.h.html delete mode 100644 docs/api/headers/mruby_2Fopcode.h.html delete mode 100644 docs/api/headers/mruby_2Fproc.h.html delete mode 100644 docs/api/headers/mruby_2Frange.h.html delete mode 100644 docs/api/headers/mruby_2Fre.h.html delete mode 100644 docs/api/headers/mruby_2Fstring.h.html delete mode 100644 docs/api/headers/mruby_2Fthrow.h.html delete mode 100644 docs/api/headers/mruby_2Ftime.h.html delete mode 100644 docs/api/headers/mruby_2Fvalue.h.html delete mode 100644 docs/api/headers/mruby_2Fvariable.h.html delete mode 100644 docs/api/headers/mruby_2Fversion.h.html delete mode 100644 docs/api/index.html delete mode 100644 docs/api/js/app.js delete mode 100644 docs/api/js/full_list.js delete mode 100644 docs/api/js/jquery.js delete mode 100644 docs/api/js/mruby.js delete mode 100644 docs/api/method_list.html delete mode 100644 docs/api/top-level-namespace.html diff --git a/.gitignore b/.gitignore index 0e48758..99674dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ _site mruby +/docs/api/ /.bundle/ /vendor/ .worktrees diff --git a/Gemfile b/Gemfile index 3586421..e346ee9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,6 @@ source 'https://rubygems.org' +gem 'rake' gem 'github-pages', group: :jekyll_plugins group :jekyll_plugins do diff --git a/Gemfile.lock b/Gemfile.lock index 45b12cc..12c1204 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -257,6 +257,7 @@ GEM track_open_instances (~> 0.1) public_suffix (5.1.1) racc (1.8.1) + rake (13.3.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) @@ -303,6 +304,7 @@ DEPENDENCIES jekyll-feed jekyll-sitemap mgem + rake yard-coderay yard-mruby diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..99e5806 --- /dev/null +++ b/Rakefile @@ -0,0 +1,128 @@ +namespace :gen do + desc 'Regenerate mrbgem library data (_data/mgems.yml)' + task :mgemdata do + require 'mgem' + require 'yaml' + + class File + class << self + alias_method :exists?, :exist? unless method_defined?(:exists?) + end + end + + include Mrbgem + mgems = load_gems + mgems.update! + + mgem_info = mgems.map do |mgem| + { + 'name' => mgem.name, + 'description' => mgem.description, + 'author' => mgem.author, + 'website' => mgem.website, + 'protocol' => mgem.protocol, + 'repository' => mgem.repository, + 'repooptions' => mgem.repooptions + } + end + + mgem_info.sort_by! { |g| g['name'].downcase } + + File.open('_data/mgems.yml', 'w') { |f| f.write(mgem_info.to_yaml) } + puts 'Written _data/mgems.yml' + end + + desc 'Regenerate API documentation from mruby source (clones latest release into mruby/)' + task :mrbdoc do + require 'json' + + # Resolve latest stable release tag via gh CLI (mruby uses tags, not GitHub Releases) + tags = JSON.parse(`gh api 'repos/mruby/mruby/tags?per_page=100'`) + tag = tags.map { |t| t['name'] }.find { |n| n.match?(/^\d+\.\d+\.\d+$/) } + raise "Could not determine latest stable mruby release tag" unless tag + puts "Latest mruby release: #{tag}" + + # Clone mruby at the release tag (or skip if already at the right version) + mruby_dir = File.join(__dir__, 'mruby') + if Dir.exist?(mruby_dir) + current_tag = `git -C #{mruby_dir} describe --exact-match HEAD 2>/dev/null`.strip + if current_tag == tag + puts "mruby #{tag} already cloned, skipping clone" + else + puts "mruby dir exists at #{current_tag.empty? ? 'unknown version' : current_tag}, re-cloning at #{tag}" + FileUtils.rm_rf(mruby_dir) + sh "git clone --depth 1 --branch #{tag} https://github.com/mruby/mruby.git #{mruby_dir}" + end + else + sh "git clone --depth 1 --branch #{tag} https://github.com/mruby/mruby.git #{mruby_dir}" + end + + # Run mrbdoc (from yard-mruby) in the mruby directory — equivalent to doc:api + Dir.chdir(mruby_dir) do + sh "BUNDLE_GEMFILE=#{__dir__}/Gemfile bundle exec mrbdoc" + end + + # Copy generated docs into our docs/api/ directory + dest = File.join(__dir__, 'docs', 'api') + FileUtils.mkdir_p(dest) + FileUtils.cp_r(Dir.glob("#{mruby_dir}/doc/api/*"), dest) + puts "Copied mruby API docs to docs/api/" + end + + desc 'Regenerate release data from GitHub API (_data/releases.yml)' + task :releasedata do + require 'json' + require 'shellwords' + require 'yaml' + + repo = 'mruby/mruby' + data_file = File.join(__dir__, '_data', 'releases.yml') + + gh_api = lambda { |path| JSON.parse(`gh api #{Shellwords.escape(path)}`) } + + post_dates = {} + Dir.glob(File.join(__dir__, '_posts', '*.{markdown,md}')).each do |f| + if (m = File.basename(f).match(/^(\d{4}-\d{2}-\d{2})-mruby-([\d.]+)-released/)) + post_dates[m[2]] = m[1] + end + end + + tags = [] + page = 1 + loop do + batch = gh_api.call("/repos/#{repo}/tags?per_page=100&page=#{page}") + break if batch.empty? + tags.concat(batch) + break if batch.size < 100 + page += 1 + end + + versioned = tags.select { |t| t['name'].match?(/^\d/) } + + releases = versioned.map do |tag| + version = tag['name'] + prerelease = !version.match?(/^\d+\.\d+\.\d+$/) + date = post_dates[version] || begin + commit = gh_api.call("/repos/#{repo}/commits/#{tag['commit']['sha']}") + commit.dig('commit', 'committer', 'date')&.slice(0, 10) + end + puts " #{version}: #{date}#{' (prerelease)' if prerelease}" + { 'version' => version, 'date' => date, 'prerelease' => prerelease } + end + + File.write(data_file, releases.to_yaml) + puts "\nWritten #{releases.size} releases to #{data_file}" + end +end + +desc 'Build the Jekyll site' +task build: %w[gen:mgemdata gen:mrbdoc gen:releasedata] do + sh 'bundle exec jekyll build' +end + +desc 'Serve the Jekyll site locally with live reload' +task :serve do + sh 'bundle exec jekyll serve' +end + +task default: :build diff --git a/_data/mgems.yml b/_data/mgems.yml index fce6e93..40df04a 100644 --- a/_data/mgems.yml +++ b/_data/mgems.yml @@ -5,49 +5,49 @@ website: https://github.com/k0u5uk3/mruby-alarm protocol: git repository: https://github.com/k0u5uk3/mruby-alarm.git - repooptions: + repooptions: - name: mruby-allegro description: mruby binding to Allegro 5 author: cremno website: https://github.com/cremno/mruby-allegro protocol: git repository: https://github.com/cremno/mruby-allegro.git - repooptions: + repooptions: - name: mruby-allocate description: Class allocate author: ppibburr website: https://github.com/ppibburr/mruby-allocate protocol: git repository: https://github.com/ppibburr/mruby-allocate.git - repooptions: + repooptions: - name: mruby-ansi-colors description: Extends String class to use ANSI color escape codes. author: Mav7 website: https://github.com/mruby-Forum/mruby-ansi-colors protocol: git repository: https://github.com/mruby-Forum/mruby-ansi-colors.git - repooptions: + repooptions: - name: mruby-apr description: Cross platform standard library components à la MRI author: Jared Breeden website: https://github.com/jbreeden/mruby-apr protocol: git repository: https://github.com/jbreeden/mruby-apr.git - repooptions: + repooptions: - name: mruby-arduino description: Arduino binding author: kyab website: https://github.com/kyab/mruby-arduino protocol: git repository: https://github.com/kyab/mruby-arduino.git - repooptions: + 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: + repooptions: - name: mruby-argtable description: Argtable class author: @@ -56,42 +56,42 @@ website: https://github.com/udzura/mruby-argtable protocol: git repository: https://github.com/udzura/mruby-argtable.git - repooptions: + repooptions: - name: mruby-at_exit description: Kernel.at_exit method author: ksss website: https://github.com/ksss/mruby-at_exit protocol: git repository: https://github.com/ksss/mruby-at_exit.git - repooptions: + repooptions: - name: mruby-audite description: Portable MP3 Player based on libmp123 and portaudio author: Matthias Georgi website: https://github.com/georgi/mruby-audite protocol: git repository: https://github.com/georgi/mruby-audite.git - repooptions: + repooptions: - name: mruby-augeas description: Bindings to augeas author: lutter website: https://github.com/hercules-team/mruby-augeas protocol: git repository: https://github.com/hercules-team/mruby-augeas - repooptions: + repooptions: - name: mruby-avl description: Avl Tree implementation author: randym website: https://github.com/randym/mruby-avl protocol: git repository: https://github.com/randym/mruby-avl.git - repooptions: + repooptions: - name: mruby-aws-s3 description: Client library for Amazon's (AWS) S3 REST API author: iij website: https://github.com/iij/mruby-aws-s3 protocol: git repository: https://github.com/iij/mruby-aws-s3.git - repooptions: + repooptions: - name: mruby-aws-sigv4 description: AWS Signature Version 4 signing library for mruby. mruby port of aws-sigv4 RubyGem. @@ -99,189 +99,231 @@ website: https://github.com/hfm/mruby-aws-sigv4 protocol: git repository: https://github.com/hfm/mruby-aws-sigv4.git - repooptions: + repooptions: - name: mruby-b64 description: Base64 for mruby with streaming interface author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-b64 protocol: git repository: https://github.com/Asmod4n/mruby-b64.git - repooptions: + repooptions: - name: mruby-backtrace description: Display backtrace author: crimsonwoods website: https://github.com/crimsonwoods/mruby-backtrace protocol: git repository: https://github.com/crimsonwoods/mruby-backtrace.git - repooptions: + repooptions: - name: mruby-base32 description: Base32 Encoder/Decoder author: qtakamitsu website: https://github.com/tk3/mruby-base32 protocol: git repository: https://github.com/tk3/mruby-base32.git - repooptions: + repooptions: - name: mruby-base58 description: Base58 Encoder/Decoder (third-party fork) author: h2so5 website: https://github.com/sadasant/mruby-base58 protocol: git repository: https://github.com/sadasant/mruby-base58.git - repooptions: + repooptions: - name: mruby-base64 description: Base64 Encoder/Decoder author: mattn website: https://github.com/mattn/mruby-base64 protocol: git repository: https://github.com/mattn/mruby-base64.git - repooptions: + repooptions: - name: mruby-bcrypt description: OpenBSD-style Blowfish-based password hashing author: Emanuele Vicentini website: https://github.com/baldowl/mruby-bcrypt protocol: git repository: https://github.com/baldowl/mruby-bcrypt.git - repooptions: + repooptions: - name: mruby-bignum description: Self-contained Bignum implementation for mruby author: Ray Chason website: https://github.com/chasonr/mruby-bignum protocol: git repository: https://github.com/chasonr/mruby-bignum.git - repooptions: + repooptions: +- name: mruby-bin-barista + description: A cross-platform build tool for executing a DAG of tasks + author: skinnyjames + website: https://github.com/skinnyjames/mruby-bin-barista + protocol: git + repository: https://github.com/skinnyjames/mruby-bin-barista.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: + repooptions: +- name: mruby-bin-monolith + description: Tool to package mruby code in a single standalone executable + author: Chris Reuter + website: https://github.com/suetanvil/mruby-bin-monolith + protocol: git + repository: https://github.com/suetanvil/mruby-bin-monolith.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: + repooptions: - name: mruby-bin-scite-mruby description: A SciTE based text editor with mruby scripting extension author: Takashi Sawanaka website: https://github.com/sdottaka/mruby-bin-scite-mruby protocol: git repository: https://github.com/sdottaka/mruby-bin-scite-mruby.git - repooptions: + repooptions: +- name: mruby-bin-theorem + description: A modern test library & runner toolkit for mruby + author: skinnyjames + website: https://github.com/skinnyjames/mruby-bin-theorem + protocol: git + repository: https://github.com/skinnyjames/mruby-bin-theorem.git + repooptions: - name: mruby-blendish description: Duangle OUI-blendish bindings. author: Corey Powell website: https://github.com/IceDragon200/mruby-blendish protocol: git repository: https://github.com/IceDragon200/mruby-blendish - repooptions: + repooptions: +- name: mruby-c-ares + description: Async DNS requests for mruby as a binding for https://c-ares.org/ + author: Hendrik Beskow + website: https://github.com/Asmod4n/mruby-c-ares + protocol: git + repository: https://github.com/Asmod4n/mruby-c-ares.git + 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: + repooptions: - name: mruby-cache description: mruby inter process share memory cache author: charlescui website: https://github.com/charlescui/mruby-cache protocol: git repository: https://github.com/charlescui/mruby-cache.git - repooptions: + repooptions: - name: mruby-capability description: Linux Capability Binding author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-capability protocol: git repository: https://github.com/matsumotory/mruby-capability.git - repooptions: + 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: + repooptions: - name: mruby-catch-throw description: catch and throw for mruby. author: Corey Powell website: https://github.com/IceDragon200/mruby-catch-throw protocol: git repository: https://github.com/IceDragon200/mruby-catch-throw - repooptions: + repooptions: - name: mruby-cfunc description: Interface to C functions based on libffi. author: Yuichiro MASUI website: https://github.com/mrbgems/mruby-cfunc protocol: git repository: https://github.com/mrbgems/mruby-cfunc.git - repooptions: + repooptions: - name: mruby-cgroup description: cgroup binding author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-cgroup protocol: git repository: https://github.com/matsumotory/mruby-cgroup.git - repooptions: + repooptions: - name: mruby-changefinder description: Detect change point via continuous outlier and smoothing author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-changefinder protocol: git repository: https://github.com/matsumotory/mruby-changefinder.git - repooptions: + repooptions: - name: mruby-channel description: named FIFO queue with multithreading author: bggd website: https://github.com/bggd/mruby-channel protocol: git repository: https://github.com/bggd/mruby-channel.git - repooptions: + repooptions: - name: mruby-chipmunk2d description: chipmunk2d bindings author: Corey Powell website: https://github.com/IceDragon200/mruby-chipmunk2d protocol: git repository: https://github.com/IceDragon200/mruby-chipmunk2d - repooptions: + repooptions: - name: mruby-chrono description: Steady and System clocks for mruby author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-chrono protocol: git repository: https://github.com/Asmod4n/mruby-chrono.git - repooptions: + repooptions: - name: mruby-cipher description: OpenSSL Cipher wrapper author: Seiei Miyagi website: https://github.com/hanachin/mruby-cipher protocol: git repository: https://github.com/hanachin/mruby-cipher.git - repooptions: + repooptions: - name: mruby-clang-plugin description: clang plugin to check mruby API call mistakes. author: Takeshi Watanabe website: https://github.com/take-cheeze/mruby-clang-plugin protocol: git repository: https://github.com/take-cheeze/mruby-clang-plugin.git - repooptions: + repooptions: +- name: mruby-class-attribute + description: inheritable class attributes ported from Hanami + author: Hanami developers (ported by Paweł Świątkowski) + website: https://github.com/katafrakt/mruby-class-attribute + protocol: git + repository: https://github.com/katafrakt/mruby-class-attribute.git + repooptions: +- name: mruby-cmake-build + description: CMake configuration (CMakeLists.txt) generator for mruby. + author: Lanza Schneider + website: https://github.com/LanzaSchneider/mruby-cmake-build + protocol: git + repository: https://github.com/LanzaSchneider/mruby-cmake-build.git + repooptions: - name: mruby-cocoa description: Interface to Cocoa based on Objective-C Runtime and mruby-cfunc. author: Yuichiro MASUI website: https://github.com/mobiruby/mruby-cocoa protocol: git repository: https://github.com/mobiruby/mruby-cocoa.git - repooptions: + 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: + 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. @@ -289,196 +331,210 @@ website: https://github.com/matsumotory/mruby-config protocol: git repository: https://github.com/matsumotory/mruby-config.git - repooptions: + repooptions: - name: mruby-consul description: Consul HTTP API Client. author: Yohei Kawahara website: https://github.com/inokappa/mruby-consul protocol: git repository: https://github.com/inokappa/mruby-consul.git - repooptions: + repooptions: - name: mruby-correlation description: Array extended for correlation coefficient author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-correlation protocol: git repository: https://github.com/matsumotory/mruby-correlation.git - repooptions: + repooptions: +- name: mruby-cpuusage + description: X Platform CPU usage stats for mruby + author: Hendrik Beskow + website: https://github.com/Asmod4n/mruby-cpuusage + protocol: git + repository: https://github.com/Asmod4n/mruby-cpuusage.git + repooptions: - name: mruby-crc description: Configurable general CRC calculator for mruby author: dearblue website: https://github.com/dearblue/mruby-crc protocol: git repository: https://github.com/dearblue/mruby-crc.git - repooptions: + repooptions: - name: mruby-criu description: CRIU, Checkpoint Restart In Userspace for Linux, class author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-criu protocol: git repository: https://github.com/matsumotory/mruby-criu.git - repooptions: + repooptions: - name: mruby-cross-compile-on-mac-osx description: Cross compile osx, linux or win32 binary of mruby on Mac OSX author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-cross-compile-on-mac-osx protocol: git repository: https://github.com/matsumotory/mruby-cross-compile-on-mac-osx.git - repooptions: + repooptions: - name: mruby-curl description: CURL HTTP Client author: mattn website: https://github.com/mattn/mruby-curl protocol: git repository: https://github.com/mattn/mruby-curl.git - repooptions: + repooptions: - name: mruby-curses description: Curses for mruby. Links to NCurses or PDCurses. author: Jared Breeden website: https://github.com/jbreeden/mruby-curses protocol: git repository: https://github.com/jbreeden/mruby-curses.git - repooptions: -- name: mruby-czmq - description: mruby bindings for czmq. - author: Hendrik Beskow - website: https://github.com/Asmod4n/mruby-czmq - protocol: git - repository: https://github.com/Asmod4n/mruby-czmq.git - repooptions: + repooptions: +- name: mruby-cyberarm_engine + description: Yet another framework for building games with Gosu + author: cyberarm + website: https://github.com/cyberarm/cyberarm_engine + protocol: git + repository: https://github.com/cyberarm/cyberarm_engine.git + repooptions: - name: mruby-datadog description: Datadog API Client. author: Yohei Kawahara website: https://github.com/inokappa/mruby-datadog protocol: git repository: https://github.com/inokappa/mruby-datadog.git - repooptions: + 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: + repooptions: - name: mruby-digest description: MD5, RMD160, SHA1, SHA256, SHA384, SHA512 and HMAC Digests. author: Internet Initiative Japan., Inc. website: https://github.com/iij/mruby-digest protocol: git repository: https://github.com/iij/mruby-digest.git - repooptions: + repooptions: - name: mruby-dir description: Dir Class author: Internet Initiative Japan., Inc. website: https://github.com/iij/mruby-dir protocol: git repository: https://github.com/iij/mruby-dir.git - repooptions: + repooptions: - name: mruby-dir-glob description: File.fnmatch() & Dir.glob() author: Alexander Gromnitsky website: https://github.com/gromnitsky/mruby-dir-glob.git protocol: git repository: https://github.com/gromnitsky/mruby-dir-glob.git - repooptions: + repooptions: - name: mruby-discount description: HTML generator from Markdown using discount author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-discount protocol: git repository: https://github.com/matsumotory/mruby-discount.git - repooptions: + repooptions: - name: mruby-disque description: Disque client class author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-disque protocol: git repository: https://github.com/matsumotory/mruby-disque.git - repooptions: + repooptions: - name: mruby-dll description: DLL Windows Support author: mattn website: https://github.com/mattn/mruby-dll protocol: git repository: https://github.com/mattn/mruby-dll.git - repooptions: + repooptions: - name: mruby-eject description: Eject CD-ROM author: mattn website: https://github.com/mattn/mruby-eject protocol: git repository: https://github.com/mattn/mruby-eject.git - repooptions: + repooptions: - name: mruby-env description: ENV class implementation author: iij website: https://github.com/iij/mruby-env protocol: git repository: https://github.com/iij/mruby-env.git - repooptions: + repooptions: - name: mruby-erb description: Port of CRuby's ERB author: Jared Breeden website: https://github.com/jbreeden/mruby-erb protocol: git repository: https://github.com/jbreeden/mruby-erb.git - repooptions: + repooptions: - name: mruby-errno description: Errno module author: iij website: https://github.com/iij/mruby-errno protocol: git repository: https://github.com/iij/mruby-errno.git - repooptions: + 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: + 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: + 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: + 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: + repooptions: - name: mruby-etcd description: Simple etcd API wrapper author: Uchio Kondo website: https://github.com/udzura/mruby-etcd protocol: git repository: https://github.com/udzura/mruby-etcd.git - repooptions: + repooptions: - name: mruby-eventfd description: Eventfd class author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-eventfd protocol: git repository: https://github.com/matsumotory/mruby-eventfd.git - repooptions: + repooptions: - name: mruby-factory description: Factory implementation for mruby author: OKURA Masafumi website: https://github.com/okuramasafumi/mruby-factory protocol: git repository: https://github.com/okuramasafumi/mruby-factory.git - repooptions: + repooptions: +- name: mruby-fast-json + description: JSON Parsing and dumping for mruby, fast + author: Hendrik Beskow + website: https://github.com/Asmod4n/mruby-fast-json + protocol: git + repository: https://github.com/Asmod4n/mruby-fast-json.git + repooptions: - name: mruby-fast-remote-check description: FastRemoteCheck can perform port listening check at high speed using raw socket @@ -486,133 +542,133 @@ website: https://github.com/matsumotory/mruby-fast-remote-check protocol: git repository: https://github.com/matsumotory/mruby-fast-remote-check.git - repooptions: + 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: + 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: + repooptions: - name: mruby-file-fnmatch description: File.fnmatch() author: katzer website: https://github.com/katzer/mruby-file-fnmatch protocol: git repository: https://github.com/katzer/mruby-file-fnmatch.git - repooptions: + repooptions: - name: mruby-file-stat description: File::Stat class implementation author: ksss website: https://github.com/ksss/mruby-file-stat protocol: git repository: https://github.com/ksss/mruby-file-stat.git - repooptions: + repooptions: - name: mruby-filemagic description: filemagic class implementation author: k0u5uk3 website: https://github.com/k0u5uk3/mruby-filemagic.git protocol: git repository: https://github.com/k0u5uk3/mruby-filemagic.git - repooptions: + repooptions: - name: mruby-float4 description: small vector classes for mruby author: Tomasz Dabrowski website: https://github.com/dabroz/mruby-float4 protocol: git repository: https://github.com/dabroz/mruby-float4.git - repooptions: + repooptions: - name: mruby-fltk3 description: FLTK3 GUI binding. author: mattn website: https://github.com/mattn/mruby-fltk3 protocol: git repository: https://github.com/mattn/mruby-fltk3.git - repooptions: + repooptions: - name: mruby-fluent-logger description: A structured logger for Fluentd. author: Kentaro Yoshida website: https://github.com/y-ken/fluent-logger-mruby protocol: git repository: https://github.com/y-ken/fluent-logger-mruby.git - repooptions: + repooptions: - name: mruby-forwardable description: forwardable module for mruby author: Masayoshi Takahashi website: https://github.com/takahashim/mruby-forwardable protocol: git repository: https://github.com/takahashim/mruby-forwardable.git - repooptions: + repooptions: - name: mruby-fsm description: Finite State Machine. author: Paolo Bosetti, University of Trento website: https://github.com/UniTN-Mechatronics/mruby-fsm protocol: git repository: https://github.com/UniTN-Mechatronics/mruby-fsm.git - repooptions: + repooptions: - name: mruby-ftp description: FTP client library. author: Paolo Bosetti and Matteo Ragni, University of Trento website: https://github.com/UniTN-Mechatronics/mruby-ftp protocol: git repository: https://github.com/UniTN-Mechatronics/mruby-ftp.git - repooptions: + 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: + repooptions: - name: mruby-geoip description: GeoIP(City) class using GeoIPCity.dat for mruby author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-geoip protocol: git repository: https://github.com/matsumotory/mruby-geoip.git - repooptions: + 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: + repooptions: - name: mruby-getoptlong description: An almost straight mruby port of Ruby's GetoptLong author: Sergio Rubio website: https://github.com/rubiojr/mruby-getoptlong protocol: git repository: https://github.com/rubiojr/mruby-getoptlong - repooptions: + repooptions: - name: mruby-getopts description: GNU getopt for mruby author: M&T Technology, Inc. website: https://github.com/mttech/mruby-getopts protocol: git repository: https://github.com/mttech/mruby-getopts - repooptions: + repooptions: - name: mruby-getpass description: Read passwords from the command prompt author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-getpass protocol: git repository: https://github.com/Asmod4n/mruby-getpass.git - repooptions: + 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: + repooptions: - name: mruby-girffi description: GObjectIntrospection bindings that dynamically bind GLib based libraries. ie, GLib,Gtk,WebKit ... @@ -620,98 +676,105 @@ website: https://github.com/ppibburr/mruby-girffi protocol: git repository: https://github.com/ppibburr/mruby-girffi.git - repooptions: + repooptions: - name: mruby-girffi-docgen description: Generates YARD documentation for bindings generated by mruby-girffi author: ppibburr website: https://github.com/ppibburr/mruby-girffi-docgen protocol: git repository: https://github.com/ppibburr/mruby-girffi-docgen.git - repooptions: + repooptions: - name: mruby-gles description: OpenGL ES 2.0 binding author: xxuejie website: https://github.com/xxuejie/mruby-gles protocol: git repository: https://github.com/xxuejie/mruby-gles.git - repooptions: + repooptions: - name: mruby-glfw3 description: GLFW3 binding author: Takeshi Watanabe website: https://github.com/take-cheeze/mruby-glfw3 protocol: git repository: https://github.com/take-cheeze/mruby-glfw3.git - repooptions: + repooptions: - name: mruby-glib description: Cross platform standard library components à la GLib author: Jared Breeden website: https://github.com/jbreeden/mruby-glib protocol: git repository: https://github.com/jbreeden/mruby-glib.git - repooptions: + repooptions: - name: mruby-glib2 description: Bindings to GLib 2.x. uses mruby-girffi author: ppibburr website: https://github.com/ppibburr/mruby-glib2 protocol: git repository: https://github.com/ppibburr/mruby-glib2.git - repooptions: + repooptions: - name: mruby-gmp-bignum description: GMP-based Bignum implementation for mruby author: Ray Chason website: https://github.com/chasonr/mruby-gmp-bignum protocol: git repository: https://github.com/chasonr/mruby-gmp-bignum.git - repooptions: + repooptions: - name: mruby-gntp description: Growl Notification Transfer Protocol author: mattn website: https://github.com/mattn/mruby-gntp protocol: git repository: https://github.com/mattn/mruby-gntp.git - repooptions: + repooptions: - name: mruby-gobject description: Bindings to GObject. uses mruby-girffi author: ppibburr website: https://github.com/ppibburr/mruby-gobject protocol: git repository: https://github.com/ppibburr/mruby-gobject.git - repooptions: + repooptions: - name: mruby-gobject-introspection description: bindings to GObjectIntrospection (libgirepository) author: ppibburr website: https://github.com/ppibburr/mruby-gobject-introspection protocol: git repository: https://github.com/ppibburr/mruby-gobject-introspection.git - repooptions: + repooptions: +- name: mruby-gosu + description: mruby wrapper for the Gosu game library + author: cyberarm + website: https://github.com/cyberarm/mruby-gosu + protocol: git + repository: https://github.com/cyberarm/mruby-gosu.git + repooptions: - name: mruby-growthforecast description: GrowthForecast client class author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-growthforecast protocol: git repository: https://github.com/matsumotory/mruby-growthforecast.git - repooptions: + repooptions: - name: mruby-gsl description: Wrapper to GNU Scientific Library (GSL). author: Paolo Bosetti, University of Trento website: https://github.com/UniTN-Mechatronics/mruby-gsl protocol: git repository: https://github.com/UniTN-Mechatronics/mruby-gsl.git - repooptions: + repooptions: - name: mruby-gtk2 description: Bindings to Gtk2. uses mruby-girffi author: ppibburr website: https://github.com/ppibburr/mruby-gtk2 protocol: git repository: https://github.com/ppibburr/mruby-gtk2.git - repooptions: + repooptions: - name: mruby-gtk3 description: Bindings to Gtk3. uses mruby-girffi author: ppibburr website: https://github.com/ppibburr/mruby-gtk3 protocol: git repository: https://github.com/ppibburr/mruby-gtk3.git - repooptions: + repooptions: - name: mruby-hashie description: Collection of classes and mixins that makes hashes more powerful author: @@ -721,14 +784,14 @@ website: https://github.com/k0kubun/mruby-hashie protocol: git repository: https://github.com/k0kubun/mruby-hashie.git - repooptions: + 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: + repooptions: - name: mruby-hibari description: A Web application framework for Web servers that support mruby and Rack-based API @@ -736,133 +799,140 @@ website: https://github.com/kentaro/mruby-hibari protocol: git repository: https://github.com/kentaro/mruby-hibari.git - repooptions: + repooptions: - name: mruby-hiredis description: hiredis bindings for mruby. author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-hiredis protocol: git repository: https://github.com/Asmod4n/mruby-hiredis.git - repooptions: + 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: + repooptions: - name: mruby-hogun description: convenient library to build the command line interface. author: qtakamitsu website: https://github.com/tk3/mruby-hogun protocol: git repository: https://github.com/tk3/mruby-hogun.git - repooptions: + repooptions: - name: mruby-host-stats description: library to gather stats on running system (cpu, memory, ...). author: Julien Ammous website: https://github.com/schmurfy/host-stats protocol: git repository: https://github.com/schmurfy/host-stats.git - repooptions: + repooptions: - name: mruby-hs-regexp description: Light-weight Henry Spencer's Regular Expression author: Masamitsu MURASE website: https://github.com/masamitsu-murase/mruby-hs-regexp protocol: git repository: https://github.com/masamitsu-murase/mruby-hs-regexp.git - repooptions: + repooptions: - name: mruby-http description: HTTP Parser author: mattn website: https://github.com/mattn/mruby-http protocol: git repository: https://github.com/mattn/mruby-http.git - repooptions: + repooptions: - name: mruby-http2 description: HTTP2 module for mruby author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-http2 protocol: git repository: https://github.com/matsumotory/mruby-http2.git - repooptions: + repooptions: - name: mruby-httprequest description: create http request class author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-httprequest protocol: git repository: https://github.com/matsumotory/mruby-httprequest.git - repooptions: + repooptions: - name: mruby-httpsclient description: A simple https only Client author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-httpsclient protocol: git repository: https://github.com/Asmod4n/mruby-httpsclient.git - repooptions: + repooptions: - name: mruby-iconv description: libiconv interface author: mattn website: https://github.com/mattn/mruby-iconv protocol: git repository: https://github.com/mattn/mruby-iconv.git - repooptions: + repooptions: - name: mruby-iijson description: JSON parser and generator author: iij website: https://github.com/iij/mruby-iijson protocol: git repository: https://github.com/iij/mruby-iijson.git - repooptions: + 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: + repooptions: - name: mruby-inotify description: Inotify bindings author: FlavourSys Technology GmbH website: https://github.com/FlavourSys/mruby-inotify protocol: git repository: https://github.com/FlavourSys/mruby-inotify.git - repooptions: + repooptions: - name: mruby-io-console description: The implementation of io/console as CRuby. author: ksss website: https://github.com/ksss/mruby-io-console protocol: git repository: https://github.com/ksss/mruby-io-console.git - repooptions: + 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: + repooptions: +- name: mruby-io-uring + description: io-uring from linux for mruby + author: Hendrik Beskow + website: https://github.com/Asmod4n/mruby-io_uring + protocol: git + repository: https://github.com/Asmod4n/mruby-io_uring.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: + repooptions: - name: mruby-ipaddr description: IPAddr class author: iij website: https://github.com/iij/mruby-ipaddr protocol: git repository: https://github.com/iij/mruby-ipaddr.git - repooptions: + 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: + repooptions: - name: mruby-ipvs description: interface to IP Virtual Server (IPVS) for mruby author: YOSHIKAWA Ryota @@ -876,168 +946,175 @@ website: https://github.com/ppibburr/mruby-javascriptcore protocol: git repository: https://github.com/ppibburr/mruby-javascriptcore.git - repooptions: + repooptions: - name: mruby-jpeg description: JPeg library author: Carson McDonald website: https://github.com/carsonmcdonald/mruby-jpeg protocol: git repository: https://github.com/carsonmcdonald/mruby-jpeg.git - repooptions: + repooptions: - name: mruby-json description: JavaScript Object Notation author: mattn website: https://github.com/mattn/mruby-json protocol: git repository: https://github.com/mattn/mruby-json.git - repooptions: + repooptions: - name: mruby-jvm description: Utility for invoking the JVM author: jkutner website: https://github.com/jkutner/mruby-jvm protocol: git repository: https://github.com/jkutner/mruby-jvm.git - repooptions: + repooptions: - name: mruby-jwt description: A mruby implementation of JSON Web Token draft 06 author: Naoki AINOYA website: https://github.com/prevs-io/mruby-jwt protocol: git repository: https://github.com/prevs-io/mruby-jwt.git - repooptions: + repooptions: - name: mruby-k2hash description: mruby binding of yahoojapan/k2hash author: Ryo Okubo website: https://github.com/syucream/mruby-k2hash protocol: git repository: https://github.com/syucream/mruby-k2hash.git - repooptions: + repooptions: - name: mruby-kmp description: KMP searching algorithm in mruby author: santazhang website: https://github.com/santazhang/mruby-kmp protocol: git repository: https://github.com/santazhang/mruby-kmp.git - repooptions: + 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: + repooptions: - name: mruby-leapmotion description: Providing wrapper classes for Leap Motion SDK. author: crimsonwoods website: https://github.com/crimsonwoods/mruby-leapmotion protocol: git repository: https://github.com/crimsonwoods/mruby-leapmotion.git - repooptions: + repooptions: - name: mruby-leveldb description: mruby LevelDB binding author: Takeshi Watanabe website: https://github.com/take-cheeze/mruby-leveldb protocol: git repository: https://github.com/take-cheeze/mruby-leveldb.git - repooptions: + repooptions: +- name: mruby-libdeflate + description: libdeflate for mruby + author: Hendrik Beskow + website: https://github.com/Asmod4n/mruby-libdeflate + protocol: git + repository: https://github.com/Asmod4n/mruby-libdeflate.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: + repooptions: - name: mruby-libqrng description: libQRNG interface author: cremno website: https://github.com/cremno/mruby-libqrng protocol: git repository: https://github.com/cremno/mruby-libqrng.git - repooptions: + repooptions: - name: mruby-libsodium description: mruby wrapper for libsodium. author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-libsodium protocol: git repository: https://github.com/Asmod4n/mruby-libsodium.git - repooptions: + repooptions: - name: mruby-limits description: Const collection of limits.h author: ksss website: https://github.com/ksss/mruby-limits protocol: git repository: https://github.com/ksss/mruby-limits.git - repooptions: + repooptions: - name: mruby-linenoise description: linenoise for mruby, a line editing library akin to readline author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-linenoise protocol: git repository: https://github.com/Asmod4n/mruby-linenoise.git - repooptions: + repooptions: - name: mruby-linux-namespace description: A mgem to utilize linux namespaces author: Russel Hunter Yukawa / Uchio Kondo website: https://github.com/haconiwa/mruby-linux-namespace protocol: git repository: https://github.com/haconiwa/mruby-linux-namespace.git - repooptions: + repooptions: - name: mruby-lmdb description: mruby wrapper for Lightning Memory-Mapped Database from Symas. author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-lmdb protocol: git repository: https://github.com/Asmod4n/mruby-lmdb.git - repooptions: + repooptions: - name: mruby-localmemcache description: localmemcache binding author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-localmemcache protocol: git repository: https://github.com/matsumotory/mruby-localmemcache.git - repooptions: + 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: + repooptions: - name: mruby-lruc description: Least Recently Used(LRU) cache using lruc author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-lruc protocol: git repository: https://github.com/matsumotory/mruby-lruc.git - repooptions: + repooptions: - name: mruby-lua description: Lua script engine author: Daisuke YAMAGUCHI website: https://github.com/dyama/mruby-lua protocol: git repository: https://github.com/dyama/mruby-lua.git - repooptions: + 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: + 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: + repooptions: - name: mruby-m2x description: Client library for AT&T’s M2X API (fork) author: AT&T M2X Team website: https://github.com/attsdk/m2x-mruby protocol: git repository: https://github.com/attsdk/m2x-mruby.git - repooptions: + repooptions: - name: mruby-markdown description: Markdown library author: Carson McDonald @@ -1051,7 +1128,7 @@ website: https://github.com/take-cheeze/mruby-marshal protocol: git repository: https://github.com/take-cheeze/mruby-marshal.git - repooptions: + repooptions: - name: mruby-marshal-c description: Marshal module for mruby written in C-language with full object-link & symbol link support @@ -1059,70 +1136,70 @@ website: https://github.com/LanzaSchneider/mruby-marshal-c protocol: git repository: https://github.com/LanzaSchneider/mruby-marshal-c.git - repooptions: + 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: + repooptions: - name: mruby-matrix description: Matrix and vector library author: listrophy website: https://github.com/listrophy/mruby-matrix protocol: git repository: https://github.com/listrophy/mruby-matrix.git - repooptions: + repooptions: - name: mruby-maxminddb description: mruby [GeoIP2 MaxMind DB](https://maxmind.github.io/MaxMind-DB/) reader author: Kenichi Mitsugi website: https://github.com/happysiro/mruby-maxminddb protocol: git repository: https://github.com/happysiro/mruby-maxminddb - repooptions: + repooptions: - name: mruby-md5 description: MD5 Hash Algorithm author: mattn website: https://github.com/mattn/mruby-md5 protocol: git repository: https://github.com/mattn/mruby-md5.git - repooptions: + repooptions: - name: mruby-mecab description: Japanese morphological analyzer author: mattn website: https://github.com/mattn/mruby-mecab protocol: git repository: https://github.com/mattn/mruby-mecab.git - repooptions: + repooptions: - name: mruby-memcached description: libmemcached bindings by mruby author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-memcached protocol: git repository: https://github.com/matsumotory/mruby-memcached.git - repooptions: + repooptions: - name: mruby-merb description: ERB-like mruby gem author: pbosetti website: https://github.com/pbosetti/mruby-merb protocol: git repository: https://github.com/pbosetti/mruby-merb.git - repooptions: + repooptions: - name: mruby-method description: A implementation of class Method and UnboundMethod for mruby author: ksss website: https://github.com/ksss/mruby-method protocol: git repository: https://github.com/ksss/mruby-method.git - repooptions: + repooptions: - name: mruby-minigame description: 2D Game Framework for rapid prototyping author: bggd website: https://github.com/bggd/mruby-minigame protocol: git repository: https://github.com/bggd/mruby-minigame.git - repooptions: + repooptions: - name: mruby-miniz description: Ruby interface for Miniz v1.15, a zlib-subset to deflate/inflate and zip/unzip without dir support @@ -1130,84 +1207,84 @@ website: https://github.com/scalone/mruby-miniz protocol: git repository: https://github.com/scalone/mruby-miniz.git - repooptions: + repooptions: - name: mruby-mod-mruby-ext description: Extended Apache class author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-mod-mruby-ext protocol: git repository: https://github.com/matsumotory/mruby-mod-mruby-ext.git - repooptions: + repooptions: - name: mruby-mrbgem-template description: Generate mrbgem template author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-mrbgem-template protocol: git repository: https://github.com/matsumotory/mruby-mrbgem-template.git - repooptions: + repooptions: - name: mruby-mrmagick description: ImageMagick binding for mruby. author: Junichi Kajiwara website: https://github.com/kjunichi/mruby-mrmagick protocol: git repository: https://github.com/kjunichi/mruby-mrmagick.git - repooptions: + repooptions: - name: mruby-msagent description: Microsoft Agent author: mattn website: https://github.com/mattn/mruby-msagent protocol: git repository: https://github.com/mattn/mruby-msagent.git - repooptions: + 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: + repooptions: - name: mruby-msgpack description: MessagePack for mruby. author: Jun Hiroe website: https://github.com/suzukaze/mruby-msgpack protocol: git repository: https://github.com/suzukaze/mruby-msgpack.git - repooptions: + repooptions: - name: mruby-mtest description: Minimum Test Framework author: Internet Initiative Japan., Inc. website: https://github.com/iij/mruby-mtest protocol: git repository: https://github.com/iij/mruby-mtest.git - repooptions: + repooptions: - name: mruby-murmurhash1 description: Murmurhash1 digest author: ksss website: https://github.com/ksss/mruby-murmurhash1 protocol: git repository: https://github.com/ksss/mruby-murmurhash1.git - repooptions: + repooptions: - name: mruby-murmurhash2 description: Murmurhash2 digest author: ksss website: https://github.com/ksss/mruby-murmurhash2 protocol: git repository: https://github.com/ksss/mruby-murmurhash2.git - repooptions: + repooptions: - name: mruby-mutex description: Mutex class author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-mutex protocol: git repository: https://github.com/matsumotory/mruby-mutex.git - repooptions: + repooptions: - name: mruby-mysql description: MySQL Database author: mattn website: https://github.com/mattn/mruby-mysql protocol: git repository: https://github.com/mattn/mruby-mysql.git - repooptions: + repooptions: - name: mruby-named-constants description: Allows dynamically defined constants of (Class|Module) to return the constant name when inspected @@ -1215,126 +1292,126 @@ website: https://github.com/ppibburr/mruby-named-constants protocol: git repository: https://github.com/ppibburr/mruby-named-constants.git - repooptions: + repooptions: - name: mruby-nanovg description: nanovg bindings author: Corey Powell website: https://github.com/IceDragon200/mruby-nanovg protocol: git repository: https://github.com/IceDragon200/mruby-nanovg - repooptions: + repooptions: - name: mruby-netlink description: libnetlink binding author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-netlink protocol: git repository: https://github.com/matsumotory/mruby-netlink.git - repooptions: + 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: + repooptions: - name: mruby-ngx-mruby-ext description: Nginx ext class author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-ngx-mruby-ext protocol: git repository: https://github.com/matsumotory/mruby-ngx-mruby-ext.git - repooptions: + repooptions: - name: mruby-oauth description: OAuth class author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-oauth protocol: git repository: https://github.com/matsumotory/mruby-oauth.git - repooptions: + repooptions: - name: mruby-odbc description: unixODBC bindings author: qtakamitsu website: https://github.com/tk3/mruby-odbc protocol: git repository: https://github.com/tk3/mruby-odbc.git - repooptions: + repooptions: - name: mruby-onig-regexp description: Onigumo Regular Expression author: mattn website: https://github.com/mattn/mruby-onig-regexp protocol: git repository: https://github.com/mattn/mruby-onig-regexp.git - repooptions: + repooptions: - name: mruby-open3 description: Popen, but with stderr, too author: Takashi Kokubun website: https://github.com/k0kubun/mruby-open3 protocol: git repository: https://github.com/k0kubun/mruby-open3.git - repooptions: + repooptions: - name: mruby-optparse description: OptionParser ported to mruby author: fastly website: https://github.com/fastly/mruby-optparse protocol: git repository: https://github.com/fastly/mruby-optparse.git - repooptions: + repooptions: - name: mruby-opvault description: decrypt OPVault author: Seiei Miyagi website: https://github.com/hanachin/mruby-opvault protocol: git repository: https://github.com/hanachin/mruby-opvault.git - repooptions: + repooptions: - name: mruby-os description: Determine system and binary capabilities author: katzer website: https://github.com/katzer/mruby-os protocol: git repository: https://github.com/katzer/mruby-os.git - repooptions: + repooptions: - name: mruby-ostruct description: OpenStruct binding in mruby author: ksss website: https://github.com/ksss/mruby-ostruct protocol: git repository: https://github.com/ksss/mruby-ostruct.git - repooptions: + 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: + repooptions: - name: mruby-otpauth description: One time password class author: qtakamitsu website: https://github.com/tk3/mruby-otpauth protocol: git repository: https://github.com/tk3/mruby-otpauth.git - repooptions: + repooptions: - name: mruby-oui description: Duangle OUI bindings. author: Corey Powell website: https://github.com/IceDragon200/mruby-oui protocol: git repository: https://github.com/IceDragon200/mruby-oui - repooptions: + repooptions: - name: mruby-passwdqc description: A Password quality checker author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-passwdqc protocol: git repository: https://github.com/Asmod4n/mruby-passwdqc - repooptions: + repooptions: - name: mruby-pcre-regexp description: PCRE - Perl Compatible Regular Expressions author: mattn website: https://github.com/mattn/mruby-pcre-regexp protocol: git repository: https://github.com/mattn/mruby-pcre-regexp.git - repooptions: + repooptions: - name: mruby-perlin-noise description: Perlin noise generator for mruby author: @@ -1344,63 +1421,63 @@ website: https://github.com/dabroz/mruby-perlin-noise protocol: git repository: https://github.com/dabroz/mruby-perlin-noise.git - repooptions: + repooptions: - name: mruby-phr description: mruby bindings for picohttpparser author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-phr protocol: git repository: https://github.com/Asmod4n/mruby-phr.git - repooptions: + repooptions: - name: mruby-pid description: A PID algorithm library based on Temper author: Andrew Nordman website: https://github.com/cadwallion/mruby-pid protocol: git repository: https://github.com/cadwallion/mruby-pid.git - repooptions: + repooptions: - name: mruby-ping description: ping hosts using ICMP or ARP packets. author: Julien Ammous website: https://github.com/schmurfy/mruby-ping protocol: git repository: https://github.com/schmurfy/mruby-ping - repooptions: + repooptions: - name: mruby-pjson description: JSON Parser written in pure mruby author: mattn website: https://github.com/mattn/mruby-pjson protocol: git repository: https://github.com/mattn/mruby-pjson.git - repooptions: + repooptions: - name: mruby-pkcs5 description: Provide PKCS5 functionality with mruby-digest author: Seiei Miyagi website: https://github.com/hanachin/mruby-pkcs5 protocol: git repository: https://github.com/hanachin/mruby-pkcs5.git - repooptions: + repooptions: - name: mruby-plplot description: PLPlot mruby interface author: Paolo Bosetti website: https://github.com/pbosetti/mruby-plplot protocol: git repository: https://github.com/pbosetti/mruby-plplot.git - repooptions: + repooptions: - name: mruby-polarssl description: SSL and cryptography functionality from PolarSSL in your mruby programs author: luisbebop website: https://github.com/luisbebop/mruby-polarssl protocol: git repository: https://github.com/luisbebop/mruby-polarssl.git - repooptions: + 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: + repooptions: - name: mruby-pong description: mruby-pong is a simple library for quickly creating web applications in mruby @@ -1408,49 +1485,49 @@ website: https://nsheremet.github.io/mruby-pong protocol: git repository: https://github.com/nsheremet/mruby-pong.git - repooptions: + repooptions: - name: mruby-posix-regexp description: mruby's Regexp class implementation using libc's posix-based regexp author: Uchio Kondo website: https://github.com/udzura/mruby-posix-regexp protocol: git repository: https://github.com/udzura/mruby-posix-regexp.git - repooptions: + repooptions: - name: mruby-posix_ipc description: A mgem for access to POSIX IPC API author: Uchio Kondo website: https://github.com/udzura/mruby-posix_ipc protocol: git repository: https://github.com/udzura/mruby-posix_ipc.git - repooptions: + 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: + 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: + repooptions: - name: mruby-process description: Process interface (waitpid, pid, kill, fork, ppid) author: Internet Initiative Japan., Inc. website: https://github.com/iij/mruby-process protocol: git repository: https://github.com/iij/mruby-process.git - repooptions: + repooptions: - name: mruby-process2 description: Implementation of the Ruby 2.4.1 Core Library Process for mruby. author: katzer website: https://github.com/katzer/mruby-process protocol: git repository: https://github.com/katzer/mruby-process.git - repooptions: + 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. @@ -1458,28 +1535,28 @@ website: https://github.com/hfm/mruby-publicsuffix protocol: git repository: https://github.com/hfm/mruby-publicsuffix.git - repooptions: + repooptions: - name: mruby-pure-regexp description: Pure mruby Regexp (third-party fork) author: h2so5 website: https://github.com/WindProphet/mruby-pure-regexp protocol: git repository: https://github.com/WindProphet/mruby-pure-regexp.git - repooptions: + 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: + 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: + repooptions: - name: mruby-qrcode description: Ruby interface to QR Code C Library by Ryusuke SEKIYAMA author: @@ -1488,105 +1565,105 @@ website: https://github.com/scalone/mruby-qrcode protocol: git repository: https://github.com/scalone/mruby-qrcode.git - repooptions: + 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: + repooptions: - name: mruby-rake description: rake for mruby author: ksss website: https://github.com/ksss/mruby-rake protocol: git repository: https://github.com/ksss/mruby-rake.git - repooptions: + repooptions: - name: mruby-rakie description: An event driven network toolkit with Fiber author: Jakit Liang website: https://github.com/jakitliang/mruby-rakie protocol: git repository: https://github.com/jakitliang/mruby-rakie.git - repooptions: + repooptions: - name: mruby-random description: random class with Mersenne Twister author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-random protocol: git repository: https://github.com/matsumotory/mruby-random.git - repooptions: + repooptions: - name: mruby-raspberry description: Wrapper for WiringPi library for accessing Raspberry Pi hardware. author: Paolo Bosetti, University of Trento website: https://github.com/UniTN-Mechatronics/mruby-raspberry protocol: git repository: https://github.com/UniTN-Mechatronics/mruby-raspberry.git - repooptions: + repooptions: - name: mruby-rcon description: resource management mrbgem using cgroup author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-rcon protocol: git repository: https://github.com/matsumotory/mruby-rcon.git - repooptions: + repooptions: - name: mruby-redis description: redis client using hiredis author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-redis protocol: git repository: https://github.com/matsumotory/mruby-redis.git - repooptions: + repooptions: - name: mruby-redis-ae description: mruby wrapper for the Redis Ae event loop. author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-redis-ae protocol: git repository: https://github.com/Asmod4n/mruby-redis-ae.git - repooptions: + 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: + repooptions: - name: mruby-regexp-pcre description: regular expression module utilizing PCRE library author: iij website: https://github.com/iij/mruby-regexp-pcre protocol: git repository: https://github.com/iij/mruby-regexp-pcre.git - repooptions: + 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: + repooptions: - name: mruby-require description: require implementation author: mattn website: https://github.com/mattn/mruby-require protocol: git repository: https://github.com/mattn/mruby-require.git - repooptions: + repooptions: - name: mruby-research description: research for mruby author: ksss website: https://github.com/ksss/mruby-research protocol: git repository: https://github.com/ksss/mruby-research.git - repooptions: + 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: + repooptions: - name: mruby-ripemd description: Ruby interface to C RIPEMD-160 hash-function by Antoon Bosselaers author: @@ -1595,98 +1672,98 @@ website: https://github.com/scalone/mruby-ripemd protocol: git repository: https://github.com/scalone/mruby-ripemd.git - repooptions: + repooptions: - name: mruby-romajify description: Japanese romanization library for mruby author: emsk website: https://github.com/emsk/mruby-romajify protocol: git repository: https://github.com/emsk/mruby-romajify.git - repooptions: + repooptions: - name: mruby-rubyffi-compat description: rubyffi compatibility layer on top of mruby-cfunc. author: Julien Ammous, ppibburr website: https://github.com/schmurfy/mruby-rubyffi-compat protocol: git repository: https://github.com/schmurfy/mruby-rubyffi-compat.git - repooptions: + 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: + repooptions: - name: mruby-secure-compare description: Secure String comparisons for mruby author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-secure-compare protocol: git repository: https://github.com/Asmod4n/mruby-secure-compare.git - repooptions: + repooptions: - name: mruby-secure-random description: SecureRandom class author: monochromegane website: https://github.com/monochromegane/mruby-secure-random protocol: git repository: https://github.com/monochromegane/mruby-secure-random.git - repooptions: + repooptions: - name: mruby-serialport description: Serialport support author: Monami-ya LLC, Japan website: https://github.com/monami-ya-mrb/mruby-serialport/ protocol: git repository: https://github.com/monami-ya-mrb/mruby-serialport.git - repooptions: + repooptions: - name: mruby-set description: Set class author: yui-knk website: https://github.com/yui-knk/mruby-set protocol: git repository: https://github.com/yui-knk/mruby-set.git - repooptions: + 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: + repooptions: - name: mruby-sftp-glob description: SFTP::Dir#glob extension for mruby-sftp author: katzer website: https://github.com/katzer/mruby-sftp-glob protocol: git repository: https://github.com/katzer/mruby-sftp-glob.git - repooptions: + repooptions: - name: mruby-sha1 description: SHA1 Hash Algorithm author: mattn website: https://github.com/mattn/mruby-sha1 protocol: git repository: https://github.com/mattn/mruby-sha1.git - repooptions: + repooptions: - name: mruby-sha2 description: SHA2 Hash Algorithm (third-party fork) author: h2so5 website: https://github.com/scalone/mruby-sha2 protocol: git repository: https://github.com/scalone/mruby-sha2.git - repooptions: + 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: + 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: + repooptions: - name: mruby-shellwords description: Manipulates strings like the UNIX Bourne shell author: @@ -1696,105 +1773,105 @@ website: https://github.com/k0kubun/mruby-shellwords protocol: git repository: https://github.com/k0kubun/mruby-shellwords.git - repooptions: + repooptions: - name: mruby-sidekiq-client description: SidekiqClient class author: monochromegane website: https://github.com/monochromegane/mruby-sidekiq-client protocol: git repository: https://github.com/monochromegane/mruby-sidekiq-client.git - repooptions: + repooptions: - name: mruby-signal description: Signal trap and callback in mruby author: ksss website: https://github.com/ksss/mruby-signal protocol: git repository: https://github.com/ksss/mruby-signal.git - repooptions: + repooptions: - name: mruby-signal-thread description: Multi thread Signal trap and callback in mruby author: pyama86 website: https://github.com/pyama86/mruby-signal-thread protocol: git repository: https://github.com/pyama86/mruby-signal-thread.git - repooptions: + repooptions: - name: mruby-simple-random description: Kernel#rand and Kernel#srand author: Internet Initiative Japan., Inc. website: https://github.com/iij/mruby-simple-random protocol: git repository: https://github.com/iij/mruby-simple-random.git - repooptions: + repooptions: - name: mruby-simplehttp description: Simple http client author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-simplehttp protocol: git repository: https://github.com/matsumotory/mruby-simplehttp.git - repooptions: + repooptions: - name: mruby-simplehttp-socket description: Simple http client using mruby-socket author: Kentaro Yoshida, Internet Initiative Japan Inc. website: https://github.com/y-ken/mruby-simplehttp-socket protocol: git repository: https://github.com/y-ken/mruby-simplehttp-socket.git - repooptions: + repooptions: - name: mruby-simplehttpserver description: SimpleHttpServer class author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-simplehttpserver protocol: git repository: https://github.com/matsumotory/mruby-simplehttpserver.git - repooptions: + repooptions: - name: mruby-simplemsgpack description: A simple mruby wrapper for msgpack author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-simplemsgpack protocol: git repository: https://github.com/Asmod4n/mruby-simplemsgpack.git - repooptions: + repooptions: - name: mruby-simpletest description: SimpleTest class author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-simpletest protocol: git repository: https://github.com/matsumotory/mruby-simpletest.git - repooptions: + repooptions: - name: mruby-sinatic description: Sinatra like Web Framework author: mattn website: https://github.com/mattn/mruby-sinatic protocol: git repository: https://github.com/mattn/mruby-sinatic.git - repooptions: + repooptions: - name: mruby-singleton description: Singleton module in mruby author: ksss website: https://github.com/ksss/mruby-singleton protocol: git repository: https://github.com/ksss/mruby-singleton.git - repooptions: + repooptions: - name: mruby-siphash description: Message digest by SipHash author: ksss website: https://github.com/ksss/mruby-siphash protocol: git repository: https://github.com/ksss/mruby-siphash.git - repooptions: + repooptions: - name: mruby-smallhttp description: Small http-client gem for mruby author: Nazarii Sheremet website: https://github.com/nsheremet/mruby-smallhttp protocol: git repository: https://github.com/nsheremet/mruby-smallhttp.git - repooptions: + repooptions: - name: mruby-spdy description: SPDY module for mruby author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-spdy protocol: git repository: https://github.com/matsumotory/mruby-spdy.git - repooptions: + repooptions: - name: mruby-specinfra description: Common layer for serverspec and itamae author: @@ -1803,7 +1880,7 @@ website: https://github.com/k0kubun/mruby-specinfra protocol: git repository: https://github.com/k0kubun/mruby-specinfra.git - repooptions: + repooptions: - name: mruby-sqlite description: "(Another) SQLite3 mrbgem, aiming for compatibility with MRI's sqlite3 gem." @@ -1811,217 +1888,239 @@ website: https://github.com/jbreeden/mruby-sqlite protocol: git repository: https://github.com/jbreeden/mruby-sqlite.git - repooptions: + repooptions: - name: mruby-sqlite3 description: SQLite3 Database author: mattn website: https://github.com/mattn/mruby-sqlite3 protocol: git repository: https://github.com/mattn/mruby-sqlite3.git - repooptions: + 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 - website: https://github.com/ascaridol/mruby-statemachine - protocol: git - repository: https://github.com/ascaridol/mruby-statemachine.git - repooptions: + repooptions: - name: mruby-string-crypt description: implementation of String#crypt author: mattn website: https://github.com/mattn/mruby-string-crypt protocol: git repository: https://github.com/mattn/mruby-string-crypt.git - repooptions: + repooptions: - name: mruby-string-ext-latin9 description: Conversion from iso-8859-15 (Latin9) to UTF-8 author: katzer website: https://github.com/katzer/mruby-string-ext-latin9 protocol: git repository: https://github.com/katzer/mruby-string-ext-latin9.git - repooptions: + repooptions: - name: mruby-string-is-utf8 description: checks if a string is valid utf8 author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-string-is-utf8 protocol: git repository: https://github.com/Asmod4n/mruby-string-is-utf8.git - repooptions: + repooptions: - name: mruby-string-xor description: XOR two strings author: Seiei Miyagi website: https://github.com/hanachin/mruby-string-xor protocol: git repository: https://github.com/hanachin/mruby-string-xor.git - repooptions: + repooptions: - name: mruby-stringio description: StringIO class author: ksss website: https://github.com/ksss/mruby-stringio protocol: git repository: https://github.com/ksss/mruby-stringio.git - repooptions: + 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: + 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: + repooptions: - name: mruby-syslog description: Syslog binding author: iij website: https://github.com/iij/mruby-syslog protocol: git repository: https://github.com/iij/mruby-syslog.git - repooptions: + repooptions: - name: mruby-sysrandom description: Secure random number generation for mruby author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-sysrandom protocol: git repository: https://github.com/Asmod4n/mruby-sysrandom.git - repooptions: + 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: + repooptions: - name: mruby-tempfile description: Tempfile class author: iij website: https://github.com/iij/mruby-tempfile protocol: git repository: https://github.com/iij/mruby-tempfile.git - repooptions: + repooptions: +- name: mruby-termbox2 + description: Low-level bindings to Termbox2 + author: Paweł Świątkowski + website: https://github.com/katafrakt/mruby-termbox2 + protocol: git + repository: https://github.com/katafrakt/mruby-termbox2.git + repooptions: - name: mruby-terminal-table description: A fast and simple, yet feature rich ASCII table generator author: katzer website: https://github.com/katzer/mruby-terminal-table protocol: git repository: https://github.com/katzer/mruby-terminal-table.git - repooptions: + repooptions: - name: mruby-thread description: Thread Library author: mattn website: https://github.com/mattn/mruby-thread protocol: git repository: https://github.com/mattn/mruby-thread.git - repooptions: + repooptions: +- name: mruby-time-httpdate + description: mruby-time-httpdate provides a method to format Time objects as HTTP + date strings. + author: Hendrik Beskow + website: https://github.com/Asmod4n/mruby-time-httpdate + protocol: git + repository: https://github.com/Asmod4n/mruby-time-httpdate.git + repooptions: - name: mruby-time-strftime description: Time#strftime for mruby author: monochromegane website: https://github.com/monochromegane/mruby-time-strftime protocol: git repository: https://github.com/monochromegane/mruby-time-strftime.git - repooptions: + repooptions: - name: mruby-timer-thread description: Timer Thread class author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-timer-thread protocol: git repository: https://github.com/matsumotory/mruby-timer-thread.git - repooptions: + 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: + 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: + repooptions: - name: mruby-tinymt description: random module using TinyMT author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-tinymt protocol: git repository: https://github.com/matsumotory/mruby-tinymt.git - repooptions: + repooptions: - name: mruby-tinyxml2 description: mruby bindings for TinyXML-2 (third-party fork) author: h2so5 website: https://github.com/scalone/mruby-tinyxml2 protocol: git repository: https://github.com/scalone/mruby-tinyxml2.git - repooptions: + repooptions: - name: mruby-tls description: mruby bindings for libtls from libressl author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-tls protocol: git repository: https://github.com/Asmod4n/mruby-tls.git - repooptions: + repooptions: +- name: mruby-toml + description: a TOML mgem for mruby + author: Hendrik Beskow + website: https://github.com/Asmod4n/mruby-toml + protocol: git + repository: https://github.com/Asmod4n/mruby-toml.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: + repooptions: - name: mruby-uchardet description: mruby binding of Mozilla's universal charset detector. author: Takeshi Watanabe website: https://github.com/take-cheeze/mruby-uchardet/ protocol: git repository: https://github.com/take-cheeze/mruby-uchardet.git - repooptions: + repooptions: - name: mruby-uname description: Uname class author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-uname protocol: git repository: https://github.com/matsumotory/mruby-uname.git - repooptions: + repooptions: - name: mruby-unbound description: mruby client for Unbound (libunbound) author: Kouichi Nakanishi website: https://github.com/keizo042/mruby-unbound protocol: git repository: https://github.com/keizo042/mruby-unbound.git - repooptions: + repooptions: - name: mruby-unicode-display_width description: Monospace Unicode character width author: katzer website: https://github.com/katzer/mruby-unicode-display_width protocol: git repository: https://github.com/katzer/mruby-unicode-display_width.git - repooptions: + repooptions: - name: mruby-updategems description: Rake task to update GEMs author: mattn website: https://github.com/mattn/mruby-updategems protocol: git repository: https://github.com/mattn/mruby-updategems.git - repooptions: + repooptions: - name: mruby-uri-parser description: URI parser for mruby author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-uri-parser protocol: git repository: https://github.com/Asmod4n/mruby-uri-parser.git - repooptions: + repooptions: +- name: mruby-uriparser + description: URI parser for mruby. + author: gemmaro + website: https://github.com/gemmaro/mruby-uriparser + protocol: git + repository: https://github.com/gemmaro/mruby-uriparser + repooptions: - name: mruby-userdata description: When shared mrb_state, you can share userdata objects between one Ruby code and the other. @@ -2029,137 +2128,137 @@ website: https://github.com/matsumotory/mruby-userdata protocol: git repository: https://github.com/matsumotory/mruby-userdata.git - repooptions: + repooptions: - name: mruby-uv description: libuv interface author: mattn website: https://github.com/mattn/mruby-uv protocol: git repository: https://github.com/mattn/mruby-uv.git - repooptions: + repooptions: - name: mruby-v8 description: V8 JavaScript Engine author: mattn website: https://github.com/mattn/mruby-v8 protocol: git repository: https://github.com/mattn/mruby-v8.git - repooptions: + repooptions: - name: mruby-vedis description: vedis binding author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-vedis protocol: git repository: https://github.com/matsumotory/mruby-vedis.git - repooptions: + repooptions: - name: mruby-virtualing description: creating jail environment, limiting resource and separating filesystem author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-virtualing protocol: git repository: https://github.com/matsumotory/mruby-virtualing.git - repooptions: + 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: + repooptions: - name: mruby-webkit-1 description: Bindings to WebKitGTK-1.x. uses mruby-girffi author: ppibburr website: https://github.com/ppibburr/mruby-webkit-1 protocol: git repository: https://github.com/ppibburr/mruby-webkit-1.git - repooptions: + repooptions: - name: mruby-webkit-3 description: Bindings to WebKitGTK-3.x. uses mruby-girffi author: ppibburr website: https://github.com/ppibburr/mruby-webkit-3 protocol: git repository: https://github.com/ppibburr/mruby-webkit-3.git - repooptions: + repooptions: - name: mruby-win32ole description: A port of CRuby's WIN32OLE to mruby. author: Takashi Sawanaka website: https://github.com/sdottaka/mruby-win32ole protocol: git repository: https://github.com/sdottaka/mruby-win32ole.git - repooptions: + repooptions: - name: mruby-winapp description: Create non-console application for windows author: mattn website: https://github.com/mattn/mruby-winapp protocol: git repository: https://github.com/mattn/mruby-winapp.git - repooptions: + repooptions: - name: mruby-WiringPi description: Binding for Wiring function of the Raspberry Pi author: Akira Yumiyama website: https://github.com/akiray03/mruby-WiringPi protocol: git repository: https://github.com/akiray03/mruby-WiringPi.git - repooptions: + repooptions: - name: mruby-wslay description: mruby wrapper for wslay author: Hendrik Beskow website: https://github.com/Asmod4n/mruby-wslay protocol: git repository: https://github.com/Asmod4n/mruby-wslay - repooptions: + repooptions: - name: mruby-yaml description: YAML parser and emitter author: Andrew Belt website: https://github.com/mrbgems/mruby-yaml protocol: git repository: https://github.com/mrbgems/mruby-yaml.git - repooptions: + repooptions: - name: mruby-yeah description: mruby on tiny rails author: katzer website: https://github.com/katzer/mruby-yeah protocol: git repository: https://github.com/katzer/mruby-yeah.git - repooptions: + repooptions: - name: mruby-zabbix description: zabbix 2.0 API client class author: MATSUMOTO Ryosuke website: https://github.com/matsumotory/mruby-zabbix protocol: git repository: https://github.com/matsumotory/mruby-zabbix.git - repooptions: + 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: + repooptions: - name: mruby-zlib description: ZLib bindings for mruby author: Jared Breeden website: https://github.com/jbreeden/mruby-zlib protocol: git repository: https://github.com/jbreeden/mruby-zlib.git - repooptions: + repooptions: - name: mruby-zmq description: mruby bindings for libzmq4 author: Hendrik Beskow website: https://github.com/zeromq/mruby-zmq protocol: git repository: https://github.com/zeromq/mruby-zmq.git - repooptions: + 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 + repooptions: +- name: typedargs + description: A tiny operator‑typed CLI language for structured data. author: Hendrik Beskow - website: https://github.com/Asmod4n/mruby-zyre + website: https://github.com/Asmod4n/typedargs protocol: git - repository: https://github.com/Asmod4n/mruby-zyre.git - repooptions: + repository: https://github.com/Asmod4n/typedargs.git + repooptions: diff --git a/docs/api/.nojekyll b/docs/api/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/docs/api/Addrinfo.html b/docs/api/Addrinfo.html deleted file mode 100644 index ddd5386..0000000 --- a/docs/api/Addrinfo.html +++ /dev/null @@ -1,1840 +0,0 @@ - - - - - - - Class: Addrinfo - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Addrinfo - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-socket/src/socket.c,
    - mrbgems/mruby-socket/mrblib/socket.rb
    -
    -
    - -
    - - - - - -

    Instance Attribute Summary collapse

    -
      - -
    • - - - #canonname ⇒ Object - - - - - - - - - readonly - - - - - - - - - -

      def bind.

      -
      - -
    • - - -
    • - - - #protocol ⇒ Object - - - - - - - - - readonly - - - - - - - - - -

      Returns the value of attribute protocol.

      -
      - -
    • - - -
    • - - - #socktype ⇒ Object - - - - - - - - - readonly - - - - - - - - - -

      Returns the value of attribute socktype.

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

    - Class Method Summary - collapse -

    - - - -

    - Instance Method Summary - collapse -

    - - - - -
    -

    Constructor Details

    - -
    -

    - - #initialize(sockaddr, family = Socket::PF_UNSPEC, socktype = 0, protocol = 0) ⇒ Addrinfo - - - - - -

    -
    -

    Returns a new instance of Addrinfo

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 2
    -
    -def initialize(sockaddr, family=Socket::PF_UNSPEC, socktype=0, protocol=0)
    -  @hostname = nil
    -  if sockaddr.is_a? Array
    -    sary = sockaddr
    -    if sary[0] == 'AF_INET' || sary[0] == 'AF_INET6'
    -      @sockaddr = Socket.sockaddr_in(sary[1], sary[3])
    -      @hostname = sary[2]
    -    elsif sary[0] == 'AF_UNIX'
    -      @sockaddr = Socket.sockaddr_un(sary[1])
    -    end
    -  else
    -    @sockaddr = sockaddr.dup
    -  end
    -  if family == Socket::PF_UNSPEC or family == nil
    -    @family = Socket._sockaddr_family(@sockaddr)
    -  else
    -    @family = family
    -  end
    -  @socktype = socktype
    -  @protocol = protocol
    -  @canonname = nil
    -end
    -
    -
    - -
    - -
    -

    Instance Attribute Details

    - - - -
    -

    - - #canonnameObject (readonly) - - - - - -

    -
    -

    def bind

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -53
    -54
    -55
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 53
    -
    -def canonname
    -  @canonname
    -end
    -
    -
    - - - -
    -

    - - #protocolObject (readonly) - - - - - -

    -
    -

    Returns the value of attribute protocol

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -139
    -140
    -141
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 139
    -
    -def protocol
    -  @protocol
    -end
    -
    -
    - - - -
    -

    - - #socktypeObject (readonly) - - - - - -

    -
    -

    Returns the value of attribute socktype

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -140
    -141
    -142
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 140
    -
    -def socktype
    -  @socktype
    -end
    -
    -
    - -
    - - -
    -

    Class Method Details

    - - -
    -

    - - .foreach(nodename, service, family = nil, socktype = nil, protocol = nil, flags = 0, &block) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -25
    -26
    -27
    -28
    -29
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 25
    -
    -def self.foreach(nodename, service, family=nil, socktype=nil, protocol=nil, flags=0, &block)
    -  a = self.getaddrinfo(nodename, service, family, socktype, protocol, flags)
    -  a.each { |ai| block.call(ai) }
    -  a
    -end
    -
    -
    - -
    -

    - - .ip(host) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -31
    -32
    -33
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 31
    -
    -def self.ip(host)
    -  Addrinfo.new(Socket.sockaddr_in(0, host))
    -end
    -
    -
    - -
    -

    - - .tcp(host, port) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -35
    -36
    -37
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 35
    -
    -def self.tcp(host, port)
    -  Addrinfo.getaddrinfo(host, port, nil, Socket::SOCK_STREAM, Socket::IPPROTO_TCP)[0]
    -end
    -
    -
    - -
    -

    - - .udp(host, port) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -39
    -40
    -41
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 39
    -
    -def self.udp(host, port)
    -  Addrinfo.getaddrinfo(host, port, nil, Socket::SOCK_DGRAM, Socket::IPPROTO_UDP)[0]
    -end
    -
    -
    - -
    -

    - - .unix(path, socktype = Socket::SOCK_STREAM) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -43
    -44
    -45
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 43
    -
    -def self.unix(path, socktype=Socket::SOCK_STREAM)
    -  Addrinfo.new(Socket.sockaddr_un(path), Socket::AF_UNIX, socktype)
    -end
    -
    -
    - -
    - -
    -

    Instance Method Details

    - - -
    -

    - - #_to_arrayObject - - - - - -

    - - - - -
    -
    -
    -
    -142
    -143
    -144
    -145
    -146
    -147
    -148
    -149
    -150
    -151
    -152
    -153
    -154
    -155
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 142
    -
    -def _to_array
    -  case @family
    -  when Socket::AF_INET
    -    s = "AF_INET"
    -  when Socket::AF_INET6
    -    s = "AF_INET6"
    -  when Socket::AF_UNIX
    -    s = "AF_UNIX"
    -  else
    -    s = "(unknown AF)"
    -  end
    -  addr, port = self.getnameinfo(Socket::NI_NUMERICHOST|Socket::NI_NUMERICSERV)
    -  [ s, port.to_i, addr, addr ]
    -end
    -
    -
    - -
    -

    - - #afamilyObject - - - - - -

    - - - - -
    -
    -
    -
    -47
    -48
    -49
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 47
    -
    -def afamily
    -  @family
    -end
    -
    -
    - -
    -

    - - #getnameinfoObject - - - - - -

    - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 191
    -
    -static mrb_value
    -mrb_addrinfo_getnameinfo(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int flags;
    -  mrb_value ary, host, sastr, serv;
    -  int error;
    -
    -  flags = 0;
    -  mrb_get_args(mrb, "|i", &flags);
    -  host = mrb_str_buf_new(mrb, NI_MAXHOST);
    -  serv = mrb_str_buf_new(mrb, NI_MAXSERV);
    -
    -  sastr = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@sockaddr"));
    -  if (!mrb_string_p(sastr)) {
    -    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) {
    -    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)));
    -  mrb_ary_push(mrb, ary, host);
    -  mrb_str_resize(mrb, serv, strlen(RSTRING_PTR(serv)));
    -  mrb_ary_push(mrb, ary, serv);
    -  return ary;
    -}
    -
    -
    - -
    -

    - - #inspectObject - - - - - -

    -
    -

    def family_addrinfo(host, port=nil) -def getnameinfo(flags=0) - Socket.getnameinfo -end

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -64
    -65
    -66
    -67
    -68
    -69
    -70
    -71
    -72
    -73
    -74
    -75
    -76
    -77
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 64
    -
    -def inspect
    -  if ipv4? or ipv6?
    -    if @protocol == Socket::IPPROTO_TCP or (@socktype == Socket::SOCK_STREAM and @protocol == 0)
    -      proto = 'TCP'
    -    elsif @protocol == Socket::IPPROTO_UDP or (@socktype == Socket::SOCK_DGRAM and @protocol == 0)
    -      proto = 'UDP'
    -    else
    -      proto = '???'
    -    end
    -    "#<Addrinfo: #{inspect_sockaddr} #{proto}>"
    -  else
    -    "#<Addrinfo: #{self.unix_path} SOCK_STREAM>"
    -  end
    -end
    -
    -
    - -
    -

    - - #inspect_sockaddrObject - - - - - -

    - - - - -
    -
    -
    -
    -79
    -80
    -81
    -82
    -83
    -84
    -85
    -86
    -87
    -88
    -89
    -90
    -91
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 79
    -
    -def inspect_sockaddr
    -  if ipv4?
    -    a, p = ip_unpack
    -    "#{a}:#{p}"
    -  elsif ipv6?
    -    a, p = ip_unpack
    -    "[#{a}]:#{p}"
    -  elsif unix?
    -    unix_path
    -  else
    -    '???'
    -  end
    -end
    -
    -
    - -
    -

    - - #ip?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -93
    -94
    -95
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 93
    -
    -def ip?
    -  ipv4? or ipv6?
    -end
    -
    -
    - -
    -

    - - #ip_addressObject - - - - - -

    - - - - -
    -
    -
    -
    -97
    -98
    -99
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 97
    -
    -def ip_address
    -  ip_unpack[0]
    -end
    -
    -
    - -
    -

    - - #ip_portObject - - - - - -

    - - - - -
    -
    -
    -
    -101
    -102
    -103
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 101
    -
    -def ip_port
    -  ip_unpack[1]
    -end
    -
    -
    - -
    -

    - - #ip_unpackObject - - - - - -

    - - - - -
    -
    -
    -
    -105
    -106
    -107
    -108
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 105
    -
    -def ip_unpack
    -  h, p = getnameinfo(Socket::NI_NUMERICHOST|Socket::NI_NUMERICSERV)
    -  [ h, p.to_i ]
    -end
    -
    -
    - -
    -

    - - #ipv4?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -110
    -111
    -112
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 110
    -
    -def ipv4?
    -  @family == Socket::AF_INET
    -end
    -
    -
    - -
    -

    - - #ipv6?Boolean - - - - - -

    -
    -

    def ipv4_loopback? -def ipv4_multicast? -def ipv4_private?

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -118
    -119
    -120
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 118
    -
    -def ipv6?
    -  @family == Socket::AF_INET6
    -end
    -
    -
    - -
    -

    - - #pfamilyObject - - - - - -

    -
    -

    def ipv6_loopback? -def ipv6_mc_global? -def ipv6_mc_linklocal? -def ipv6_mc_nodelocal? -def ipv6_mc_orilocal? -def ipv6_mc_sitelocal? -def ipv6_multicast? -def ipv6_to_ipv4 -def ipv6_unspecified -def ipv6_v4compat? -def ipv6_v4mapped? -def listen(backlog=5)

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -135
    -136
    -137
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 135
    -
    -def pfamily
    -  @family
    -end
    -
    -
    - -
    -

    - - #to_sockaddrObject - - - - Also known as: - to_s - - - - -

    - - - - -
    -
    -
    -
    -157
    -158
    -159
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 157
    -
    -def to_sockaddr
    -  @sockaddr
    -end
    -
    -
    - -
    -

    - - #unix?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -163
    -164
    -165
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 163
    -
    -def unix?
    -  @family == Socket::AF_UNIX
    -end
    -
    -
    - -
    -

    - - #unix_pathObject - - - - - -

    - - - - -
    -
    -
    -
    -220
    -221
    -222
    -223
    -224
    -225
    -226
    -227
    -228
    -229
    -230
    -231
    -232
    -233
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 220
    -
    -static mrb_value
    -mrb_addrinfo_unix_path(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value sastr;
    -
    -  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");
    -  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);
    -  }
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/ArgumentError.html b/docs/api/ArgumentError.html deleted file mode 100644 index 71f3c7f..0000000 --- a/docs/api/ArgumentError.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - Exception: ArgumentError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: ArgumentError - - - -

    -
    - -
    -
    Inherits:
    -
    - StandardError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/10error.rb
    -
    - -
    - -

    Overview

    -
    -

    ISO 15.2.24

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

    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/Array.html b/docs/api/Array.html deleted file mode 100644 index 0364f4f..0000000 --- a/docs/api/Array.html +++ /dev/null @@ -1,8450 +0,0 @@ - - - - - - - Class: Array - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Array - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - -
    -
    Includes:
    -
    Enumerable
    -
    - - - - - - -
    -
    Defined in:
    -
    mrblib/array.rb,
    - src/array.c,
    mrblib/array.rb,
    mrbgems/mruby-array-ext/mrblib/array.rb
    -
    -
    - -
    - -

    Overview

    -
    -

    Array is enumerable

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

    Constant Summary

    - -

    Constants included - from Enumerable

    -

    Enumerable::NONE

    - - - - - - -

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #&(elem) ⇒ Object - - - - - - - - - - - - - -

      call-seq: ary & other_ary -> new_ary.

      -
      - -
    • - - -
    • - - - #* ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.2.

      -
      - -
    • - - -
    • - - - #+ ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.1.

      -
      - -
    • - - -
    • - - - #-(elem) ⇒ Object - - - - - - - - - - - - - -

      call-seq: ary - other_ary -> new_ary.

      -
      - -
    • - - -
    • - - - #<< ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.3.

      -
      - -
    • - - -
    • - - - #<=>(other) ⇒ Object - - - - - - - - - - - - - -

      Comparison—Returns an integer (-1, 0, or +1) if this array is less than, equal to, or greater than other_ary.

      -
      - -
    • - - -
    • - - - #==(other) ⇒ Object - - - - - - - - - - - - - -

      Equality—Two arrays are equal if they contain the same number of elements and if each element is equal to (according to Object.==) the corresponding element in the other array.

      -
      - -
    • - - -
    • - - - #[] ⇒ Object - - - - - - - - - - - - - -

      Element Reference — Returns the element at +index+, or returns a subarray starting at the +start+ index and continuing for +length+ elements, or returns a subarray specified by +range+ of indices.

      -
      - -
    • - - -
    • - - - #[]= ⇒ Object - - - - - - - - - - - - - -

      Element Assignment — Sets the element at +index+, or replaces a subarray from the +start+ index for +length+ elements, or replaces a subarray specified by the +range+ of indices.

      -
      - -
    • - - -
    • - - - #__ary_cmp ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #__ary_eq ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.30.

      -
      - -
    • - - -
    • - - - #__ary_index ⇒ Object - - - - - - - - - - - - - -

      kept for mruby-array-ext.

      -
      - -
    • - - -
    • - - - #__svalue ⇒ Object - - - - - - - - - - - - - -

      internal method to convert multi-value to single value.

      -
      - -
    • - - -
    • - - - #_inspect(recur_list) ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #assoc(obj) ⇒ Array? - - - - - - - - - - - - - -

      Searches through an array whose elements are also arrays comparing obj with the first element of each contained array using obj.==.

      -
      - -
    • - - -
    • - - - #at(index) ⇒ Object? - - - - - - - - - - - - - -

      Returns the element at index.

      -
      - -
    • - - -
    • - - - #bsearch(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: ary.bsearch {xblock } -> elem.
      -
      - -
    • - - -
    • - - - #bsearch_index(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: ary.bsearch_index {xblock } -> int or nil.
      -
      - -
    • - - -
    • - - - #clear ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.6.

      -
      - -
    • - - -
    • - - - #collect!(&block) ⇒ Object - - - - (also: #map!) - - - - - - - - - - - -

      Calls the given block for each element of +self+ and pass the respective element.

      -
      - -
    • - - -
    • - - - #combination(n, &block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: ary.combination(n) {cblock } -> ary ary.combination(n) -> Enumerator.
      -
      - -
    • - - -
    • - - - #compact ⇒ Object - - - - - - - - - - - - - -

      call-seq: ary.compact -> new_ary.

      -
      - -
    • - - -
    • - - - #compact! ⇒ Object - - - - - - - - - - - - - -

      call-seq: ary.compact! -> ary or nil.

      -
      - -
    • - - -
    • - - - #concat ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.8.

      -
      - -
    • - - -
    • - - - #delete(key, &block) ⇒ Object - - - - - - - - - - - - - -

      Delete element with index +key+.

      -
      - -
    • - - -
    • - - - #delete_at ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.9.

      -
      - -
    • - - -
    • - - - #delete_if(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: ary.delete_if {itemblock } -> ary ary.delete_if -> Enumerator.
      -
      - -
    • - - -
    • - - - #difference(*args) ⇒ Object - - - - - - - - - - - - - -

      call-seq: ary.difference(other_ary1, other_ary2, …) -> new_ary.

      -
      - -
    • - - -
    • - - - #dig(idx, *args) ⇒ Object - - - - - - - - - - - - - -

      call-seq: ary.dig(idx, …) -> object.

      -
      - -
    • - - -
    • - - - #each_index(&block) ⇒ Object - - - - - - - - - - - - - -

      Calls the given block for each element of +self+ and pass the index of the respective element.

      -
      - -
    • - - -
    • - - - #empty? ⇒ Boolean - - - - - - - - - - - - - -

      15.2.12.5.12.

      -
      - -
    • - - -
    • - - - #eql?(other) ⇒ Boolean - - - - - - - - - - - - - -

      Returns true if +self+ and other are the same object, or are both arrays with the same content.

      -
      - -
    • - - -
    • - - - #fetch(n, ifnone = NONE, &block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: ary.fetch(index) -> obj ary.fetch(index, default) -> obj ary.fetch(index) {indexblock } -> obj.
      -
      - -
    • - - -
    • - - - #fill(arg0 = nil, arg1 = nil, arg2 = nil, &block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - - - - - -
      call-seq: ary.fill(obj) -> ary ary.fill(obj, start [, length]) -> ary ary.fill(obj, range ) -> ary ary.fill {indexblock } -> ary ary.fill(start [, length] ) {indexblock } -> ary ary.fill(range) {indexblock } -> ary.
      -
      - -
    • - - -
    • - - - #first ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.13.

      -
      - -
    • - - -
    • - - - #flatten(depth = nil) ⇒ Object - - - - - - - - - - - - - -

      call-seq: ary.flatten -> new_ary ary.flatten(level) -> new_ary.

      -
      - -
    • - - -
    • - - - #flatten!(depth = nil) ⇒ Object - - - - - - - - - - - - - -

      call-seq: ary.flatten! -> ary or nil ary.flatten!(level) -> array or nil.

      -
      - -
    • - - -
    • - - - #index(val = NONE, &block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: ary.index(val) -> int or nil ary.index {itemblock } -> int or nil.
      -
      - -
    • - - -
    • - - - #initialize(size = 0, obj = nil, &block) ⇒ Array - - - - - - - constructor - - - - - - - - -

      Private method for Array creation.

      -
      - -
    • - - -
    • - - - #initialize_copy ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.16.

      -
      - -
    • - - -
    • - - - #insert(idx, *args) ⇒ Object - - - - - - - - - - - - - -

      call-seq: ary.insert(index, obj…) -> ary.

      -
      - -
    • - - -
    • - - - #inspect ⇒ Object - - - - (also: #to_s) - - - - - - - - - - - -

      Return the contents of this array as a string.

      -
      - -
    • - - -
    • - - - #intersection(*args) ⇒ Object - - - - - - - - - - - - - -

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

      -
      - -
    • - - -
    • - - - #join(sep = "") ⇒ String - - - - - - - - - - - - - -

      Returns a string created by converting each element of the array to a string, separated by sep.

      -
      - -
    • - - -
    • - - - #keep_if(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: ary.keep_if {itemblock } -> ary ary.keep_if -> Enumerator.
      -
      - -
    • - - -
    • - - - #last ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.18.

      -
      - -
    • - - -
    • - - - #length ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.19.

      -
      - -
    • - - -
    • - - - #permutation(n = self.size, &block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - - - -
      call-seq: ary.permutation {pblock } -> ary ary.permutation -> Enumerator ary.permutation(n) {pblock } -> ary ary.permutation(n) -> Enumerator.
      -
      - -
    • - - -
    • - - - #pop ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.21.

      -
      - -
    • - - -
    • - - - #push ⇒ Object - - - - (also: #append) - - - - - - - - - - - -

      15.2.12.5.22.

      -
      - -
    • - - -
    • - - - #rassoc(obj) ⇒ Array? - - - - - - - - - - - - - -

      Searches through the array whose elements are also arrays.

      -
      - -
    • - - -
    • - - - #reject!(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: ary.reject! {itemblock } -> ary or nil ary.reject! -> Enumerator.
      -
      - -
    • - - -
    • - - - #replace ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.23.

      -
      - -
    • - - -
    • - - - #reverse ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.24.

      -
      - -
    • - - -
    • - - - #reverse! ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.25.

      -
      - -
    • - - -
    • - - - #reverse_each(&block) ⇒ Object - - - - - - - - - - - - - -

      for efficiency.

      -
      - -
    • - - -
    • - - - #rindex ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.26.

      -
      - -
    • - - -
    • - - - #rotate(count = 1) ⇒ Object - - - - - - - - - - - - - -

      call-seq: ary.rotate(count=1) -> new_ary.

      -
      - -
    • - - -
    • - - - #rotate!(count = 1) ⇒ Object - - - - - - - - - - - - - -

      call-seq: ary.rotate!(count=1) -> ary.

      -
      - -
    • - - -
    • - - - #select!(&block) ⇒ Object - - - - (also: #filter!) - - - - - - - - - - - -
      - - - - - - - -
      call-seq: ary.select! {itemblock } -> ary or nil ary.select! -> Enumerator.
      -
      - -
    • - - -
    • - - - #shift ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.27.

      -
      - -
    • - - -
    • - - - #size ⇒ Object - - - - - - - - - - - - - -

      15.2.12.5.28.

      -
      - -
    • - - -
    • - - - #slice ⇒ Object - - - - - - - - - - - - - -

      Element Reference — Returns the element at +index+, or returns a subarray starting at the +start+ index and continuing for +length+ elements, or returns a subarray specified by +range+ of indices.

      -
      - -
    • - - -
    • - - - #slice! ⇒ Object - - - - - - - - - - - - - -

      Deletes the element(s) given by an +index+ (optionally up to +length+ elements) or by a +range+.

      -
      - -
    • - - -
    • - - - #sort(&block) ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #sort!(&block) ⇒ Object - - - - - - - - - - - - - -

      Sort all elements and replace +self+ with these elements.

      -
      - -
    • - - -
    • - - - #to_h(&blk) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: ary.to_h -> Hash ary.to_h{item… } -> Hash.
      -
      - -
    • - - -
    • - - - #transpose ⇒ Object - - - - - - - - - - - - - -

      call-seq: ary.transpose -> new_ary.

      -
      - -
    • - - -
    • - - - #union(*args) ⇒ Object - - - - - - - - - - - - - -

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

      -
      - -
    • - - -
    • - - - #uniq(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: ary.uniq -> new_ary ary.uniq {item… } -> new_ary.
      -
      - -
    • - - -
    • - - - #uniq!(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: ary.uniq! -> ary or nil ary.uniq! {item… } -> ary or nil.
      -
      - -
    • - - -
    • - - - #unshift ⇒ Object - - - - (also: #prepend) - - - - - - - - - - - -

      15.2.12.5.30.

      -
      - -
    • - - -
    • - - - #values_at ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #|(elem) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - -
      call-seq: aryother_ary -> new_ary.
      -
      - -
    • - - -
    - - - - - - - - - - - -

    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, #filter_map, #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, #tally, #zip

    -
    -

    Constructor Details

    - -
    -

    - - #initialize(size = 0, obj = nil, &block) ⇒ Array - - - - - -

    -
    -

    Private method for Array creation.

    - -

    ISO 15.2.12.5.15

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -68
    -69
    -70
    -71
    -72
    -73
    -74
    -75
    -76
    -77
    -78
    -79
    -80
    -81
    -82
    -83
    -84
    -
    -
    # File 'mrblib/array.rb', line 68
    -
    -def initialize(size=0, obj=nil, &block)
    -  size = size.__to_int
    -  raise ArgumentError, "negative array size" if size < 0
    -
    -  self.clear
    -  if size > 0
    -    self[size - 1] = nil # allocate
    -
    -    idx = 0
    -    while idx < size
    -      self[idx] = (block)? block.call(idx): obj
    -      idx += 1
    -    end
    -  end
    -
    -  self
    -end
    -
    -
    - -
    - - -
    -

    Instance Method Details

    - - -
    -

    - - #&(elem) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary & other_ary -> new_ary

    - -

    Set Intersection—Returns a new array -containing elements common to the two arrays, with no duplicates.

    - -

    [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ]

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -152
    -153
    -154
    -155
    -156
    -157
    -158
    -159
    -160
    -161
    -162
    -163
    -164
    -165
    -166
    -167
    -168
    -169
    -170
    -171
    -172
    -173
    -174
    -
    -
    # 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
    -
    -  hash = {}
    -  array = []
    -  idx = 0
    -  len = elem.size
    -  while idx < len
    -    hash[elem[idx]] = true
    -    idx += 1
    -  end
    -  idx = 0
    -  len = size
    -  while idx < len
    -    v = self[idx]
    -    if hash[v]
    -      array << v
    -      hash.delete v
    -    end
    -    idx += 1
    -  end
    -  array
    -end
    -
    -
    - -
    -

    - - #*Object - - - - - -

    -
    -

    15.2.12.5.2

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -450
    -
    -
    # File 'src/array.c', line 424
    -
    -static mrb_value
    -mrb_ary_times(mrb_state *mrb, mrb_value self)
    -{
    -  struct RArray *a1 = mrb_ary_ptr(self);
    -  struct RArray *a2;
    -  mrb_value *ptr;
    -  mrb_int times, len1;
    -
    -  mrb_get_args(mrb, "i", &times);
    -  if (times < 0) {
    -    mrb_raise(mrb, E_ARGUMENT_ERROR, "negative argument");
    -  }
    -  if (times == 0) return mrb_ary_new(mrb);
    -  if (ARY_MAX_SIZE / times < ARY_LEN(a1)) {
    -    mrb_raise(mrb, E_ARGUMENT_ERROR, "array size too big");
    -  }
    -  len1 = ARY_LEN(a1);
    -  a2 = ary_new_capa(mrb, len1 * times);
    -  ARY_SET_LEN(a2, len1 * times);
    -  ptr = ARY_PTR(a2);
    -  while (times--) {
    -    array_copy(ptr, ARY_PTR(a1), len1);
    -    ptr += len1;
    -  }
    -
    -  return mrb_obj_value(a2);
    -}
    -
    -
    - -
    -

    - - #+Object - - - - - -

    -
    -

    15.2.12.5.1

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -338
    -339
    -340
    -341
    -342
    -343
    -344
    -345
    -346
    -347
    -348
    -349
    -350
    -351
    -352
    -353
    -354
    -355
    -356
    -357
    -
    -
    # File 'src/array.c', line 338
    -
    -static mrb_value
    -mrb_ary_plus(mrb_state *mrb, mrb_value self)
    -{
    -  struct RArray *a1 = mrb_ary_ptr(self);
    -  struct RArray *a2;
    -  mrb_value *ptr;
    -  mrb_int blen, len1;
    -
    -  mrb_get_args(mrb, "a", &ptr, &blen);
    -  if (ARY_MAX_SIZE - blen < ARY_LEN(a1)) {
    -    mrb_raise(mrb, E_ARGUMENT_ERROR, "array size too big");
    -  }
    -  len1 = ARY_LEN(a1);
    -  a2 = ary_new_capa(mrb, len1 + blen);
    -  array_copy(ARY_PTR(a2), ARY_PTR(a1), len1);
    -  array_copy(ARY_PTR(a2) + len1, ptr, blen);
    -  ARY_SET_LEN(a2, len1+blen);
    -
    -  return mrb_obj_value(a2);
    -}
    -
    -
    - -
    -

    - - #-(elem) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary - other_ary -> new_ary

    - -

    Array Difference—Returns a new array that is a copy of -the original array, removing any items that also appear in -other_ary. (If you need set-like behavior, see the -library class Set.)

    - -

    [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ] #=> [ 3, 3, 5 ]

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -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 70
    -
    -def -(elem)
    -  raise TypeError, "can't convert #{elem.class} into Array" unless elem.class == Array
    -
    -  hash = {}
    -  array = []
    -  idx = 0
    -  len = elem.size
    -  while idx < len
    -    hash[elem[idx]] = true
    -    idx += 1
    -  end
    -  idx = 0
    -  len = size
    -  while idx < len
    -    v = self[idx]
    -    array << v unless hash[v]
    -    idx += 1
    -  end
    -  array
    -end
    -
    -
    - -
    -

    - - #<<Object - - - - - -

    -
    -

    15.2.12.5.3

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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;
    -}
    -
    -
    - -
    -

    - - #<=>(other) ⇒ Object - - - - - -

    -
    -

    Comparison—Returns an integer (-1, 0, or +1) - if this array is less than, equal to, or greater than other_ary. - Each object in each array is compared (using <=>). If any value isn’t - equal, then that inequality is the return value. If all the - values found are equal, then the return is based on a - comparison of the array lengths. Thus, two arrays are - “equal” according to Array#<=> if and only if they have - the same length and the value of each element is equal to the - value of the corresponding element in the other array.

    - -

    ISO 15.2.12.5.36 (x)

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -158
    -159
    -160
    -161
    -162
    -163
    -164
    -165
    -166
    -167
    -168
    -169
    -170
    -171
    -172
    -173
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    -
    -
    # File 'mrblib/array.rb', line 158
    -
    -def <=>(other)
    -  other = self.__ary_cmp(other)
    -  return 0 if 0 == other
    -  return nil if nil == other
    -
    -  len = self.size
    -  n = other.size
    -  len = n if len > n
    -  i = 0
    -  while i < len
    -    n = (self[i] <=> other[i])
    -    return n if n.nil? || n != 0
    -    i += 1
    -  end
    -  len = self.size - other.size
    -  if len == 0
    -    0
    -  elsif len > 0
    -    1
    -  else
    -    -1
    -  end
    -end
    -
    -
    - -
    -

    - - #==(other) ⇒ Object - - - - - -

    -
    -

    Equality—Two arrays are equal if they contain the same number - of elements and if each element is equal to (according to - Object.==) the corresponding element in the other array.

    - -

    ISO 15.2.12.5.33 (x)

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -115
    -116
    -117
    -118
    -119
    -120
    -121
    -122
    -123
    -124
    -125
    -126
    -
    -
    # File 'mrblib/array.rb', line 115
    -
    -def ==(other)
    -  other = self.__ary_eq(other)
    -  return false if other == false
    -  return true  if other == true
    -  len = self.size
    -  i = 0
    -  while i < len
    -    return false if self[i] != other[i]
    -    i += 1
    -  end
    -  return true
    -end
    -
    -
    - -
    -

    - - - #[](index) ⇒ Object? - - #[](start, length) ⇒ Array? - - #[](range) ⇒ Array? - - #slice(index) ⇒ Object? - - #slice(start, length) ⇒ Array? - - #slice(range) ⇒ Array? - - - - - - -

    -
    -

    Element Reference — Returns the element at +index+, or returns a -subarray starting at the +start+ index and continuing for +length+ -elements, or returns a subarray specified by +range+ of indices.

    - -

    Negative indices count backward from the end of the array (-1 is the last -element). For +start+ and +range+ cases the starting index is just before -an element. Additionally, an empty array is returned when the starting -index for an element range is at the end of the array.

    - -

    Returns +nil+ if the index (or starting index) are out of range.

    - -

    a = [ “a”, “b”, “c”, “d”, “e” ] -a[1] => “b” -a[1,2] => [“b”, “c”] -a[1..-2] => [“b”, “c”, “d”]

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #[](index) ⇒ Object? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](start, length) ⇒ Array? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](range) ⇒ Array? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice(index) ⇒ Object? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice(start, length) ⇒ Array? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice(range) ⇒ Array? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array, nil) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -877
    -878
    -879
    -880
    -881
    -882
    -883
    -884
    -885
    -
    -
    # 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;
    -  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, ARY_LEN(a), TRUE) == MRB_RANGE_OK) {
    -        return ary_subseq(mrb, a, i, len);
    -      }
    -      else {
    -        return mrb_nil_value();
    -      }
    -    case MRB_TT_FIXNUM:
    -      return mrb_ary_ref(mrb, self, mrb_fixnum(index));
    -    default:
    -      return mrb_ary_ref(mrb, self, aget_index(mrb, index));
    -    }
    -  }
    -
    -  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();
    -  if (alen == i) return mrb_ary_new(mrb);
    -  if (len > alen - i) len = alen - i;
    -
    -  return ary_subseq(mrb, a, i, len);
    -}
    -
    -
    - -
    -

    - - - #[]=(index) ⇒ Object - - #[]=(start, length) ⇒ Object? - - #[]=(range) ⇒ Object? - - - - - - -

    -
    -

    Element Assignment — Sets the element at +index+, or replaces a subarray -from the +start+ index for +length+ elements, or replaces a subarray -specified by the +range+ of indices.

    - -

    If indices are greater than the current capacity of the array, the array -grows automatically. Elements are inserted into the array at +start+ if -+length+ is zero.

    - -

    Negative indices will count backward from the end of the array. For -+start+ and +range+ cases the starting index is just before an element.

    - -

    An IndexError is raised if a negative index points past the beginning of -the array.

    - -

    See also Array#push, and Array#unshift.

    - -

    a = Array.new - a[4] = “4”; #=> [nil, nil, nil, nil, “4”] - a[0, 3] = [ ‘a’, ‘b’, ‘c’ ] #=> [“a”, “b”, “c”, nil, “4”] - a[1..2] = [ 1, 2 ] #=> [“a”, 1, 2, nil, “4”] - a[0, 2] = “?” #=> [”?”, 2, nil, “4”] - a[0..2] = “A” #=> [“A”, “4”] - a[-1] = “Z” #=> [“A”, “Z”] - a[1..-1] = nil #=> [“A”, nil] - a[1..-1] = [] #=> [“A”] - a[0, 0] = [ 1, 2 ] #=> [1, 2, “A”] - a[3, 0] = “B” #=> [1, 2, “A”, “B”]

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #[]=(index) ⇒ Object -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[]=(start, length) ⇒ Object? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[]=(range) ⇒ Object? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object, nil) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'src/array.c', line 922
    -
    -static mrb_value
    -mrb_ary_aset(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value v1, v2, v3;
    -  mrb_int i, len;
    -
    -  mrb_ary_modify(mrb, mrb_ary_ptr(self));
    -  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 MRB_RANGE_TYPE_MISMATCH:
    -      mrb_ary_set(mrb, self, aget_index(mrb, v1), v2);
    -      break;
    -    case MRB_RANGE_OK:
    -      mrb_ary_splice(mrb, self, i, len, v2);
    -      break;
    -    case MRB_RANGE_OUT:
    -      mrb_raisef(mrb, E_RANGE_ERROR, "%v out of range", v1);
    -      break;
    -    }
    -    return v2;
    -  }
    -
    -  /* a[n,m] = v */
    -  mrb_ary_splice(mrb, self, aget_index(mrb, v1), aget_index(mrb, v2), v3);
    -  return v3;
    -}
    -
    -
    - -
    -

    - - #__ary_cmpObject - - - - - -

    - - - - -
    -
    -
    -
    -1232
    -1233
    -1234
    -1235
    -1236
    -1237
    -1238
    -1239
    -1240
    -1241
    -1242
    -1243
    -1244
    -
    -
    # File 'src/array.c', line 1232
    -
    -static mrb_value
    -mrb_ary_cmp(mrb_state *mrb, mrb_value ary1)
    -{
    -  mrb_value ary2;
    -
    -  mrb_get_args(mrb, "o", &ary2);
    -  if (mrb_obj_equal(mrb, ary1, ary2)) return mrb_fixnum_value(0);
    -  if (!mrb_array_p(ary2)) {
    -    return mrb_nil_value();
    -  }
    -
    -  return ary2;
    -}
    -
    -
    - -
    -

    - - #__ary_eqObject - - - - - -

    -
    -

    15.2.12.5.30

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1217
    -1218
    -1219
    -1220
    -1221
    -1222
    -1223
    -1224
    -1225
    -1226
    -1227
    -1228
    -1229
    -1230
    -
    -
    # File 'src/array.c', line 1217
    -
    -static mrb_value
    -mrb_ary_eq(mrb_state *mrb, mrb_value ary1)
    -{
    -  mrb_value ary2;
    -
    -  mrb_get_args(mrb, "o", &ary2);
    -  if (mrb_obj_equal(mrb, ary1, ary2)) return mrb_true_value();
    -  if (!mrb_array_p(ary2)) {
    -    return mrb_false_value();
    -  }
    -  if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return mrb_false_value();
    -
    -  return ary2;
    -}
    -
    -
    - -
    -

    - - #__ary_indexObject - - - - - -

    -
    -

    kept for mruby-array-ext

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1025
    -1026
    -1027
    -1028
    -1029
    -1030
    -1031
    -1032
    -1033
    -1034
    -1035
    -1036
    -1037
    -1038
    -
    -
    # File 'src/array.c', line 1025
    -
    -static mrb_value
    -mrb_ary_index_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value obj;
    -  mrb_int i;
    -
    -  mrb_get_args(mrb, "o", &obj);
    -  for (i = 0; i < RARRAY_LEN(self); i++) {
    -    if (mrb_equal(mrb, RARRAY_PTR(self)[i], obj)) {
    -      return mrb_fixnum_value(i);
    -    }
    -  }
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #__svalueObject - - - - - -

    -
    -

    internal method to convert multi-value to single value

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1247
    -1248
    -1249
    -1250
    -1251
    -1252
    -1253
    -1254
    -1255
    -1256
    -1257
    -1258
    -
    -
    # File 'src/array.c', line 1247
    -
    -static mrb_value
    -mrb_ary_svalue(mrb_state *mrb, mrb_value ary)
    -{
    -  switch (RARRAY_LEN(ary)) {
    -  case 0:
    -    return mrb_nil_value();
    -  case 1:
    -    return RARRAY_PTR(ary)[0];
    -  default:
    -    return ary;
    -  }
    -}
    -
    -
    - -
    -

    - - #_inspect(recur_list) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -86
    -87
    -88
    -89
    -90
    -91
    -92
    -93
    -94
    -95
    -96
    -97
    -98
    -
    -
    # File 'mrblib/array.rb', line 86
    -
    -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(recur_list)
    -    i+=1
    -  end
    -  "["+ary.join(", ")+"]"
    -end
    -
    -
    - -
    -

    - - #assoc(obj) ⇒ Array? - - - - - -

    -
    -

    Searches through an array whose elements are also arrays -comparing obj with the first element of each contained array -using obj.==. -Returns the first contained array that matches (that -is, the first associated array), -or +nil+ if no match is found. -See also Array#rassoc.

    - -

    s1 = [ “colors”, “red”, “blue”, “green” ] - s2 = [ “letters”, “a”, “b”, “c” ] - s3 = “foo” - a = [ s1, s2, s3 ] - a.assoc(“letters”) #=> [ “letters”, “a”, “b”, “c” ] - a.assoc(“foo”) #=> nil

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

    Returns:

    -
      - -
    • - - - (Array, nil) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    -42
    -
    -
    # File 'mrbgems/mruby-array-ext/src/array.c', line 27
    -
    -static mrb_value
    -mrb_ary_assoc(mrb_state *mrb, mrb_value ary)
    -{
    -  mrb_int i;
    -  mrb_value v, k;
    -
    -  mrb_get_args(mrb, "o", &k);
    -
    -  for (i = 0; i < RARRAY_LEN(ary); ++i) {
    -    v = mrb_check_array_type(mrb, RARRAY_PTR(ary)[i]);
    -    if (!mrb_nil_p(v) && RARRAY_LEN(v) > 0 &&
    -        mrb_equal(mrb, RARRAY_PTR(v)[0], k))
    -      return v;
    -  }
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #at(index) ⇒ Object? - - - - - -

    -
    -

    Returns the element at index. A -negative index counts from the end of +self+. Returns +nil+ -if the index is out of range. See also Array#[].

    - -

    a = [ “a”, “b”, “c”, “d”, “e” ] - a.at(0) #=> “a” - a.at(-1) #=> “e”

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

    Returns:

    -
      - -
    • - - - (Object, nil) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -89
    -90
    -91
    -92
    -93
    -94
    -95
    -96
    -
    -
    # File 'mrbgems/mruby-array-ext/src/array.c', line 89
    -
    -static mrb_value
    -mrb_ary_at(mrb_state *mrb, mrb_value ary)
    -{
    -  mrb_int pos;
    -  mrb_get_args(mrb, "i", &pos);
    -
    -  return mrb_ary_entry(ary, pos);
    -}
    -
    -
    - -
    -

    - - #bsearch(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.bsearch {|x| block } -> elem

    - -

    By using binary search, finds a value from this array which meets - the given condition in O(log n) where n is the size of the array.

    - -

    You can use this method in two use cases: a find-minimum mode and - a find-any mode. In either case, the elements of the array must be - monotone (or sorted) with respect to the block.

    - -

    In find-minimum mode (this is a good choice for typical use case), - the block must return true or false, and there must be an index i - (0 <= i <= ary.size) so that:

    - -
      -
    • the block returns false for any element whose index is less than -i, and
    • -
    • the block returns true for any element whose index is greater -than or equal to i.
    • -
    - -

    This method returns the i-th element. If i is equal to ary.size, - it returns nil.

    - -
    ary = [0, 4, 7, 10, 12]
    -ary.bsearch {|x| x >=   4 } #=> 4
    -ary.bsearch {|x| x >=   6 } #=> 7
    -ary.bsearch {|x| x >=  -1 } #=> 0
    -ary.bsearch {|x| x >= 100 } #=> nil
    -
    - -

    In find-any mode (this behaves like libc’s bsearch(3)), the block - must return a number, and there must be two indices i and j - (0 <= i <= j <= ary.size) so that:

    - -
      -
    • the block returns a positive number for ary[k] if 0 <= k < i,
    • -
    • the block returns zero for ary[k] if i <= k < j, and
    • -
    • the block returns a negative number for ary[k] if -j <= k < ary.size.
    • -
    - -

    Under this condition, this method returns any element whose index - is within i…j. If i is equal to j (i.e., there is no element - that satisfies the block), this method returns nil.

    - -
    ary = [0, 4, 7, 10, 12]
    -# try to find v such that 4 <= v < 8
    -ary.bsearch {|x| 1 - (x / 4).truncate } #=> 4 or 7
    -# try to find v such that 8 <= v < 10
    -ary.bsearch {|x| 4 - (x / 2).truncate } #=> nil
    -
    - -

    You must not mix the two modes at a time; the block must always - return either true/false, or always return a number. It is - undefined which value is actually picked up at each iteration.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -632
    -633
    -634
    -635
    -636
    -637
    -638
    -639
    -640
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 632
    -
    -def bsearch(&block)
    -  return to_enum :bsearch unless block
    -
    -  if idx = bsearch_index(&block)
    -    self[idx]
    -  else
    -    nil
    -  end
    -end
    -
    -
    - -
    -

    - - #bsearch_index(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.bsearch_index {|x| block } -> int or nil

    - -

    By using binary search, finds an index of a value from this array which - meets the given condition in O(log n) where n is the size of the array.

    - -

    It supports two modes, depending on the nature of the block and they are - exactly the same as in the case of #bsearch method with the only difference - being that this method returns the index of the element instead of the - element itself. For more details consult the documentation for #bsearch.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -  low = 0
    -  high = size
    -  satisfied = false
    -
    -  while low < high
    -    mid = ((low+high)/2).truncate
    -    res = block.call self[mid]
    -
    -    case res
    -    when 0 # find-any mode: Found!
    -      return mid
    -    when Numeric # find-any mode: Continue...
    -      in_lower_half = res < 0
    -    when true # find-min mode
    -      in_lower_half = true
    -      satisfied = true
    -    when false, nil # find-min mode
    -      in_lower_half = false
    -    else
    -      raise TypeError, 'invalid block result (must be numeric, true, false or nil)'
    -    end
    -
    -    if in_lower_half
    -      high = mid
    -    else
    -      low = mid + 1
    -    end
    -  end
    -
    -  satisfied ? low : nil
    -end
    -
    -
    - -
    -

    - - #clearObject - - - - - -

    -
    -

    15.2.12.5.6

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1105
    -1106
    -1107
    -1108
    -1109
    -
    -
    # File 'src/array.c', line 1105
    -
    -static mrb_value
    -mrb_ary_clear_m(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_ary_clear(mrb, self);
    -}
    -
    -
    - -
    -

    - - #collect!(&block) ⇒ Object - - - - Also known as: - map! - - - - -

    -
    -

    Calls the given block for each element of +self+ -and pass the respective element. Each element will -be replaced by the resulting values.

    - -

    ISO 15.2.12.5.7

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -46
    -47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    -56
    -
    -
    # File 'mrblib/array.rb', line 46
    -
    -def collect!(&block)
    -  return to_enum :collect! unless block
    -
    -  idx = 0
    -  len = size
    -  while idx < len
    -    self[idx] = block.call self[idx]
    -    idx += 1
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #combination(n, &block) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.combination(n) { |c| block } -> ary - ary.combination(n) -> Enumerator

    - -

    When invoked with a block, yields all combinations of length +n+ of elements -from the array and then returns the array itself.

    - -

    The implementation makes no guarantees about the order in which the -combinations are yielded.

    - -

    If no block is given, an Enumerator is returned instead.

    - -

    Examples:

    - -

    a = [1, 2, 3, 4] - a.combination(1).to_a #=> [[1],[2],[3],[4]] - a.combination(2).to_a #=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]] - a.combination(3).to_a #=> [[1,2,3],[1,2,4],[1,3,4],[2,3,4]] - a.combination(4).to_a #=> [[1,2,3,4]] - a.combination(0).to_a #=> [[]] # one combination of length 0 - a.combination(5).to_a #=> [] # no combinations of length 5

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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 897
    -
    -def combination(n, &block)
    -  return to_enum(:combination, n) unless block
    -  size = self.size
    -  if n == 0
    -     yield []
    -  elsif n == 1
    -    i = 0
    -    while i<size
    -      yield [self[i]]
    -      i += 1
    -    end
    -  elsif n <= size
    -    i = 0
    -    while i<size
    -      result = [self[i]]
    -      self[i+1..-1].combination(n-1) do |c|
    -        yield result + c
    -      end
    -      i += 1
    -    end
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #compactObject - - - - - -

    -
    -

    call-seq: - ary.compact -> new_ary

    - -

    Returns a copy of +self+ with all +nil+ elements removed.

    - -

    [ “a”, nil, “b”, nil, “c”, nil ].compact - #=> [ “a”, “b”, “c” ]

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -265
    -266
    -267
    -268
    -269
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 265
    -
    -def compact
    -  result = self.dup
    -  result.compact!
    -  result
    -end
    -
    -
    - -
    -

    - - #compact!Object - - - - - -

    -
    -

    call-seq: - ary.compact! -> ary or nil

    - -

    Removes +nil+ elements from the array. -Returns +nil+ if no changes were made, otherwise returns -ary.

    - -

    [ “a”, nil, “b”, nil, “c” ].compact! #=> [ “a”, “b”, “c” ] - [ “a”, “b”, “c” ].compact! #=> nil

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -282
    -283
    -284
    -285
    -286
    -287
    -288
    -289
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 282
    -
    -def compact!
    -  result = self.select { |e| !e.nil? }
    -  if result.size == self.size
    -    nil
    -  else
    -    self.replace(result)
    -  end
    -end
    -
    -
    - -
    -

    - - #concatObject - - - - - -

    -
    -

    15.2.12.5.8

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -328
    -329
    -330
    -331
    -332
    -333
    -334
    -335
    -336
    -
    -
    # File 'src/array.c', line 328
    -
    -static mrb_value
    -mrb_ary_concat_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value ary;
    -
    -  mrb_get_args(mrb, "A", &ary);
    -  mrb_ary_concat(mrb, self, ary);
    -  return self;
    -}
    -
    -
    - -
    -

    - - #delete(key, &block) ⇒ Object - - - - - -

    -
    -

    Delete element with index +key+

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -184
    -185
    -186
    -187
    -188
    -189
    -190
    -191
    -
    -
    # File 'mrblib/array.rb', line 184
    -
    -def delete(key, &block)
    -  while i = self.index(key)
    -    self.delete_at(i)
    -    ret = key
    -  end
    -  return block.call if ret.nil? && block
    -  ret
    -end
    -
    -
    - -
    -

    - - #delete_atObject - - - - - -

    -
    -

    15.2.12.5.9

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'src/array.c', line 950
    -
    -static mrb_value
    -mrb_ary_delete_at(mrb_state *mrb, mrb_value self)
    -{
    -  struct RArray *a = mrb_ary_ptr(self);
    -  mrb_int   index;
    -  mrb_value val;
    -  mrb_value *ptr;
    -  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();
    -
    -  ary_modify(mrb, a);
    -  ptr = ARY_PTR(a);
    -  val = ptr[index];
    -
    -  ptr += index;
    -  len = alen - index;
    -  while (--len) {
    -    *ptr = *(ptr+1);
    -    ++ptr;
    -  }
    -  ARY_SET_LEN(a, alen-1);
    -
    -  ary_shrink_capa(mrb, a);
    -
    -  return val;
    -}
    -
    -
    - -
    -

    - - #delete_if(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.delete_if { |item| block } -> ary - ary.delete_if -> Enumerator

    - -

    Deletes every element of +self+ for which block evaluates to +true+.

    - -

    The array is changed instantly every time the block is called, not after - the iteration is over.

    - -

    See also Array#reject!

    - -

    If no block is given, an Enumerator is returned instead.

    - -
    scores = [ 97, 42, 75 ]
    -scores.delete_if {|score| score < 80 }   #=> [97]
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -513
    -514
    -515
    -516
    -517
    -518
    -519
    -520
    -521
    -522
    -523
    -524
    -525
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 513
    -
    -def delete_if(&block)
    -  return to_enum :delete_if unless block
    -
    -  idx = 0
    -  while idx < self.size do
    -    if block.call(self[idx])
    -      self.delete_at(idx)
    -    else
    -      idx += 1
    -    end
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #difference(*args) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.difference(other_ary1, other_ary2, …) -> new_ary

    - -

    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.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -99
    -100
    -101
    -102
    -103
    -104
    -105
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 99
    -
    -def difference(*args)
    -  ary = self
    -  args.each do |x|
    -    ary = ary - x
    -  end
    -  ary
    -end
    -
    -
    - -
    -

    - - #dig(idx, *args) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.dig(idx, …) -> object

    - -

    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+.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -816
    -817
    -818
    -819
    -820
    -821
    -822
    -823
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 816
    -
    -def dig(idx,*args)
    -  n = self[idx]
    -  if args.size > 0
    -    n&.dig(*args)
    -  else
    -    n
    -  end
    -end
    -
    -
    - -
    -

    - - #each_index(&block) ⇒ Object - - - - - -

    -
    -

    Calls the given block for each element of +self+ -and pass the index of the respective element.

    - -

    ISO 15.2.12.5.11

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    -
    -
    # File 'mrblib/array.rb', line 29
    -
    -def each_index(&block)
    -  return to_enum :each_index unless block
    -
    -  idx = 0
    -  while idx < length
    -    block.call(idx)
    -    idx += 1
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #empty?Boolean - - - - - -

    -
    -

    15.2.12.5.12

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -1111
    -1112
    -1113
    -1114
    -1115
    -1116
    -1117
    -
    -
    # File 'src/array.c', line 1111
    -
    -static mrb_value
    -mrb_ary_empty_p(mrb_state *mrb, mrb_value self)
    -{
    -  struct RArray *a = mrb_ary_ptr(self);
    -
    -  return mrb_bool_value(ARY_LEN(a) == 0);
    -}
    -
    -
    - -
    -

    - - #eql?(other) ⇒ Boolean - - - - - -

    -
    -

    Returns true if +self+ and other are the same object, - or are both arrays with the same content.

    - -

    ISO 15.2.12.5.34 (x)

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -133
    -134
    -135
    -136
    -137
    -138
    -139
    -140
    -141
    -142
    -143
    -144
    -
    -
    # File 'mrblib/array.rb', line 133
    -
    -def eql?(other)
    -  other = self.__ary_eq(other)
    -  return false if other == false
    -  return true  if other == true
    -  len = self.size
    -  i = 0
    -  while i < len
    -    return false unless self[i].eql?(other[i])
    -    i += 1
    -  end
    -  return true
    -end
    -
    -
    - -
    -

    - - #fetch(n, ifnone = NONE, &block) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.fetch(index) -> obj - ary.fetch(index, default) -> obj - ary.fetch(index) { |index| block } -> obj

    - -

    Tries to return the element at position +index+, but throws an IndexError - exception if the referenced +index+ lies outside of the array bounds. This - error can be prevented by supplying a second argument, which will act as a - +default+ value.

    - -

    Alternatively, if a block is given it will only be executed when an - invalid +index+ is referenced.

    - -

    Negative values of +index+ count from the end of the array.

    - -
    a = [ 11, 22, 33, 44 ]
    -a.fetch(1)               #=> 22
    -a.fetch(-1)              #=> 44
    -a.fetch(4, 'cat')        #=> "cat"
    -a.fetch(100) { |i| puts "#{i} is out of bounds" }
    -                         #=> "100 is out of bounds"
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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 327
    -
    -def fetch(n, ifnone=NONE, &block)
    -  warn "block supersedes default value argument" if !n.nil? && ifnone != NONE && block
    -
    -  idx = n
    -  if idx < 0
    -    idx += size
    -  end
    -  if idx < 0 || size <= idx
    -    return block.call(n) if block
    -    if ifnone == NONE
    -      raise IndexError, "index #{n} outside of array bounds: #{-size}...#{size}"
    -    end
    -    return ifnone
    -  end
    -  self[idx]
    -end
    -
    -
    - -
    -

    - - #fill(arg0 = nil, arg1 = nil, arg2 = nil, &block) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.fill(obj) -> ary - ary.fill(obj, start [, length]) -> ary - ary.fill(obj, range ) -> ary - ary.fill { |index| block } -> ary - ary.fill(start [, length] ) { |index| block } -> ary - ary.fill(range) { |index| block } -> ary

    - -

    The first three forms set the selected elements of +self+ (which - may be the entire array) to +obj+.

    - -

    A +start+ of +nil+ is equivalent to zero.

    - -

    A +length+ of +nil+ is equivalent to the length of the array.

    - -

    The last three forms fill the array with the value of the given block, - which is passed the absolute index of each element to be filled.

    - -

    Negative values of +start+ count from the end of the array, where +-1+ is - the last element.

    - -
    a = [ "a", "b", "c", "d" ]
    -a.fill("x")              #=> ["x", "x", "x", "x"]
    -a.fill("w", -1)          #=> ["x", "x", "x", "w"]
    -a.fill("z", 2, 2)        #=> ["x", "x", "z", "z"]
    -a.fill("y", 0..1)        #=> ["y", "y", "z", "z"]
    -a.fill { |i| i*i }       #=> [0, 1, 4, 9]
    -a.fill(-2) { |i| i*i*i } #=> [0, 1, 8, 27]
    -a.fill(1, 2) { |i| i+1 } #=> [0, 2, 3, 27]
    -a.fill(0..1) { |i| i+1 } #=> [1, 2, 3, 27]
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -
    # 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
    -    raise ArgumentError, "wrong number of arguments (0 for 1..3)"
    -  end
    -
    -  beg = len = 0
    -  ary = []
    -  if block
    -    if arg0.nil? && arg1.nil? && arg2.nil?
    -      # ary.fill { |index| block }                    -> ary
    -      beg = 0
    -      len = self.size
    -    elsif !arg0.nil? && arg0.kind_of?(Range)
    -      # ary.fill(range) { |index| block }             -> ary
    -      beg = arg0.begin
    -      beg += self.size if beg < 0
    -      len = arg0.end
    -      len += self.size if len < 0
    -      len += 1 unless arg0.exclude_end?
    -    elsif !arg0.nil?
    -      # ary.fill(start [, length] ) { |index| block } -> ary
    -      beg = arg0
    -      beg += self.size if beg < 0
    -      if arg1.nil?
    -        len = self.size
    -      else
    -        len = arg0 + arg1
    -      end
    -    end
    -  else
    -    if !arg0.nil? && arg1.nil? && arg2.nil?
    -      # ary.fill(obj)                                 -> ary
    -      beg = 0
    -      len = self.size
    -    elsif !arg0.nil? && !arg1.nil? && arg1.kind_of?(Range)
    -      # ary.fill(obj, range )                         -> ary
    -      beg = arg1.begin
    -      beg += self.size if beg < 0
    -      len = arg1.end
    -      len += self.size if len < 0
    -      len += 1 unless arg1.exclude_end?
    -    elsif !arg0.nil? && !arg1.nil?
    -      # ary.fill(obj, start [, length])               -> ary
    -      beg = arg1
    -      beg += self.size if beg < 0
    -      if arg2.nil?
    -        len = self.size
    -      else
    -        len = beg + arg2
    -      end
    -    end
    -  end
    -
    -  i = beg
    -  if block
    -    while i < len
    -      self[i] = block.call(i)
    -      i += 1
    -    end
    -  else
    -    while i < len
    -      self[i] = arg0
    -      i += 1
    -    end
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #firstObject - - - - - -

    -
    -

    15.2.12.5.13

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -981
    -982
    -983
    -984
    -985
    -986
    -987
    -988
    -989
    -990
    -991
    -992
    -993
    -994
    -995
    -996
    -997
    -998
    -999
    -1000
    -1001
    -
    -
    # 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;
    -
    -  if (mrb_get_argc(mrb) == 0) {
    -    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);
    -  }
    -  return mrb_ary_new_from_values(mrb, size, ARY_PTR(a));
    -}
    -
    -
    - -
    -

    - - #flatten(depth = nil) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.flatten -> new_ary - ary.flatten(level) -> new_ary

    - -

    Returns a new array that is a one-dimensional flattening of this -array (recursively). That is, for every element that is an array, -extract its elements into the new array. If the optional -level argument determines the level of recursion to flatten.

    - -

    s = [ 1, 2, 3 ] #=> [1, 2, 3] - t = [ 4, 5, 6, [7, 8] ] #=> [4, 5, 6, [7, 8]] - a = [ s, t, 9, 10 ] #=> [[1, 2, 3], [4, 5, 6, [7, 8]], 9, 10] - a.flatten #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - a = [ 1, 2, [3, [4, 5] ] ] - a.flatten(1) #=> [1, 2, 3, [4, 5]]

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -211
    -212
    -213
    -214
    -215
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 211
    -
    -def flatten(depth=nil)
    -  res = dup
    -  res.flatten! depth
    -  res
    -end
    -
    -
    - -
    -

    - - #flatten!(depth = nil) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.flatten! -> ary or nil - ary.flatten!(level) -> array or nil

    - -

    Flattens +self+ in place. -Returns nil if no modifications were made (i.e., -ary contains no subarrays.) If the optional level -argument determines the level of recursion to flatten.

    - -

    a = [ 1, 2, [3, [4, 5] ] ] - a.flatten! #=> [1, 2, 3, 4, 5] - a.flatten! #=> nil - a #=> [1, 2, 3, 4, 5] - a = [ 1, 2, [3, [4, 5] ] ] - a.flatten!(1) #=> [1, 2, 3, [4, 5]]

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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 234
    -
    -def flatten!(depth=nil)
    -  modified = false
    -  ar = []
    -  idx = 0
    -  len = size
    -  while idx < len
    -    e = self[idx]
    -    if e.is_a?(Array) && (depth.nil? || depth > 0)
    -      ar += e.flatten(depth.nil? ? nil : depth - 1)
    -      modified = true
    -    else
    -      ar << e
    -    end
    -    idx += 1
    -  end
    -  if modified
    -    self.replace(ar)
    -  else
    -    nil
    -  end
    -end
    -
    -
    - -
    -

    - - #index(val = NONE, &block) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.index(val) -> int or nil - ary.index {|item| block } -> int or nil

    - -

    Returns the index of the first object in +ary+ such that the object is - == to +obj+.

    - -

    If a block is given instead of an argument, returns the index of the - first object for which the block returns +true+. Returns +nil+ if no - match is found.

    - -

    ISO 15.2.12.5.14

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1025
    -1026
    -1027
    -1028
    -1029
    -1030
    -1031
    -1032
    -1033
    -1034
    -1035
    -1036
    -1037
    -1038
    -
    -
    # File 'src/array.c', line 1025
    -
    -static mrb_value
    -mrb_ary_index_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value obj;
    -  mrb_int i;
    -
    -  mrb_get_args(mrb, "o", &obj);
    -  for (i = 0; i < RARRAY_LEN(self); i++) {
    -    if (mrb_equal(mrb, RARRAY_PTR(self)[i], obj)) {
    -      return mrb_fixnum_value(i);
    -    }
    -  }
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #initialize_copyObject - - - - - -

    -
    -

    15.2.12.5.16

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -413
    -414
    -415
    -416
    -417
    -418
    -419
    -420
    -421
    -422
    -
    -
    # File 'src/array.c', line 413
    -
    -static mrb_value
    -mrb_ary_replace_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value other;
    -
    -  mrb_get_args(mrb, "A", &other);
    -  mrb_ary_replace(mrb, self, other);
    -
    -  return self;
    -}
    -
    -
    - -
    -

    - - #insert(idx, *args) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.insert(index, obj…) -> ary

    - -

    Inserts the given values before the element with the given +index+.

    - -

    Negative indices count backwards from the end of the array, where +-1+ is - the last element.

    - -
    a = %w{ a b c d }
    -a.insert(2, 99)         #=> ["a", "b", 99, "c", "d"]
    -a.insert(-2, 1, 2, 3)   #=> ["a", "b", 99, "c", 1, 2, 3, "d"]
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -574
    -575
    -576
    -577
    -578
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 574
    -
    -def insert(idx, *args)
    -  idx += self.size + 1 if idx < 0
    -  self[idx, 0] = args
    -  self
    -end
    -
    -
    - -
    -

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

    -
    -

    Return the contents of this array as a string.

    - -

    ISO 15.2.12.5.31 (x)

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -103
    -104
    -105
    -
    -
    # File 'mrblib/array.rb', line 103
    -
    -def inspect
    -  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]

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -
    - -
    -

    - - #join(sep = "") ⇒ String - - - - - -

    -
    -

    Returns a string created by converting each element of the array to -a string, separated by sep.

    - -

    [ “a”, “b”, “c” ].join #=> “abc” - [ “a”, “b”, “c” ].join(“-“) #=> “a-b-c”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1208
    -1209
    -1210
    -1211
    -1212
    -1213
    -1214
    -1215
    -
    -
    # File 'src/array.c', line 1208
    -
    -static mrb_value
    -mrb_ary_join_m(mrb_state *mrb, mrb_value ary)
    -{
    -  mrb_value sep = mrb_nil_value();
    -
    -  mrb_get_args(mrb, "|S!", &sep);
    -  return mrb_ary_join(mrb, ary, sep);
    -}
    -
    -
    - -
    -

    - - #keep_if(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.keep_if { |item| block } -> ary - ary.keep_if -> Enumerator

    - -

    Deletes every element of +self+ for which the given block evaluates to - +false+.

    - -

    See also Array#select!

    - -

    If no block is given, an Enumerator is returned instead.

    - -
    a = [1, 2, 3, 4, 5]
    -a.keep_if { |val| val > 3 } #=> [4, 5]
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -735
    -736
    -737
    -738
    -739
    -740
    -741
    -742
    -743
    -744
    -745
    -746
    -747
    -748
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 735
    -
    -def keep_if(&block)
    -  return to_enum :keep_if unless block
    -
    -  idx = 0
    -  len = self.size
    -  while idx < self.size do
    -    if block.call(self[idx])
    -      idx += 1
    -    else
    -      self.delete_at(idx)
    -    end
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #lastObject - - - - - -

    -
    -

    15.2.12.5.18

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1003
    -1004
    -1005
    -1006
    -1007
    -1008
    -1009
    -1010
    -1011
    -1012
    -1013
    -1014
    -1015
    -1016
    -1017
    -1018
    -1019
    -1020
    -1021
    -1022
    -1023
    -
    -
    # 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 n, size, alen;
    -
    -  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");
    -  }
    -  if (size > alen) size = alen;
    -  if (ARY_SHARED_P(a) || size > ARY_DEFAULT_LEN) {
    -    return ary_subseq(mrb, a, alen - size, size);
    -  }
    -  return mrb_ary_new_from_values(mrb, size, ARY_PTR(a) + alen - size);
    -}
    -
    -
    - -
    -

    - - #lengthObject - - - - - -

    -
    -

    15.2.12.5.19

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1079
    -1080
    -1081
    -1082
    -1083
    -1084
    -1085
    -
    -
    # File 'src/array.c', line 1079
    -
    -static mrb_value
    -mrb_ary_size(mrb_state *mrb, mrb_value self)
    -{
    -  struct RArray *a = mrb_ary_ptr(self);
    -
    -  return mrb_fixnum_value(ARY_LEN(a));
    -}
    -
    -
    - -
    -

    - - #permutation(n = self.size, &block) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.permutation { |p| block } -> ary - ary.permutation -> Enumerator - ary.permutation(n) { |p| block } -> ary - ary.permutation(n) -> Enumerator

    - -

    When invoked with a block, yield all permutations of length +n+ of the -elements of the array, then return the array itself.

    - -

    If +n+ is not specified, yield all permutations of all elements.

    - -

    The implementation makes no guarantees about the order in which the -permutations are yielded.

    - -

    If no block is given, an Enumerator is returned instead.

    - -

    Examples:

    - -

    a = [1, 2, 3] - a.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] - a.permutation(1).to_a #=> [[1],[2],[3]] - a.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]] - a.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] - a.permutation(0).to_a #=> [[]] # one permutation of length 0 - a.permutation(4).to_a #=> [] # no permutations of length 4

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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)
    -  return to_enum(:permutation, n) unless block
    -  size = self.size
    -  if n == 0
    -    yield []
    -  elsif 0 < n && n <= size
    -    i = 0
    -    while i<size
    -      result = [self[i]]
    -      if n-1 > 0
    -        ary = self[0...i] + self[i+1..-1]
    -        ary.permutation(n-1) do |c|
    -          yield result + c
    -        end
    -      else
    -        yield result
    -      end
    -      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];
    -}
    -
    -
    - -
    -

    - - #pushObject - - - - Also known as: - append - - - - -

    -
    -

    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;
    -}
    -
    -
    - -
    -

    - - #rassoc(obj) ⇒ Array? - - - - - -

    -
    -

    Searches through the array whose elements are also arrays. Compares -obj with the second element of each contained array using -==. Returns the first contained array that matches. See -also Array#assoc.

    - -

    a = [ [ 1, “one”], [2, “two”], [3, “three”], [“ii”, “two”] ] - a.rassoc(“two”) #=> [2, “two”] - a.rassoc(“four”) #=> nil

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

    Returns:

    -
      - -
    • - - - (Array, nil) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -58
    -59
    -60
    -61
    -62
    -63
    -64
    -65
    -66
    -67
    -68
    -69
    -70
    -71
    -72
    -73
    -74
    -
    -
    # File 'mrbgems/mruby-array-ext/src/array.c', line 58
    -
    -static mrb_value
    -mrb_ary_rassoc(mrb_state *mrb, mrb_value ary)
    -{
    -  mrb_int i;
    -  mrb_value v, value;
    -
    -  mrb_get_args(mrb, "o", &value);
    -
    -  for (i = 0; i < RARRAY_LEN(ary); ++i) {
    -    v = RARRAY_PTR(ary)[i];
    -    if (mrb_array_p(v) &&
    -        RARRAY_LEN(v) > 1 &&
    -        mrb_equal(mrb, RARRAY_PTR(v)[1], value))
    -      return v;
    -  }
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #reject!(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.reject! { |item| block } -> ary or nil - ary.reject! -> Enumerator

    - -

    Equivalent to Array#delete_if, deleting elements from +self+ for which the - block evaluates to +true+, but returns +nil+ if no changes were made.

    - -

    The array is changed instantly every time the block is called, not after - the iteration is over.

    - -

    See also Enumerable#reject and Array#delete_if.

    - -

    If no block is given, an Enumerator is returned instead.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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 542
    -
    -def reject!(&block)
    -  return to_enum :reject! unless block
    -
    -  len = self.size
    -  idx = 0
    -  while idx < self.size do
    -    if block.call(self[idx])
    -      self.delete_at(idx)
    -    else
    -      idx += 1
    -    end
    -  end
    -  if self.size == len
    -    nil
    -  else
    -    self
    -  end
    -end
    -
    -
    - -
    -

    - - #replaceObject - - - - - -

    -
    -

    15.2.12.5.23

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -413
    -414
    -415
    -416
    -417
    -418
    -419
    -420
    -421
    -422
    -
    -
    # File 'src/array.c', line 413
    -
    -static mrb_value
    -mrb_ary_replace_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value other;
    -
    -  mrb_get_args(mrb, "A", &other);
    -  mrb_ary_replace(mrb, self, other);
    -
    -  return self;
    -}
    -
    -
    - -
    -

    - - #reverseObject - - - - - -

    -
    -

    15.2.12.5.24

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -474
    -475
    -476
    -477
    -478
    -479
    -480
    -481
    -482
    -483
    -484
    -485
    -486
    -487
    -488
    -489
    -490
    -491
    -492
    -
    -
    # File 'src/array.c', line 474
    -
    -static mrb_value
    -mrb_ary_reverse(mrb_state *mrb, mrb_value self)
    -{
    -  struct RArray *a = mrb_ary_ptr(self), *b = ary_new_capa(mrb, ARY_LEN(a));
    -  mrb_int len = ARY_LEN(a);
    -
    -  if (len > 0) {
    -    mrb_value *p1, *p2, *e;
    -
    -    p1 = ARY_PTR(a);
    -    e  = p1 + len;
    -    p2 = ARY_PTR(b) + len - 1;
    -    while (p1 < e) {
    -      *p2-- = *p1++;
    -    }
    -    ARY_SET_LEN(b, len);
    -  }
    -  return mrb_obj_value(b);
    -}
    -
    -
    - -
    -

    - - #reverse!Object - - - - - -

    -
    -

    15.2.12.5.25

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -452
    -453
    -454
    -455
    -456
    -457
    -458
    -459
    -460
    -461
    -462
    -463
    -464
    -465
    -466
    -467
    -468
    -469
    -470
    -471
    -472
    -
    -
    # File 'src/array.c', line 452
    -
    -static mrb_value
    -mrb_ary_reverse_bang(mrb_state *mrb, mrb_value self)
    -{
    -  struct RArray *a = mrb_ary_ptr(self);
    -  mrb_int len = ARY_LEN(a);
    -
    -  if (len > 1) {
    -    mrb_value *p1, *p2;
    -
    -    ary_modify(mrb, a);
    -    p1 = ARY_PTR(a);
    -    p2 = p1 + len - 1;
    -
    -    while (p1 < p2) {
    -      mrb_value tmp = *p1;
    -      *p1++ = *p2;
    -      *p2-- = tmp;
    -    }
    -  }
    -  return self;
    -}
    -
    -
    - -
    -

    - - #reverse_each(&block) ⇒ Object - - - - - -

    -
    -

    for efficiency

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -292
    -293
    -294
    -295
    -296
    -297
    -298
    -299
    -300
    -301
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 292
    -
    -def reverse_each(&block)
    -  return to_enum :reverse_each unless block
    -
    -  i = self.size - 1
    -  while i>=0
    -    block.call(self[i])
    -    i -= 1
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #rindexObject - - - - - -

    -
    -

    15.2.12.5.26

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1040
    -1041
    -1042
    -1043
    -1044
    -1045
    -1046
    -1047
    -1048
    -1049
    -1050
    -1051
    -1052
    -1053
    -1054
    -1055
    -1056
    -
    -
    # File 'src/array.c', line 1040
    -
    -static mrb_value
    -mrb_ary_rindex_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value obj;
    -  mrb_int i, len;
    -
    -  mrb_get_args(mrb, "o", &obj);
    -  for (i = RARRAY_LEN(self) - 1; i >= 0; i--) {
    -    if (mrb_equal(mrb, RARRAY_PTR(self)[i], obj)) {
    -      return mrb_fixnum_value(i);
    -    }
    -    if (i > (len = RARRAY_LEN(self))) {
    -      i = len;
    -    }
    -  }
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #rotate(count = 1) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.rotate(count=1) -> new_ary

    - -

    Returns a new array by rotating +self+ so that the element at +count+ is - the first element of the new array.

    - -

    If +count+ is negative then it rotates in the opposite direction, starting - from the end of +self+ where +-1+ is the last element.

    - -
    a = [ "a", "b", "c", "d" ]
    -a.rotate         #=> ["b", "c", "d", "a"]
    -a                #=> ["a", "b", "c", "d"]
    -a.rotate(2)      #=> ["c", "d", "a", "b"]
    -a.rotate(-3)     #=> ["b", "c", "d", "a"]
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -461
    -462
    -463
    -464
    -465
    -466
    -467
    -468
    -469
    -470
    -471
    -472
    -473
    -474
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 461
    -
    -def rotate(count=1)
    -  ary = []
    -  len = self.length
    -
    -  if len > 0
    -    idx = (count < 0) ? (len - (~count % len) - 1) : (count % len) # rotate count
    -    len.times do
    -      ary << self[idx]
    -      idx += 1
    -      idx = 0 if idx > len-1
    -    end
    -  end
    -  ary
    -end
    -
    -
    - -
    -

    - - #rotate!(count = 1) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.rotate!(count=1) -> ary

    - -

    Rotates +self+ in place so that the element at +count+ comes first, and - returns +self+.

    - -

    If +count+ is negative then it rotates in the opposite direction, starting - from the end of the array where +-1+ is the last element.

    - -
    a = [ "a", "b", "c", "d" ]
    -a.rotate!        #=> ["b", "c", "d", "a"]
    -a                #=> ["b", "c", "d", "a"]
    -a.rotate!(2)     #=> ["d", "a", "b", "c"]
    -a.rotate!(-3)    #=> ["a", "b", "c", "d"]
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -492
    -493
    -494
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 492
    -
    -def rotate!(count=1)
    -  self.replace(self.rotate(count))
    -end
    -
    -
    - -
    -

    - - #select!(&block) ⇒ Object - - - - Also known as: - filter! - - - - -

    -
    -

    call-seq: - ary.select! {|item| block } -> ary or nil - ary.select! -> Enumerator

    - -

    Invokes the given block passing in successive elements from +self+, - deleting elements for which the block returns a +false+ value.

    - -

    If changes were made, it will return +self+, otherwise it returns +nil+.

    - -

    See also Array#keep_if

    - -

    If no block is given, an Enumerator is returned instead.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -764
    -765
    -766
    -767
    -768
    -769
    -770
    -771
    -772
    -773
    -774
    -775
    -776
    -777
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 764
    -
    -def select!(&block)
    -  return to_enum :select! unless block
    -
    -  result = []
    -  idx = 0
    -  len = size
    -  while idx < len
    -    elem = self[idx]
    -    result << elem if block.call(elem)
    -    idx += 1
    -  end
    -  return nil if len == result.size
    -  self.replace(result)
    -end
    -
    -
    - -
    -

    - - #shiftObject - - - - - -

    -
    -

    15.2.12.5.27

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -544
    -545
    -546
    -547
    -548
    -549
    -550
    -551
    -552
    -553
    -554
    -555
    -556
    -557
    -558
    -559
    -560
    -561
    -562
    -563
    -564
    -565
    -566
    -567
    -568
    -569
    -570
    -571
    -572
    -573
    -574
    -575
    -576
    -
    -
    # File 'src/array.c', line 544
    -
    -MRB_API mrb_value
    -mrb_ary_shift(mrb_state *mrb, mrb_value self)
    -{
    -  struct RArray *a = mrb_ary_ptr(self);
    -  mrb_int len = ARY_LEN(a);
    -  mrb_value val;
    -
    -  ary_modify_check(mrb, a);
    -  if (len == 0) return mrb_nil_value();
    -  if (ARY_SHARED_P(a)) {
    -  L_SHIFT:
    -    val = a->as.heap.ptr[0];
    -    a->as.heap.ptr++;
    -    a->as.heap.len--;
    -    return val;
    -  }
    -  if (len > ARY_SHIFT_SHARED_MIN) {
    -    ary_make_shared(mrb, a);
    -    goto L_SHIFT;
    -  }
    -  else {
    -    mrb_value *ptr = ARY_PTR(a);
    -    mrb_int size = len;
    -
    -    val = *ptr;
    -    while (--size) {
    -      *ptr = *(ptr+1);
    -      ++ptr;
    -    }
    -    ARY_SET_LEN(a, len-1);
    -  }
    -  return val;
    -}
    -
    -
    - -
    -

    - - #sizeObject - - - - - -

    -
    -

    15.2.12.5.28

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1079
    -1080
    -1081
    -1082
    -1083
    -1084
    -1085
    -
    -
    # File 'src/array.c', line 1079
    -
    -static mrb_value
    -mrb_ary_size(mrb_state *mrb, mrb_value self)
    -{
    -  struct RArray *a = mrb_ary_ptr(self);
    -
    -  return mrb_fixnum_value(ARY_LEN(a));
    -}
    -
    -
    - -
    -

    - - - #[](index) ⇒ Object? - - #[](start, length) ⇒ Array? - - #[](range) ⇒ Array? - - #slice(index) ⇒ Object? - - #slice(start, length) ⇒ Array? - - #slice(range) ⇒ Array? - - - - - - -

    -
    -

    Element Reference — Returns the element at +index+, or returns a -subarray starting at the +start+ index and continuing for +length+ -elements, or returns a subarray specified by +range+ of indices.

    - -

    Negative indices count backward from the end of the array (-1 is the last -element). For +start+ and +range+ cases the starting index is just before -an element. Additionally, an empty array is returned when the starting -index for an element range is at the end of the array.

    - -

    Returns +nil+ if the index (or starting index) are out of range.

    - -

    a = [ “a”, “b”, “c”, “d”, “e” ] -a[1] => “b” -a[1,2] => [“b”, “c”] -a[1..-2] => [“b”, “c”, “d”]

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #[](index) ⇒ Object? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](start, length) ⇒ Array? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](range) ⇒ Array? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice(index) ⇒ Object? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice(start, length) ⇒ Array? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice(range) ⇒ Array? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array, nil) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -877
    -878
    -879
    -880
    -881
    -882
    -883
    -884
    -885
    -
    -
    # 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;
    -  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, ARY_LEN(a), TRUE) == MRB_RANGE_OK) {
    -        return ary_subseq(mrb, a, i, len);
    -      }
    -      else {
    -        return mrb_nil_value();
    -      }
    -    case MRB_TT_FIXNUM:
    -      return mrb_ary_ref(mrb, self, mrb_fixnum(index));
    -    default:
    -      return mrb_ary_ref(mrb, self, aget_index(mrb, index));
    -    }
    -  }
    -
    -  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();
    -  if (alen == i) return mrb_ary_new(mrb);
    -  if (len > alen - i) len = alen - i;
    -
    -  return ary_subseq(mrb, a, i, len);
    -}
    -
    -
    - -
    -

    - - - #slice!(index) ⇒ Object? - - #slice!(start, length) ⇒ Array? - - #slice!(range) ⇒ Array? - - - - - - -

    -
    -

    Deletes the element(s) given by an +index+ (optionally up to +length+ -elements) or by a +range+.

    - -

    Returns the deleted object (or objects), or +nil+ if the +index+ is out of -range.

    - -

    a = [ “a”, “b”, “c” ] - a.slice!(1) #=> “b” - a #=> [“a”, “c”] - a.slice!(-1) #=> “c” - a #=> [“a”] - a.slice!(100) #=> nil - a #=> [“a”]

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #slice!(index) ⇒ Object? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice!(start, length) ⇒ Array? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice!(range) ⇒ Array? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array, nil) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -177
    -178
    -179
    -180
    -181
    -182
    -183
    -184
    -185
    -186
    -
    -
    # 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;
    -  mrb_value val;
    -  mrb_value *ptr;
    -  mrb_value ary;
    -
    -  mrb_ary_modify(mrb, a);
    -
    -  if (mrb_get_argc(mrb) == 1) {
    -    mrb_value index;
    -
    -    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) == MRB_RANGE_OK) {
    -        goto delete_pos_len;
    -      }
    -      else {
    -        return mrb_nil_value();
    -      }
    -    case MRB_TT_FIXNUM:
    -      val = mrb_funcall(mrb, self, "delete_at", 1, index);
    -      return val;
    -    default:
    -      val = mrb_funcall(mrb, self, "delete_at", 1, index);
    -      return val;
    -    }
    -  }
    -
    -  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();
    -  if (alen == i) return mrb_ary_new(mrb);
    -  if (len > alen - i) len = alen - i;
    -
    -  ary = mrb_ary_new_capa(mrb, len);
    -  ptr = ARY_PTR(a);
    -  for (j = i, k = 0; k < len; ++j, ++k) {
    -    mrb_ary_push(mrb, ary, ptr[j]);
    -  }
    -
    -  ptr += i;
    -  for (j = i; j < alen - len; ++j) {
    -    *ptr = *(ptr+len);
    -    ++ptr;
    -  }
    -
    -  mrb_ary_resize(mrb, self, alen - len);
    -  return ary;
    -}
    -
    -
    - -
    -

    - - #sort(&block) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -268
    -269
    -270
    -
    -
    # File 'mrblib/array.rb', line 268
    -
    -def sort(&block)
    -  self.dup.sort!(&block)
    -end
    -
    -
    - -
    -

    - - #sort!(&block) ⇒ Object - - - - - -

    -
    -

    Sort all elements and replace +self+ with these -elements.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -244
    -245
    -246
    -247
    -248
    -249
    -250
    -251
    -252
    -253
    -254
    -255
    -256
    -257
    -258
    -259
    -260
    -261
    -262
    -263
    -264
    -265
    -266
    -
    -
    # File 'mrblib/array.rb', line 203
    -
    -def sort!(&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
    -
    -
    - -
    -

    - - #to_h(&blk) ⇒ Object - - - - - -

    -
    -

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

    - -

    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}
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -963
    -964
    -965
    -966
    -967
    -968
    -969
    -970
    -971
    -972
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 963
    -
    -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
    -
    -
    - -
    -

    - - #transposeObject - - - - - -

    -
    -

    call-seq: - ary.transpose -> new_ary

    - -

    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]]

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -934
    -935
    -936
    -937
    -938
    -939
    -940
    -941
    -942
    -943
    -944
    -945
    -946
    -947
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 934
    -
    -def transpose
    -  return [] if empty?
    -
    -  column_count = nil
    -  self.each do |row|
    -    raise TypeError unless row.is_a?(Array)
    -    column_count ||= row.size
    -    raise IndexError, 'element size differs' unless column_count == row.size
    -  end
    -
    -  Array.new(column_count) do |column_index|
    -    self.map { |row| row[column_index] }
    -  end
    -end
    -
    -
    - -
    -

    - - #union(*args) ⇒ Object - - - - - -

    -
    -

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

    - -

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

    - -

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

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -134
    -135
    -136
    -137
    -138
    -139
    -140
    -141
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 134
    -
    -def union(*args)
    -  ary = self.dup
    -  args.each do |x|
    -    ary.concat(x)
    -    ary.uniq!
    -  end
    -  ary
    -end
    -
    -
    - -
    -

    - - #uniq(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.uniq -> new_ary - ary.uniq { |item| … } -> new_ary

    - -

    Returns a new array by removing duplicate values in +self+.

    - -

    a = [ “a”, “a”, “b”, “b”, “c” ] - a.uniq #=> [“a”, “b”, “c”]

    - -

    b = [[“student”,”sam”], [“student”,”george”], [“teacher”,”matz”]] - b.uniq { |s| s.first } # => [[“student”, “sam”], [“teacher”, “matz”]]

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -53
    -54
    -55
    -56
    -57
    -
    -
    # File 'mrbgems/mruby-array-ext/mrblib/array.rb', line 53
    -
    -def uniq(&block)
    -  ary = self.dup
    -  ary.uniq!(&block)
    -  ary
    -end
    -
    -
    - -
    -

    - - #uniq!(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary.uniq! -> ary or nil - ary.uniq! { |item| … } -> ary or nil

    - -

    Removes duplicate elements from +self+. -Returns nil if no changes are made (that is, no -duplicates are found).

    - -

    a = [ “a”, “a”, “b”, “b”, “c” ] - a.uniq! #=> [“a”, “b”, “c”] - b = [ “a”, “b”, “c” ] - b.uniq! #=> nil - c = [[“student”,”sam”], [“student”,”george”], [“teacher”,”matz”]] - c.uniq! { |s| s.first } # => [[“student”, “sam”], [“teacher”, “matz”]]

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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 18
    -
    -def uniq!(&block)
    -  hash = {}
    -  if block
    -    self.each do |val|
    -      key = block.call(val)
    -      hash[key] = val unless hash.key?(key)
    -    end
    -    result = hash.values
    -  else
    -    hash = {}
    -    self.each do |val|
    -      hash[val] = val
    -    end
    -    result = hash.keys
    -  end
    -  if result.size == self.size
    -    nil
    -  else
    -    self.replace(result)
    -  end
    -end
    -
    -
    - -
    -

    - - #unshiftObject - - - - Also known as: - prepend - - - - -

    -
    -

    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
    -
    -
    # 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]);
    -  }
    -
    -  return self;
    -}
    -
    -
    - -
    -

    - - #values_atObject - - - - - -

    - - - - -
    -
    -
    -
    -98
    -99
    -100
    -101
    -102
    -103
    -104
    -105
    -106
    -107
    -
    -
    # File 'mrbgems/mruby-array-ext/src/array.c', line 98
    -
    -static mrb_value
    -mrb_ary_values_at(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int argc;
    -  mrb_value *argv;
    -
    -  mrb_get_args(mrb, "*", &argv, &argc);
    -
    -  return mrb_get_values_at(mrb, self, RARRAY_LEN(self), argc, argv, mrb_ary_ref);
    -}
    -
    -
    - -
    -

    - - #|(elem) ⇒ Object - - - - - -

    -
    -

    call-seq: - ary | other_ary -> new_ary

    - -

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

    - -

    [ “a”, “b”, “c” ] | [ “c”, “d”, “a” ] - #=> [ “a”, “b”, “c”, “d” ]

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -117
    -118
    -119
    -120
    -121
    -122
    -
    -
    # 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
    -
    -  ary = self + elem
    -  ary.uniq! or ary
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/BasicSocket.html b/docs/api/BasicSocket.html deleted file mode 100644 index 619c16f..0000000 --- a/docs/api/BasicSocket.html +++ /dev/null @@ -1,1992 +0,0 @@ - - - - - - - Class: BasicSocket - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: BasicSocket - - - -

    -
    - -
    -
    Inherits:
    -
    - IO - -
      -
    • Object
    • - - - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-socket/src/socket.c,
    - mrbgems/mruby-socket/mrblib/socket.rb
    -
    -
    - -
    - -
    -

    Direct Known Subclasses

    -

    IPSocket, Socket, UNIXSocket

    -
    - - -

    - Constant Summary - collapse -

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

    Constants inherited - from IO

    -

    IO::BUF_SIZE, IO::SEEK_CUR, IO::SEEK_END, IO::SEEK_SET

    - - -

    Instance Attribute Summary collapse

    - - - - - - -

    - Class Method Summary - collapse -

    - - - -

    - Instance Method Summary - collapse -

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

    Methods inherited from IO

    -

    #<<, #_check_readable, #_read_buf, #close_on_exec=, #close_on_exec?, #close_write, #closed?, #each, #each_byte, #eof?, #fileno, #flush, #getc, #gets, #hash, #initialize_copy, #isatty, open, #pid, pipe, popen, #pos, #pos=, #print, #printf, #puts, read, #read, #readchar, #readline, #readlines, #rewind, #seek, #sync, #sync=, #ungetc, #write

    -
    -

    Constructor Details

    - -
    -

    - - #initialize(*args) ⇒ BasicSocket - - - - - -

    -
    -

    Returns a new instance of BasicSocket

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -179
    -180
    -181
    -182
    -183
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 179
    -
    -def initialize(*args)
    -  super(*args)
    -  self._is_socket = true
    -  @do_not_reverse_lookup = @@do_not_reverse_lookup
    -end
    -
    -
    - -
    - -
    -

    Instance Attribute Details

    - - - -
    -

    - - #do_not_reverse_lookupObject - - - - - -

    -
    -

    Returns the value of attribute do_not_reverse_lookup

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -208
    -209
    -210
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 208
    -
    -def do_not_reverse_lookup
    -  @do_not_reverse_lookup
    -end
    -
    -
    - -
    - - -
    -

    Class Method Details

    - - -
    -

    - - .do_not_reverse_lookupObject - - - - - -

    - - - - -
    -
    -
    -
    -171
    -172
    -173
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 171
    -
    -def self.do_not_reverse_lookup
    -  @@do_not_reverse_lookup
    -end
    -
    -
    - -
    -

    - - .do_not_reverse_lookup=(val) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -175
    -176
    -177
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 175
    -
    -def self.do_not_reverse_lookup=(val)
    -  @@do_not_reverse_lookup = val ? true : false
    -end
    -
    -
    - -
    -

    - - .for_fd(fd) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -185
    -186
    -187
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 185
    -
    -def self.for_fd(fd)
    -  super(fd, "r+")
    -end
    -
    -
    - -
    - -
    -

    Instance Method Details

    - - -
    -

    - - #_is_socket=Object - - - - - -

    - - - - -
    -
    -
    -
    -499
    -500
    -501
    -502
    -503
    -504
    -505
    -506
    -507
    -508
    -509
    -510
    -511
    -512
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 499
    -
    -static mrb_value
    -mrb_basicsocket_set_is_socket(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_bool b;
    -  struct mrb_io *io_p;
    -  mrb_get_args(mrb, "b", &b);
    -
    -  io_p = (struct mrb_io*)DATA_PTR(self);
    -  if (io_p) {
    -    io_p->is_socket = b;
    -  }
    -
    -  return mrb_bool_value(b);
    -}
    -
    -
    - -
    -

    - - #_recvfromObject - - - - - -

    - - - - -
    -
    -
    -
    -372
    -373
    -374
    -375
    -376
    -377
    -378
    -379
    -380
    -381
    -382
    -383
    -384
    -385
    -386
    -387
    -388
    -389
    -390
    -391
    -392
    -393
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 372
    -
    -static mrb_value
    -mrb_basicsocket_recvfrom(mrb_state *mrb, mrb_value self)
    -{
    -  ssize_t n;
    -  mrb_int maxlen, flags = 0;
    -  mrb_value ary, buf, sa;
    -  socklen_t socklen;
    -
    -  mrb_get_args(mrb, "i|i", &maxlen, &flags);
    -  buf = mrb_str_buf_new(mrb, maxlen);
    -  socklen = sizeof(struct sockaddr_storage);
    -  sa = mrb_str_buf_new(mrb, socklen);
    -  n = recvfrom(socket_fd(mrb, self), RSTRING_PTR(buf), (fsize_t)maxlen, (int)flags, (struct sockaddr *)RSTRING_PTR(sa), &socklen);
    -  if (n == -1)
    -    mrb_sys_fail(mrb, "recvfrom");
    -  mrb_str_resize(mrb, buf, (mrb_int)n);
    -  mrb_str_resize(mrb, sa, (mrb_int)socklen);
    -  ary = mrb_ary_new_capa(mrb, 2);
    -  mrb_ary_push(mrb, ary, buf);
    -  mrb_ary_push(mrb, ary, sa);
    -  return ary;
    -}
    -
    -
    - -
    -

    - - #_setnonblockObject - - - - - -

    - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 414
    -
    -static mrb_value
    -mrb_basicsocket_setnonblock(mrb_state *mrb, mrb_value self)
    -{
    -  int fd, flags;
    -  mrb_bool nonblocking;
    -#ifdef _WIN32
    -  u_long mode = 1;
    -#endif
    -
    -  mrb_get_args(mrb, "b", &nonblocking);
    -  fd = socket_fd(mrb, self);
    -#ifdef _WIN32
    -  flags = ioctlsocket(fd, FIONBIO, &mode);
    -  if (flags != NO_ERROR)
    -    mrb_sys_fail(mrb, "ioctlsocket");
    -#else
    -  flags = fcntl(fd, F_GETFL, 0);
    -  if (flags == 1)
    -    mrb_sys_fail(mrb, "fcntl");
    -  if (nonblocking)
    -    flags |= O_NONBLOCK;
    -  else
    -    flags &= ~O_NONBLOCK;
    -  if (fcntl(fd, F_SETFL, flags) == -1)
    -    mrb_sys_fail(mrb, "fcntl");
    -#endif
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #closeObject - - - - - -

    - - - - -
    -
    -
    -
    -773
    -774
    -775
    -776
    -777
    -778
    -779
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 773
    -
    -static mrb_value
    -mrb_win32_basicsocket_close(mrb_state *mrb, mrb_value self)
    -{
    -  if (closesocket(socket_fd(mrb, self)) != NO_ERROR)
    -    mrb_raise(mrb, E_SOCKET_ERROR, "closesocket unsuccessful");
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #getpeereidObject - - - - - -

    - - - - -
    -
    -
    -
    -287
    -288
    -289
    -290
    -291
    -292
    -293
    -294
    -295
    -296
    -297
    -298
    -299
    -300
    -301
    -302
    -303
    -304
    -305
    -306
    -307
    -308
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 287
    -
    -static mrb_value
    -mrb_basicsocket_getpeereid(mrb_state *mrb, mrb_value self)
    -{
    -#ifdef HAVE_GETPEEREID
    -  mrb_value ary;
    -  gid_t egid;
    -  uid_t euid;
    -  int s;
    -
    -  s = socket_fd(mrb, self);
    -  if (getpeereid(s, &euid, &egid) != 0)
    -    mrb_sys_fail(mrb, "getpeereid");
    -
    -  ary = mrb_ary_new_capa(mrb, 2);
    -  mrb_ary_push(mrb, ary, mrb_fixnum_value((mrb_int)euid));
    -  mrb_ary_push(mrb, ary, mrb_fixnum_value((mrb_int)egid));
    -  return ary;
    -#else
    -  mrb_raise(mrb, E_RUNTIME_ERROR, "getpeereid is not available on this system");
    -  return mrb_nil_value();
    -#endif
    -}
    -
    -
    - -
    -

    - - #getpeernameObject - - - - - -

    - - - - -
    -
    -
    -
    -310
    -311
    -312
    -313
    -314
    -315
    -316
    -317
    -318
    -319
    -320
    -321
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 310
    -
    -static mrb_value
    -mrb_basicsocket_getpeername(mrb_state *mrb, mrb_value self)
    -{
    -  struct sockaddr_storage ss;
    -  socklen_t salen;
    -
    -  salen = sizeof(ss);
    -  if (getpeername(socket_fd(mrb, self), (struct sockaddr *)&ss, &salen) != 0)
    -    mrb_sys_fail(mrb, "getpeername");
    -
    -  return mrb_str_new(mrb, (char*)&ss, salen);
    -}
    -
    -
    - -
    -

    - - #getsocknameObject - - - - - -

    - - - - -
    -
    -
    -
    -323
    -324
    -325
    -326
    -327
    -328
    -329
    -330
    -331
    -332
    -333
    -334
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 323
    -
    -static mrb_value
    -mrb_basicsocket_getsockname(mrb_state *mrb, mrb_value self)
    -{
    -  struct sockaddr_storage ss;
    -  socklen_t salen;
    -
    -  salen = sizeof(ss);
    -  if (getsockname(socket_fd(mrb, self), (struct sockaddr *)&ss, &salen) != 0)
    -    mrb_sys_fail(mrb, "getsockname");
    -
    -  return mrb_str_new(mrb, (char*)&ss, salen);
    -}
    -
    -
    - -
    -

    - - #getsockoptObject - - - - - -

    - - - - -
    -
    -
    -
    -336
    -337
    -338
    -339
    -340
    -341
    -342
    -343
    -344
    -345
    -346
    -347
    -348
    -349
    -350
    -351
    -352
    -353
    -354
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 336
    -
    -static mrb_value
    -mrb_basicsocket_getsockopt(mrb_state *mrb, mrb_value self)
    -{
    -  char opt[8];
    -  int s;
    -  mrb_int family, level, optname;
    -  mrb_value c, data;
    -  socklen_t optlen;
    -
    -  mrb_get_args(mrb, "ii", &level, &optname);
    -  s = socket_fd(mrb, self);
    -  optlen = sizeof(opt);
    -  if (getsockopt(s, (int)level, (int)optname, opt, &optlen) == -1)
    -    mrb_sys_fail(mrb, "getsockopt");
    -  c = mrb_const_get(mrb, mrb_obj_value(mrb_class_get(mrb, "Socket")), mrb_intern_lit(mrb, "Option"));
    -  family = socket_family(s);
    -  data = mrb_str_new(mrb, opt, optlen);
    -  return mrb_funcall(mrb, c, "new", 4, mrb_fixnum_value(family), mrb_fixnum_value(level), mrb_fixnum_value(optname), data);
    -}
    -
    -
    - -
    -

    - - #local_addressObject - - - - - -

    -
    -

    def connect_address

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -191
    -192
    -193
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 191
    -
    -def local_address
    -  Addrinfo.new self.getsockname
    -end
    -
    -
    - -
    -

    - - #recvObject - - - - - -

    - - - - -
    -
    -
    -
    -356
    -357
    -358
    -359
    -360
    -361
    -362
    -363
    -364
    -365
    -366
    -367
    -368
    -369
    -370
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 356
    -
    -static mrb_value
    -mrb_basicsocket_recv(mrb_state *mrb, mrb_value self)
    -{
    -  ssize_t n;
    -  mrb_int maxlen, flags = 0;
    -  mrb_value buf;
    -
    -  mrb_get_args(mrb, "i|i", &maxlen, &flags);
    -  buf = mrb_str_buf_new(mrb, maxlen);
    -  n = recv(socket_fd(mrb, self), RSTRING_PTR(buf), (fsize_t)maxlen, (int)flags);
    -  if (n == -1)
    -    mrb_sys_fail(mrb, "recv");
    -  mrb_str_resize(mrb, buf, (mrb_int)n);
    -  return buf;
    -}
    -
    -
    - -
    -

    - - #recv_nonblock(maxlen, flags = 0) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -195
    -196
    -197
    -198
    -199
    -200
    -201
    -202
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 195
    -
    -def recv_nonblock(maxlen, flags=0)
    -  begin
    -    _setnonblock(true)
    -    recv(maxlen, flags)
    -  ensure
    -    _setnonblock(false)
    -  end
    -end
    -
    -
    - -
    -

    - - #remote_addressObject - - - - - -

    - - - - -
    -
    -
    -
    -204
    -205
    -206
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 204
    -
    -def remote_address
    -  Addrinfo.new self.getpeername
    -end
    -
    -
    - -
    -

    - - #sendObject - - - - - -

    -
    -

    recvmsg(maxlen, flags=0)

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -395
    -396
    -397
    -398
    -399
    -400
    -401
    -402
    -403
    -404
    -405
    -406
    -407
    -408
    -409
    -410
    -411
    -412
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 395
    -
    -static mrb_value
    -mrb_basicsocket_send(mrb_state *mrb, mrb_value self)
    -{
    -  ssize_t n;
    -  mrb_int flags;
    -  mrb_value dest, mesg;
    -
    -  dest = mrb_nil_value();
    -  mrb_get_args(mrb, "Si|S", &mesg, &flags, &dest);
    -  if (mrb_nil_p(dest)) {
    -    n = send(socket_fd(mrb, self), RSTRING_PTR(mesg), (fsize_t)RSTRING_LEN(mesg), (int)flags);
    -  } else {
    -    n = sendto(socket_fd(mrb, self), RSTRING_PTR(mesg), (fsize_t)RSTRING_LEN(mesg), (int)flags, (const struct sockaddr*)RSTRING_PTR(dest), (fsize_t)RSTRING_LEN(dest));
    -  }
    -  if (n == -1)
    -    mrb_sys_fail(mrb, "send");
    -  return mrb_fixnum_value((mrb_int)n);
    -}
    -
    -
    - -
    -

    - - #setsockoptObject - - - - - -

    -
    -

    sendmsg_nonblock

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -443
    -444
    -445
    -446
    -447
    -448
    -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
    -478
    -479
    -480
    -481
    -482
    -483
    -484
    -485
    -486
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 443
    -
    -static mrb_value
    -mrb_basicsocket_setsockopt(mrb_state *mrb, mrb_value self)
    -{
    -  int s;
    -  mrb_int argc, level = 0, optname;
    -  mrb_value optval, so;
    -
    -  argc = mrb_get_args(mrb, "o|io", &so, &optname, &optval);
    -  if (argc == 3) {
    -    if (!mrb_fixnum_p(so)) {
    -      mrb_raise(mrb, E_ARGUMENT_ERROR, "level is not an integer");
    -    }
    -    level = mrb_fixnum(so);
    -    if (mrb_string_p(optval)) {
    -      /* that's good */
    -    } 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)) {
    -      if (optname == IP_MULTICAST_TTL || optname == IP_MULTICAST_LOOP) {
    -        char uc = (char)mrb_fixnum(optval);
    -        optval = mrb_str_new(mrb, &uc, sizeof(uc));
    -      } else {
    -        mrb_int i = mrb_fixnum(optval);
    -        optval = mrb_str_new(mrb, (char*)&i, sizeof(i));
    -      }
    -    } else {
    -      mrb_raise(mrb, E_ARGUMENT_ERROR, "optval should be true, false, an integer, or a string");
    -    }
    -  } else if (argc == 1) {
    -    if (strcmp(mrb_obj_classname(mrb, so), "Socket::Option") != 0)
    -      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 (%i for 3)", argc);
    -  }
    -
    -  s = socket_fd(mrb, self);
    -  if (setsockopt(s, (int)level, (int)optname, RSTRING_PTR(optval), (socklen_t)RSTRING_LEN(optval)) == -1)
    -    mrb_sys_fail(mrb, "setsockopt");
    -  return mrb_fixnum_value(0);
    -}
    -
    -
    - -
    -

    - - #shutdownObject - - - - - -

    - - - - -
    -
    -
    -
    -488
    -489
    -490
    -491
    -492
    -493
    -494
    -495
    -496
    -497
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 488
    -
    -static mrb_value
    -mrb_basicsocket_shutdown(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int how = SHUT_RDWR;
    -
    -  mrb_get_args(mrb, "|i", &how);
    -  if (shutdown(socket_fd(mrb, self), (int)how) != 0)
    -    mrb_sys_fail(mrb, "shutdown");
    -  return mrb_fixnum_value(0);
    -}
    -
    -
    - -
    -

    - - #sysreadObject - - - - - -

    - - - - -
    -
    -
    -
    -782
    -783
    -784
    -785
    -786
    -787
    -788
    -789
    -790
    -791
    -792
    -793
    -794
    -795
    -796
    -797
    -798
    -799
    -800
    -801
    -802
    -803
    -804
    -805
    -806
    -807
    -808
    -809
    -810
    -811
    -812
    -813
    -814
    -815
    -816
    -817
    -818
    -819
    -820
    -821
    -822
    -823
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 782
    -
    -static mrb_value
    -mrb_win32_basicsocket_sysread(mrb_state *mrb, mrb_value self)
    -{
    -  int sd, ret;
    -  mrb_value buf = mrb_nil_value();
    -  mrb_int maxlen;
    -
    -  mrb_get_args(mrb, "i|S", &maxlen, &buf);
    -  if (maxlen < 0) {
    -    return mrb_nil_value();
    -  }
    -
    -  if (mrb_nil_p(buf)) {
    -    buf = mrb_str_new(mrb, NULL, maxlen);
    -  }
    -  if (RSTRING_LEN(buf) != maxlen) {
    -    buf = mrb_str_resize(mrb, buf, maxlen);
    -  }
    -
    -  sd = socket_fd(mrb, self);
    -  ret = recv(sd, RSTRING_PTR(buf), (int)maxlen, 0);
    -
    -  switch (ret) {
    -    case 0: /* EOF */
    -      if (maxlen == 0) {
    -        buf = mrb_str_new_cstr(mrb, "");
    -      } else {
    -        mrb_raise(mrb, E_EOF_ERROR, "sysread failed: End of File");
    -      }
    -      break;
    -    case SOCKET_ERROR: /* Error */
    -      mrb_sys_fail(mrb, "recv");
    -      break;
    -    default:
    -      if (RSTRING_LEN(buf) != ret) {
    -        buf = mrb_str_resize(mrb, buf, ret);
    -      }
    -      break;
    -  }
    -
    -  return buf;
    -}
    -
    -
    - -
    -

    - - #sysseekObject - - - - - -

    - - - - -
    -
    -
    -
    -825
    -826
    -827
    -828
    -829
    -830
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 825
    -
    -static mrb_value
    -mrb_win32_basicsocket_sysseek(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_raise(mrb, E_NOTIMP_ERROR, "sysseek not implemented for windows sockets");
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #syswriteObject - - - - - -

    - - - - -
    -
    -
    -
    -832
    -833
    -834
    -835
    -836
    -837
    -838
    -839
    -840
    -841
    -842
    -843
    -844
    -845
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 832
    -
    -static mrb_value
    -mrb_win32_basicsocket_syswrite(mrb_state *mrb, mrb_value self)
    -{
    -  int n;
    -  SOCKET sd;
    -  mrb_value str;
    -
    -  sd = socket_fd(mrb, self);
    -  mrb_get_args(mrb, "S", &str);
    -  n = send(sd, RSTRING_PTR(str), (int)RSTRING_LEN(str), 0);
    -  if (n == SOCKET_ERROR)
    -    mrb_sys_fail(mrb, "send");
    -  return mrb_fixnum_value(n);
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Comparable.html b/docs/api/Comparable.html deleted file mode 100644 index 6663d5a..0000000 --- a/docs/api/Comparable.html +++ /dev/null @@ -1,712 +0,0 @@ - - - - - - - Module: Comparable - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Module: Comparable - - - -

    -
    - - - - - - - - - -
    -
    Included in:
    -
    Numeric, String, Symbol
    -
    - - - -
    -
    Defined in:
    -
    mrblib/compar.rb,
    - mrbgems/mruby-compar-ext/mrblib/compar.rb
    -
    -
    - -
    - -

    Overview

    -
    -

    Comparable

    - -

    ISO 15.3.3

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

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #<(other) ⇒ Object - - - - - - - - - - - - - -

      Return true if +self+ is less than +other+.

      -
      - -
    • - - -
    • - - - #<=(other) ⇒ Object - - - - - - - - - - - - - -

      Return true if +self+ is less than or equal to +other+.

      -
      - -
    • - - -
    • - - - #==(other) ⇒ Object - - - - - - - - - - - - - -

      Return true if +self+ is equal to +other+.

      -
      - -
    • - - -
    • - - - #>(other) ⇒ Object - - - - - - - - - - - - - -

      Return true if +self+ is greater than +other+.

      -
      - -
    • - - -
    • - - - #>=(other) ⇒ Object - - - - - - - - - - - - - -

      Return true if +self+ is greater than or equal to +other+.

      -
      - -
    • - - -
    • - - - #between?(min, max) ⇒ Boolean - - - - - - - - - - - - - -

      Return true if +self+ is greater than or equal to +min+ and less than or equal to +max+.

      -
      - -
    • - - -
    • - - - #clamp(min, max) ⇒ Object - - - - - - - - - - - - - -

      Returns min if obj <=> min is less than zero, max if obj <=> max is greater than zero and obj otherwise.

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

    Instance Method Details

    - - -
    -

    - - #<(other) ⇒ Object - - - - - -

    -
    -

    Return true if +self+ is less -than +other+. Otherwise return -false.

    - -

    ISO 15.3.3.2.1

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -
    -
    # File 'mrblib/compar.rb', line 13
    -
    -def < other
    -  cmp = self <=> other
    -  if cmp.nil?
    -    raise ArgumentError, "comparison of #{self.class} with #{other.class} failed"
    -  end
    -  cmp < 0
    -end
    -
    -
    - -
    -

    - - #<=(other) ⇒ Object - - - - - -

    -
    -

    Return true if +self+ is less -than or equal to +other+. -Otherwise return false.

    - -

    ISO 15.3.3.2.2

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -
    -
    # File 'mrblib/compar.rb', line 27
    -
    -def <= other
    -  cmp = self <=> other
    -  if cmp.nil?
    -    raise ArgumentError, "comparison of #{self.class} with #{other.class} failed"
    -  end
    -  cmp <= 0
    -end
    -
    -
    - -
    -

    - - #==(other) ⇒ Object - - - - - -

    -
    -

    Return true if +self+ is equal -to +other+. Otherwise return -false.

    - -

    ISO 15.3.3.2.3

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -41
    -42
    -43
    -44
    -
    -
    # File 'mrblib/compar.rb', line 41
    -
    -def == other
    -  cmp = self <=> other
    -  cmp == 0
    -end
    -
    -
    - -
    -

    - - #>(other) ⇒ Object - - - - - -

    -
    -

    Return true if +self+ is greater -than +other+. Otherwise return -false.

    - -

    ISO 15.3.3.2.4

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -52
    -53
    -54
    -55
    -56
    -57
    -58
    -
    -
    # File 'mrblib/compar.rb', line 52
    -
    -def > other
    -  cmp = self <=> other
    -  if cmp.nil?
    -    raise ArgumentError, "comparison of #{self.class} with #{other.class} failed"
    -  end
    -  cmp > 0
    -end
    -
    -
    - -
    -

    - - #>=(other) ⇒ Object - - - - - -

    -
    -

    Return true if +self+ is greater -than or equal to +other+. -Otherwise return false.

    - -

    ISO 15.3.3.2.5

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -66
    -67
    -68
    -69
    -70
    -71
    -72
    -
    -
    # File 'mrblib/compar.rb', line 66
    -
    -def >= other
    -  cmp = self <=> other
    -  if cmp.nil?
    -    raise ArgumentError, "comparison of #{self.class} with #{other.class} failed"
    -  end
    -  cmp >= 0
    -end
    -
    -
    - -
    -

    - - #between?(min, max) ⇒ Boolean - - - - - -

    -
    -

    Return true if +self+ is greater -than or equal to +min+ and -less than or equal to +max+. -Otherwise return false.

    - -

    ISO 15.3.3.2.6

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -81
    -82
    -83
    -
    -
    # File 'mrblib/compar.rb', line 81
    -
    -def between?(min, max)
    -  self >= min and self <= max
    -end
    -
    -
    - -
    -

    - - #clamp(min, max) ⇒ Object - - - - - -

    -
    -

    Returns min if obj <=> min is less -than zero, max if obj <=> max is -greater than zero and obj otherwise.

    - -
    12.clamp(0, 100)         #=> 12
    -523.clamp(0, 100)        #=> 100
    --3.123.clamp(0, 100)     #=> 0
    -
    -'d'.clamp('a', 'f')      #=> 'd'
    -'z'.clamp('a', 'f')      #=> 'f'
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -
    -
    # File 'mrbgems/mruby-compar-ext/mrblib/compar.rb', line 14
    -
    -def clamp(min, max)
    -  if (min <=> max) > 0
    -    raise ArgumentError, "min argument must be smaller than max argument"
    -  end
    -  c = self <=> min
    -  if c == 0
    -    return self
    -  elsif c < 0
    -    return min
    -  end
    -  c = self <=> max
    -  if c > 0
    -    return max
    -  else
    -    return self
    -  end
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Complex.html b/docs/api/Complex.html deleted file mode 100644 index d48e821..0000000 --- a/docs/api/Complex.html +++ /dev/null @@ -1,1285 +0,0 @@ - - - - - - - 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 deleted file mode 100644 index 1f2ce9d..0000000 --- a/docs/api/EOFError.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - Exception: EOFError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: EOFError - - - -

    -
    - -
    -
    Inherits:
    -
    - IOError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-io/mrblib/io.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/Enumerable.html b/docs/api/Enumerable.html deleted file mode 100644 index a92c503..0000000 --- a/docs/api/Enumerable.html +++ /dev/null @@ -1,4782 +0,0 @@ - - - - - - - Module: Enumerable - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Module: Enumerable - - - -

    -
    - - - - - - - - - -
    -
    Included in:
    -
    Array, Enumerator, Enumerator::Chain, Enumerator::Generator, Hash, Range
    -
    - - - -
    -
    Defined in:
    -
    mrblib/enum.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
    -
    -
    - -
    - -

    Overview

    -
    -

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

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

    - Constant Summary - collapse -

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

    - Class Method Summary - collapse -

    - -
      - -
    • - - - .__update_hash ⇒ Object - - - - - - - - - - - - - -

      internal method __update_hash(oldhash, index, itemhash).

      -
      - -
    • - - -
    - -

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #all?(pat = NONE, &block) ⇒ Boolean - - - - - - - - - - - - - -
      - - - - - - - -
      ISO 15.3.2.2.1 call-seq: enum.all? [{objblock } ] -> true or false enum.all?(pattern) -> true or false.
      -
      - -
    • - - -
    • - - - #any?(pat = NONE, &block) ⇒ Boolean - - - - - - - - - - - - - -
      - - - - - - - -
      ISO 15.3.2.2.2 call-seq: enum.any? [{objblock }] -> true or false enum.any?(pattern) -> true or false.
      -
      - -
    • - - -
    • - - - #chain(*args) ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #collect(&block) ⇒ Object - - - - (also: #map) - - - - - - - - - - - -

      Call the given block for each element which is yield by +each+.

      -
      - -
    • - - -
    • - - - #count(v = NONE, &block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.count -> int enum.count(item) -> int enum.count {objblock } -> int.
      -
      - -
    • - - -
    • - - - #cycle(nv = nil, &block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.cycle(n=nil) {objblock } -> nil enum.cycle(n=nil) -> an_enumerator.
      -
      - -
    • - - -
    • - - - #detect(ifnone = nil, &block) ⇒ Object - - - - (also: #find) - - - - - - - - - - - -

      Return the first element for which value from the block is true.

      -
      - -
    • - - -
    • - - - #drop(n) ⇒ Object - - - - - - - - - - - - - -

      call-seq: enum.drop(n) -> array.

      -
      - -
    • - - -
    • - - - #drop_while(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.drop_while {arrblock } -> array enum.drop_while -> an_enumerator.
      -
      - -
    • - - -
    • - - - #each_cons(n, &block) ⇒ nil - - - - - - - - - - - - - -

      Iterates the given block for each array of consecutive elements.

      -
      - -
    • - - -
    • - - - #each_slice(n, &block) ⇒ nil - - - - - - - - - - - - - -

      Iterates the given block for each slice of elements.

      -
      - -
    • - - -
    • - - - #each_with_index(&block) ⇒ Object - - - - - - - - - - - - - -

      Call the given block for each element which is yield by +each+.

      -
      - -
    • - - -
    • - - - #each_with_object(obj, &block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.each_with_object(obj) {(*args), memo_obj… } -> obj enum.each_with_object(obj) -> an_enumerator.
      -
      - -
    • - - -
    • - - - #entries ⇒ Object - - - - (also: #to_a) - - - - - - - - - - - -

      Return an array of all elements which are yield by +each+.

      -
      - -
    • - - -
    • - - - #filter_map(&blk) ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #find_all(&block) ⇒ Object - - - - (also: #select) - - - - - - - - - - - -

      Call the given block for each element which is yield by +each+.

      -
      - -
    • - - -
    • - - - #find_index(val = NONE, &block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.find_index(value) -> int or nil enum.find_index {objblock } -> int or nil enum.find_index -> an_enumerator.
      -
      - -
    • - - -
    • - - - #first(*args) ⇒ Object - - - - - - - - - - - - - -

      call-seq: enum.first -> obj or nil enum.first(n) -> an_array.

      -
      - -
    • - - -
    • - - - #flat_map(&block) ⇒ Object - - - - (also: #collect_concat) - - - - - - - - - - - -
      - - - - - - - - - -
      call-seq: enum.flat_map {objblock } -> array enum.collect_concat {objblock } -> array enum.flat_map -> an_enumerator enum.collect_concat -> an_enumerator.
      -
      - -
    • - - -
    • - - - #grep(pattern, &block) ⇒ Object - - - - - - - - - - - - - -

      Call the given block for each element which is yield by +each+ and which return value was true when invoking === with +pattern+.

      -
      - -
    • - - -
    • - - - #group_by(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.group_by {objblock } -> a_hash enum.group_by -> an_enumerator.
      -
      - -
    • - - -
    • - - - #hash ⇒ Object - - - - - - - - - - - - - -

      redefine #hash 15.3.1.3.15.

      -
      - -
    • - - -
    • - - - #include?(obj) ⇒ Boolean - - - - (also: #member?) - - - - - - - - - - - -

      Return true if at least one element which is yield by +each+ returns a true value by invoking == with +obj+.

      -
      - -
    • - - -
    • - - - #inject(*args, &block) ⇒ Object - - - - (also: #reduce) - - - - - - - - - - - -

      Call the given block for each element which is yield by +each+.

      -
      - -
    • - - -
    • - - - #lazy ⇒ Object - - - - - - - - - - - - - -

      = Enumerable#lazy implementation.

      -
      - -
    • - - -
    • - - - #max(&block) ⇒ Object - - - - - - - - - - - - - -

      Return the maximum value of all elements yield by +each+.

      -
      - -
    • - - -
    • - - - #max_by(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.max_by {objblock } -> obj enum.max_by -> an_enumerator.
      -
      - -
    • - - -
    • - - - #min(&block) ⇒ Object - - - - - - - - - - - - - -

      Return the minimum value of all elements yield by +each+.

      -
      - -
    • - - -
    • - - - #min_by(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.min_by {objblock } -> obj enum.min_by -> an_enumerator.
      -
      - -
    • - - -
    • - - - #minmax(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.minmax -> [min, max] enum.minmax {a, bblock } -> [min, max].
      -
      - -
    • - - -
    • - - - #minmax_by(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.minmax_by {objblock } -> [min, max] enum.minmax_by -> an_enumerator.
      -
      - -
    • - - -
    • - - - #none?(pat = NONE, &block) ⇒ Boolean - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.none? [{objblock }] -> true or false enum.none?(pattern) -> true or false.
      -
      - -
    • - - -
    • - - - #one?(pat = NONE, &block) ⇒ Boolean - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.one? [{objblock }] -> true or false enum.one?(pattern) -> true or false.
      -
      - -
    • - - -
    • - - - #partition(&block) ⇒ Object - - - - - - - - - - - - - -

      Call the given block for each element which is yield by +each+.

      -
      - -
    • - - -
    • - - - #reject(&block) ⇒ Object - - - - - - - - - - - - - -

      Call the given block for each element which is yield by +each+.

      -
      - -
    • - - -
    • - - - #reverse_each(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.reverse_each {itemblock } -> enum enum.reverse_each -> an_enumerator.
      -
      - -
    • - - -
    • - - - #sort(&block) ⇒ Object - - - - - - - - - - - - - -

      Return a sorted array of all elements which are yield by +each+.

      -
      - -
    • - - -
    • - - - #sort_by(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.sort_by {objblock } -> array enum.sort_by -> an_enumerator.
      -
      - -
    • - - -
    • - - - #take(n) ⇒ Object - - - - - - - - - - - - - -

      call-seq: enum.take(n) -> array.

      -
      - -
    • - - -
    • - - - #take_while(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: enum.take_while {arrblock } -> array enum.take_while -> an_enumerator.
      -
      - -
    • - - -
    • - - - #tally ⇒ Object - - - - - - - - - - - - - -

      call-seq: enum.tally -> a_hash.

      -
      - -
    • - - -
    • - - - #to_h(&blk) ⇒ Object - - - - - - - - - - - - - -

      call-seq: enum.to_h -> hash.

      -
      - -
    • - - -
    • - - - #uniq(&block) ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #zip(*args, &block) ⇒ Object - - - - - - - - - - - - - -

      use Enumerator to use infinite sequence.

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

    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);
    -}
    -
    -
    - -
    - -
    -

    Instance Method Details

    - - -
    -

    - - #all?(pat = NONE, &block) ⇒ Boolean - - - - - -

    -
    -

    ISO 15.3.2.2.1 - call-seq: - enum.all? [{ |obj| block } ] -> true or false - enum.all?(pattern) -> true or false

    - -

    Passes each element of the collection to the given block. The method - returns true if the block never returns - false or nil. If the block is not given, - Ruby adds an implicit block of { |obj| obj } which will - cause #all? to return +true+ when none of the collection members are - +false+ or +nil+.

    - -

    If a pattern is supplied instead, the method returns whether - pattern === element for every collection member.

    - -
    %w[ant bear cat].all? { |word| word.length >= 3 } #=> true
    -%w[ant bear cat].all? { |word| word.length >= 4 } #=> false
    -%w[ant bear cat].all?(/t/)                        #=> false
    -[1, 2i, 3.14].all?(Numeric)                       #=> true
    -[nil, true, 99].all?                              #=> false
    -
    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -
    -
    # File 'mrblib/enum.rb', line 26
    -
    -def all?(&block)
    -  if block
    -    self.each{|*val| return false unless block.call(*val)}
    -  else
    -    self.each{|*val| return false unless val.__svalue}
    -  end
    -  true
    -end
    -
    -
    - -
    -

    - - #any?(pat = NONE, &block) ⇒ Boolean - - - - - -

    -
    -

    ISO 15.3.2.2.2 - call-seq: - enum.any? [{ |obj| block }] -> true or false - enum.any?(pattern) -> true or false

    - -

    Passes each element of the collection to the given block. The method - returns true if the block ever returns a value other - than false or nil. If the block is not - given, Ruby adds an implicit block of { |obj| obj } that - will cause #any? to return +true+ if at least one of the collection - members is not +false+ or +nil+.

    - -

    If a pattern is supplied instead, the method returns whether - pattern === element for any collection member.

    - -
    %w[ant bear cat].any? { |word| word.length >= 3 } #=> true
    -%w[ant bear cat].any? { |word| word.length >= 4 } #=> true
    -%w[ant bear cat].any?(/d/)                        #=> false
    -[nil, true, 99].any?(Integer)                     #=> true
    -[nil, true, 99].any?                              #=> true
    -[].any?                                           #=> false
    -
    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -43
    -44
    -45
    -46
    -47
    -48
    -49
    -50
    -
    -
    # File 'mrblib/enum.rb', line 43
    -
    -def any?(&block)
    -  if block
    -    self.each{|*val| return true if block.call(*val)}
    -  else
    -    self.each{|*val| return true if val.__svalue}
    -  end
    -  false
    -end
    -
    -
    - -
    -

    - - #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
    -
    -
    - -
    -

    - - #collect(&block) ⇒ Object - - - - Also known as: - map - - - - -

    -
    -

    Call the given block for each element -which is yield by +each+. Append all -values of each block together and -return this value.

    - -

    ISO 15.3.2.2.3

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -59
    -60
    -61
    -62
    -63
    -64
    -65
    -
    -
    # File 'mrblib/enum.rb', line 59
    -
    -def collect(&block)
    -  return to_enum :collect unless block
    -
    -  ary = []
    -  self.each{|*val| ary.push(block.call(*val))}
    -  ary
    -end
    -
    -
    - -
    -

    - - #count(v = NONE, &block) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.count -> int - enum.count(item) -> int - enum.count { |obj| block } -> int

    - -

    Returns the number of items in +enum+ through enumeration. -If an argument is given, the number of items in +enum+ that -are equal to +item+ are counted. If a block is given, it -counts the number of elements yielding a true value.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -249
    -250
    -251
    -252
    -253
    -254
    -255
    -256
    -257
    -258
    -259
    -260
    -261
    -262
    -263
    -264
    -265
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 249
    -
    -def count(v=NONE, &block)
    -  count = 0
    -  if block
    -    self.each do |*val|
    -      count += 1 if block.call(*val)
    -    end
    -  else
    -    if v == NONE
    -      self.each { count += 1 }
    -    else
    -      self.each do |*val|
    -        count += 1 if val.__svalue == v
    -      end
    -    end
    -  end
    -  count
    -end
    -
    -
    - -
    -

    - - #cycle(nv = nil, &block) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.cycle(n=nil) { |obj| block } -> nil - enum.cycle(n=nil) -> an_enumerator

    - -

    Calls block for each element of enum repeatedly n - times or forever if none or +nil+ is given. If a non-positive - number is given or the collection is empty, does nothing. Returns - +nil+ if the loop has finished without getting interrupted.

    - -

    Enumerable#cycle saves elements in an internal array so changes - to enum after the first pass have no effect.

    - -

    If no block is given, an enumerator is returned instead.

    - -
    a = ["a", "b", "c"]
    -a.cycle { |x| puts x }  # print, a, b, c, a, b, c,.. forever.
    -a.cycle(2) { |x| puts x }  # print, a, b, c, a, b, c.
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -664
    -665
    -666
    -667
    -668
    -669
    -670
    -671
    -672
    -673
    -674
    -675
    -676
    -677
    -678
    -679
    -680
    -681
    -682
    -683
    -684
    -685
    -686
    -687
    -688
    -689
    -690
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 664
    -
    -def cycle(nv = nil, &block)
    -  return to_enum(:cycle, nv) unless block
    -
    -  n = nil
    -
    -  if nv.nil?
    -    n = -1
    -  else
    -    n = nv.__to_int
    -    return nil if n <= 0
    -  end
    -
    -  ary = []
    -  each do |*i|
    -    ary.push(i)
    -    yield(*i)
    -  end
    -  return nil if ary.empty?
    -
    -  while n < 0 || 0 < (n -= 1)
    -    ary.each do |i|
    -      yield(*i)
    -    end
    -  end
    -
    -  nil
    -end
    -
    -
    - -
    -

    - - #detect(ifnone = nil, &block) ⇒ Object - - - - Also known as: - find - - - - -

    -
    -

    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

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -75
    -76
    -77
    -78
    -79
    -80
    -81
    -82
    -83
    -84
    -
    -
    # File 'mrblib/enum.rb', line 75
    -
    -def detect(ifnone=nil, &block)
    -  return to_enum :detect, ifnone unless block
    -
    -  self.each{|*val|
    -    if block.call(*val)
    -      return val.__svalue
    -    end
    -  }
    -  ifnone.call unless ifnone.nil?
    -end
    -
    -
    - -
    -

    - - #drop(n) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.drop(n) -> array

    - -

    Drops first n elements from enum, and returns rest elements -in an array.

    - -

    a = [1, 2, 3, 4, 5, 0] - a.drop(3) #=> [4, 5, 0]

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 15
    -
    -def drop(n)
    -  n = n.__to_int
    -  raise ArgumentError, "attempt to drop negative size" if n < 0
    -
    -  ary = []
    -  self.each {|*val| n == 0 ? ary << val.__svalue : n -= 1 }
    -  ary
    -end
    -
    -
    - -
    -

    - - #drop_while(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.drop_while {|arr| block } -> array - enum.drop_while -> an_enumerator

    - -

    Drops elements up to, but not including, the first element for -which the block returns +nil+ or +false+ and returns an array -containing the remaining elements.

    - -

    If no block is given, an enumerator is returned instead.

    - -

    a = [1, 2, 3, 4, 5, 0] - a.drop_while {|i| i < 3 } #=> [3, 4, 5, 0]

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -38
    -39
    -40
    -41
    -42
    -43
    -44
    -45
    -46
    -47
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 38
    -
    -def drop_while(&block)
    -  return to_enum :drop_while unless block
    -
    -  ary, state = [], false
    -  self.each do |*val|
    -    state = true if !state and !block.call(*val)
    -    ary << val.__svalue if state
    -  end
    -  ary
    -end
    -
    -
    - -
    -

    - - #each_cons(n, &block) ⇒ nil - - - - - -

    -
    -

    Iterates the given block for each array of consecutive -elements.

    - - -
    -
    -
    - -
    -

    Examples:

    - - -
    (1..10).each_cons(3) {|a| p a}
    -# outputs below
    -[1, 2, 3]
    -[2, 3, 4]
    -[3, 4, 5]
    -[4, 5, 6]
    -[5, 6, 7]
    -[6, 7, 8]
    -[7, 8, 9]
    -[8, 9, 10]
    - -
    - -

    Returns:

    -
      - -
    • - - - (nil) - - - -
    • - -
    -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -114
    -115
    -116
    -117
    -118
    -119
    -120
    -121
    -122
    -123
    -124
    -125
    -126
    -127
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 114
    -
    -def each_cons(n, &block)
    -  n = n.__to_int
    -  raise ArgumentError, "invalid size" if n <= 0
    -
    -  return to_enum(:each_cons,n) unless block
    -  ary = []
    -  n = n.to_i
    -  self.each do |*val|
    -    ary.shift if ary.size == n
    -    ary << val.__svalue
    -    block.call(ary.dup) if ary.size == n
    -  end
    -  nil
    -end
    -
    -
    - -
    -

    - - #each_slice(n, &block) ⇒ nil - - - - - -

    -
    -

    Iterates the given block for each slice of elements.

    - - -
    -
    -
    - -
    -

    Examples:

    - - -
    (1..10).each_slice(3) {|a| p a}
    -# outputs below
    -[1, 2, 3]
    -[4, 5, 6]
    -[7, 8, 9]
    -[10]
    - -
    - -

    Returns:

    -
      - -
    • - - - (nil) - - - -
    • - -
    -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -142
    -143
    -144
    -145
    -146
    -147
    -148
    -149
    -150
    -151
    -152
    -153
    -154
    -155
    -156
    -157
    -158
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 142
    -
    -def each_slice(n, &block)
    -  n = n.__to_int
    -  raise ArgumentError, "invalid slice size" if n <= 0
    -
    -  return to_enum(:each_slice,n) unless block
    -  ary = []
    -  n = n.to_i
    -  self.each do |*val|
    -    ary << val.__svalue
    -    if ary.size == n
    -      block.call(ary)
    -      ary = []
    -    end
    -  end
    -  block.call(ary) unless ary.empty?
    -  nil
    -end
    -
    -
    - -
    -

    - - #each_with_index(&block) ⇒ Object - - - - - -

    -
    -

    Call the given block for each element -which is yield by +each+. Pass an -index to the block which starts at 0 -and increase by 1 for each element.

    - -

    ISO 15.3.2.2.5

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -93
    -94
    -95
    -96
    -97
    -98
    -99
    -100
    -101
    -102
    -
    -
    # File 'mrblib/enum.rb', line 93
    -
    -def each_with_index(&block)
    -  return to_enum :each_with_index unless block
    -
    -  i = 0
    -  self.each{|*val|
    -    block.call(val.__svalue, i)
    -    i += 1
    -  }
    -  self
    -end
    -
    -
    - -
    -

    - - #each_with_object(obj, &block) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.each_with_object(obj) { |(*args), memo_obj| … } -> obj - enum.each_with_object(obj) -> an_enumerator

    - -

    Iterates the given block for each element with an arbitrary - object given, and returns the initially given object.

    - -

    If no block is given, returns an enumerator.

    - -
    (1..10).each_with_object([]) { |i, a| a << i*2 }
    -#=> [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -607
    -608
    -609
    -610
    -611
    -612
    -
    -
    # 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
    -
    -  self.each {|*val| block.call(val.__svalue, obj) }
    -  obj
    -end
    -
    -
    - -
    -

    - - #entriesObject - - - - Also known as: - to_a - - - - -

    -
    -

    Return an array of all elements which -are yield by +each+.

    - -

    ISO 15.3.2.2.6

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -109
    -110
    -111
    -112
    -113
    -114
    -115
    -116
    -
    -
    # File 'mrblib/enum.rb', line 109
    -
    -def entries
    -  ary = []
    -  self.each{|*val|
    -    # __svalue is an internal method
    -    ary.push val.__svalue
    -  }
    -  ary
    -end
    -
    -
    - -
    -

    - - #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 - - - - Also known as: - select - - - - -

    -
    -

    Call the given block for each element -which is yield by +each+. Return an array -which contains all elements whose block -value was true.

    - -

    ISO 15.3.2.2.8

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -131
    -132
    -133
    -134
    -135
    -136
    -137
    -138
    -139
    -
    -
    # File 'mrblib/enum.rb', line 131
    -
    -def find_all(&block)
    -  return to_enum :find_all unless block
    -
    -  ary = []
    -  self.each{|*val|
    -    ary.push(val.__svalue) if block.call(*val)
    -  }
    -  ary
    -end
    -
    -
    - -
    -

    - - #find_index(val = NONE, &block) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.find_index(value) -> int or nil - enum.find_index { |obj| block } -> int or nil - enum.find_index -> an_enumerator

    - -

    Compares each entry in enum with value or passes - to block. Returns the index for the first for which the - evaluated value is non-false. If no object matches, returns - nil

    - -

    If neither block nor argument is given, an enumerator is returned instead.

    - -
    (1..10).find_index  { |i| i % 5 == 0 and i % 7 == 0 }  #=> nil
    -(1..100).find_index { |i| i % 5 == 0 and i % 7 == 0 }  #=> 34
    -(1..100).find_index(50)                                #=> 49
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -710
    -711
    -712
    -713
    -714
    -715
    -716
    -717
    -718
    -719
    -720
    -721
    -722
    -723
    -724
    -725
    -726
    -
    -
    # 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
    -
    -  idx = 0
    -  if block
    -    self.each do |*e|
    -      return idx if block.call(*e)
    -      idx += 1
    -    end
    -  else
    -    self.each do |*e|
    -      return idx if e.__svalue == val
    -      idx += 1
    -    end
    -  end
    -  nil
    -end
    -
    -
    - -
    -

    - - #first(*args) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.first -> obj or nil - enum.first(n) -> an_array

    - -

    Returns the first element, or the first +n+ elements, of the enumerable. -If the enumerable is empty, the first form returns nil, and the -second form returns an empty array.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -216
    -217
    -218
    -219
    -220
    -221
    -222
    -223
    -224
    -225
    -226
    -227
    -228
    -229
    -230
    -231
    -232
    -233
    -234
    -235
    -236
    -237
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 216
    -
    -def first(*args)
    -  case args.length
    -  when 0
    -    self.each do |*val|
    -      return val.__svalue
    -    end
    -    return nil
    -  when 1
    -    i = args[0].__to_int
    -    raise ArgumentError, "attempt to take negative size" if i < 0
    -    ary = []
    -    return ary if i == 0
    -    self.each do |*val|
    -      ary << val.__svalue
    -      i -= 1
    -      break if i == 0
    -    end
    -    ary
    -  else
    -    raise ArgumentError, "wrong number of arguments (given #{args.length}, expected 0..1)"
    -  end
    -end
    -
    -
    - -
    -

    - - #flat_map(&block) ⇒ Object - - - - Also known as: - collect_concat - - - - -

    -
    -

    call-seq: - enum.flat_map { |obj| block } -> array - enum.collect_concat { |obj| block } -> array - enum.flat_map -> an_enumerator - enum.collect_concat -> an_enumerator

    - -

    Returns a new array with the concatenated results of running -block once for every element in enum.

    - -

    If no block is given, an enumerator is returned instead.

    - - - - - - - - - - - - - - -
    [1, 2, 3, 4].flat_map {e[e, -e] } #=> [1, -1, 2, -2, 3, -3, 4, -4]
    [[1, 2], [3, 4]].flat_map {ee + [100] } #=> [1, 2, 100, 3, 4, 100]
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -281
    -282
    -283
    -284
    -285
    -286
    -287
    -288
    -289
    -290
    -291
    -292
    -293
    -294
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 281
    -
    -def flat_map(&block)
    -  return to_enum :flat_map unless block
    -
    -  ary = []
    -  self.each do |*e|
    -    e2 = block.call(*e)
    -    if e2.respond_to? :each
    -      e2.each {|e3| ary.push(e3) }
    -    else
    -      ary.push(e2)
    -    end
    -  end
    -  ary
    -end
    -
    -
    - -
    -

    - - #grep(pattern, &block) ⇒ Object - - - - - -

    -
    -

    Call the given block for each element -which is yield by +each+ and which return -value was true when invoking === with -+pattern+. Return an array with all -elements or the respective block values.

    - -

    ISO 15.3.2.2.9

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -149
    -150
    -151
    -152
    -153
    -154
    -155
    -156
    -157
    -158
    -
    -
    # File 'mrblib/enum.rb', line 149
    -
    -def grep(pattern, &block)
    -  ary = []
    -  self.each{|*val|
    -    sv = val.__svalue
    -    if pattern === sv
    -      ary.push((block)? block.call(*val): sv)
    -    end
    -  }
    -  ary
    -end
    -
    -
    - -
    -

    - - #group_by(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.group_by {| obj | block } -> a_hash - enum.group_by -> an_enumerator

    - -

    Returns a hash, which keys are evaluated result from the -block, and values are arrays of elements in enum -corresponding to the key.

    - -
    (1..6).group_by {|i| i%3}   #=> {0=>[3, 6], 1=>[1, 4], 2=>[2, 5]}
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -171
    -172
    -173
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    -181
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 171
    -
    -def group_by(&block)
    -  return to_enum :group_by unless block
    -
    -  h = {}
    -  self.each do |*val|
    -    key = block.call(*val)
    -    sv = val.__svalue
    -    h.key?(key) ? (h[key] << sv) : (h[key] = [sv])
    -  end
    -  h
    -end
    -
    -
    - -
    -

    - - #hashObject - - - - - -

    -
    -

    redefine #hash 15.3.1.3.15

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -344
    -345
    -346
    -347
    -348
    -349
    -350
    -351
    -352
    -
    -
    # File 'mrblib/enum.rb', line 344
    -
    -def hash
    -  h = 12347
    -  i = 0
    -  self.each do |e|
    -    h = __update_hash(h, i, e.hash)
    -    i += 1
    -  end
    -  h
    -end
    -
    -
    - -
    -

    - - #include?(obj) ⇒ Boolean - - - - Also known as: - member? - - - - -

    -
    -

    Return true if at least one element which -is yield by +each+ returns a true value -by invoking == with +obj+. Otherwise return -false.

    - -

    ISO 15.3.2.2.10

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -167
    -168
    -169
    -170
    -171
    -172
    -
    -
    # File 'mrblib/enum.rb', line 167
    -
    -def include?(obj)
    -  self.each{|*val|
    -    return true if val.__svalue == obj
    -  }
    -  false
    -end
    -
    -
    - -
    -

    - - #inject(*args, &block) ⇒ Object - - - - Also known as: - reduce - - - - -

    -
    -

    Call the given block for each element -which is yield by +each+. Return value -is the sum of all block values. Pass -to each block the current sum and the -current element.

    - -

    ISO 15.3.2.2.11

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -182
    -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
    -
    -
    # File 'mrblib/enum.rb', line 182
    -
    -def inject(*args, &block)
    -  raise ArgumentError, "too many arguments" if args.size > 2
    -  if Symbol === args[-1]
    -    sym = args[-1]
    -    block = ->(x,y){x.__send__(sym,y)}
    -    args.pop
    -  end
    -  if args.empty?
    -    flag = true  # no initial argument
    -    result = nil
    -  else
    -    flag = false
    -    result = args[0]
    -  end
    -  self.each{|*val|
    -    val = val.__svalue
    -    if flag
    -      # push first element as initial
    -      flag = false
    -      result = val
    -    else
    -      result = block.call(result, val)
    -    end
    -  }
    -  result
    -end
    -
    -
    - -
    -

    - - #lazyObject - - - - - -

    -
    -

    = Enumerable#lazy implementation

    - -

    Enumerable#lazy returns an instance of Enumerator::Lazy. -You can use it just like as normal Enumerable object, -except these methods act as ‘lazy’:

    - -
      -
    • map collect
    • -
    • select find_all
    • -
    • reject
    • -
    • grep
    • -
    • drop
    • -
    • drop_while
    • -
    • take_while
    • -
    • flat_map collect_concat
    • -
    • zip
    • -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -18
    -19
    -20
    -
    -
    # File 'mrbgems/mruby-enum-lazy/mrblib/lazy.rb', line 18
    -
    -def lazy
    -  Enumerator::Lazy.new(self)
    -end
    -
    -
    - -
    -

    - - #max(&block) ⇒ Object - - - - - -

    -
    -

    Return the maximum value of all elements -yield by +each+. If no block is given <=> -will be invoked to define this value. If -a block is given it will be used instead.

    - -

    ISO 15.3.2.2.13

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -223
    -224
    -225
    -226
    -227
    -228
    -229
    -230
    -231
    -232
    -233
    -234
    -235
    -236
    -237
    -238
    -239
    -240
    -241
    -
    -
    # File 'mrblib/enum.rb', line 223
    -
    -def max(&block)
    -  flag = true  # 1st element?
    -  result = nil
    -  self.each{|*val|
    -    val = val.__svalue
    -    if flag
    -      # 1st element
    -      result = val
    -      flag = false
    -    else
    -      if block
    -        result = val if block.call(val, result) > 0
    -      else
    -        result = val if (val <=> result) > 0
    -      end
    -    end
    -  }
    -  result
    -end
    -
    -
    - -
    -

    - - #max_by(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.max_by {|obj| block } -> obj - enum.max_by -> an_enumerator

    - -

    Returns the object in enum that gives the maximum -value from the given block.

    - -

    If no block is given, an enumerator is returned instead.

    - - - - - - - - - -
    %w[albatross dog horse].max_by {xx.length } #=> “albatross”
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -309
    -310
    -311
    -312
    -313
    -314
    -315
    -316
    -317
    -318
    -319
    -320
    -321
    -322
    -323
    -324
    -325
    -326
    -327
    -328
    -329
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 309
    -
    -def max_by(&block)
    -  return to_enum :max_by unless block
    -
    -  first = true
    -  max = nil
    -  max_cmp = nil
    -
    -  self.each do |*val|
    -    if first
    -      max = val.__svalue
    -      max_cmp = block.call(*val)
    -      first = false
    -    else
    -      if (cmp = block.call(*val)) > max_cmp
    -        max = val.__svalue
    -        max_cmp = cmp
    -      end
    -    end
    -  end
    -  max
    -end
    -
    -
    - -
    -

    - - #min(&block) ⇒ Object - - - - - -

    -
    -

    Return the minimum value of all elements -yield by +each+. If no block is given <=> -will be invoked to define this value. If -a block is given it will be used instead.

    - -

    ISO 15.3.2.2.14

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -250
    -251
    -252
    -253
    -254
    -255
    -256
    -257
    -258
    -259
    -260
    -261
    -262
    -263
    -264
    -265
    -266
    -267
    -268
    -
    -
    # File 'mrblib/enum.rb', line 250
    -
    -def min(&block)
    -  flag = true  # 1st element?
    -  result = nil
    -  self.each{|*val|
    -    val = val.__svalue
    -    if flag
    -      # 1st element
    -      result = val
    -      flag = false
    -    else
    -      if block
    -        result = val if block.call(val, result) < 0
    -      else
    -        result = val if (val <=> result) < 0
    -      end
    -    end
    -  }
    -  result
    -end
    -
    -
    - -
    -

    - - #min_by(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.min_by {|obj| block } -> obj - enum.min_by -> an_enumerator

    - -

    Returns the object in enum that gives the minimum -value from the given block.

    - -

    If no block is given, an enumerator is returned instead.

    - - - - - - - - - -
    %w[albatross dog horse].min_by {xx.length } #=> “dog”
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -343
    -344
    -345
    -346
    -347
    -348
    -349
    -350
    -351
    -352
    -353
    -354
    -355
    -356
    -357
    -358
    -359
    -360
    -361
    -362
    -363
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 343
    -
    -def min_by(&block)
    -  return to_enum :min_by unless block
    -
    -  first = true
    -  min = nil
    -  min_cmp = nil
    -
    -  self.each do |*val|
    -    if first
    -      min = val.__svalue
    -      min_cmp = block.call(*val)
    -      first = false
    -    else
    -      if (cmp = block.call(*val)) < min_cmp
    -        min = val.__svalue
    -        min_cmp = cmp
    -      end
    -    end
    -  end
    -  min
    -end
    -
    -
    - -
    -

    - - #minmax(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.minmax -> [min, max] - enum.minmax { |a, b| block } -> [min, max]

    - -

    Returns two elements array which contains the minimum and the - maximum value in the enumerable. The first form assumes all - objects implement Comparable; the second uses the - block to return a <=> b.

    - -
    a = %w(albatross dog horse)
    -a.minmax                                  #=> ["albatross", "horse"]
    -a.minmax { |a, b| a.length <=> b.length } #=> ["dog", "albatross"]
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -379
    -380
    -381
    -382
    -383
    -384
    -385
    -386
    -387
    -388
    -389
    -390
    -391
    -392
    -393
    -394
    -395
    -396
    -397
    -398
    -399
    -400
    -401
    -402
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 379
    -
    -def minmax(&block)
    -  max = nil
    -  min = nil
    -  first = true
    -
    -  self.each do |*val|
    -    if first
    -      val = val.__svalue
    -      max = val
    -      min = val
    -      first = false
    -    else
    -      val = val.__svalue
    -      if block
    -        max = val if block.call(val, max) > 0
    -        min = val if block.call(val, min) < 0
    -      else
    -        max = val if (val <=> max) > 0
    -        min = val if (val <=> min) < 0
    -      end
    -    end
    -  end
    -  [min, max]
    -end
    -
    -
    - -
    -

    - - #minmax_by(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.minmax_by { |obj| block } -> [min, max] - enum.minmax_by -> an_enumerator

    - -

    Returns a two element array containing the objects in - enum that correspond to the minimum and maximum values respectively - from the given block.

    - -

    If no block is given, an enumerator is returned instead.

    - -
    %w(albatross dog horse).minmax_by { |x| x.length }   #=> ["dog", "albatross"]
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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-enum-ext/mrblib/enum.rb', line 417
    -
    -def minmax_by(&block)
    -  return to_enum :minmax_by unless block
    -
    -  max = nil
    -  max_cmp = nil
    -  min = nil
    -  min_cmp = nil
    -  first = true
    -
    -  self.each do |*val|
    -    if first
    -      max = min = val.__svalue
    -      max_cmp = min_cmp = block.call(*val)
    -      first = false
    -   else
    -      if (cmp = block.call(*val)) > max_cmp
    -        max = val.__svalue
    -        max_cmp = cmp
    -      end
    -      if (cmp = block.call(*val)) < min_cmp
    -        min = val.__svalue
    -        min_cmp = cmp
    -      end
    -    end
    -  end
    -  [min, max]
    -end
    -
    -
    - -
    -

    - - #none?(pat = NONE, &block) ⇒ Boolean - - - - - -

    -
    -

    call-seq: - enum.none? [{ |obj| block }] -> true or false - enum.none?(pattern) -> true or false

    - -

    Passes each element of the collection to the given block. The method - returns true if the block never returns true - for all elements. If the block is not given, none? will return - true only if none of the collection members is true.

    - -

    If a pattern is supplied instead, the method returns whether - pattern === element for none of the collection members.

    - -
    %w(ant bear cat).none? { |word| word.length == 5 } #=> true
    -%w(ant bear cat).none? { |word| word.length >= 4 } #=> false
    -%w{ant bear cat}.none?(/d/)                        #=> true
    -[1, 3.14, 42].none?(Float)                         #=> false
    -[].none?                                           #=> true
    -[nil, false].none?                                 #=> true
    -[nil, true].none?                                  #=> false
    -
    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -466
    -467
    -468
    -469
    -470
    -471
    -472
    -473
    -474
    -475
    -476
    -477
    -478
    -479
    -480
    -481
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 466
    -
    -def none?(pat=NONE, &block)
    -  if pat != NONE
    -    self.each do |*val|
    -      return false if pat === val.__svalue
    -    end
    -  elsif block
    -    self.each do |*val|
    -      return false if block.call(*val)
    -    end
    -  else
    -    self.each do |*val|
    -      return false if val.__svalue
    -    end
    -  end
    -  true
    -end
    -
    -
    - -
    -

    - - #one?(pat = NONE, &block) ⇒ Boolean - - - - - -

    -
    -

    call-seq: - enum.one? [{ |obj| block }] -> true or false - enum.one?(pattern) -> true or false

    - -

    Passes each element of the collection to the given block. The method -returns true if the block returns true -exactly once. If the block is not given, one? will return -true only if exactly one of the collection members is -true.

    - -

    If a pattern is supplied instead, the method returns whether -pattern === element for exactly one collection member.

    - -

    %w(ant bear cat).one? { |word| word.length == 4 } #=> true - %w(ant bear cat).one? { |word| word.length > 4 } #=> false - %w(ant bear cat).one? { |word| word.length < 4 } #=> false - %wbear cat.one?(/t/) #=> false - [nil, true, 99].one? #=> false - [nil, true, false].one? #=> true - [ nil, true, 99 ].one?(Integer) #=> true - [].one? #=> false

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -506
    -507
    -508
    -509
    -510
    -511
    -512
    -513
    -514
    -515
    -516
    -517
    -518
    -519
    -520
    -521
    -522
    -523
    -524
    -525
    -526
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 506
    -
    -def one?(pat=NONE, &block)
    -  count = 0
    -  if pat!=NONE
    -    self.each do |*val|
    -      count += 1 if pat === val.__svalue
    -      return false if count > 1
    -    end
    -  elsif block
    -    self.each do |*val|
    -      count += 1 if block.call(*val)
    -      return false if count > 1
    -    end
    -  else
    -    self.each do |*val|
    -      count += 1 if val.__svalue
    -      return false if count > 1
    -    end
    -  end
    -
    -  count == 1 ? true : false
    -end
    -
    -
    - -
    -

    - - #partition(&block) ⇒ Object - - - - - -

    -
    -

    Call the given block for each element -which is yield by +each+. Return an -array which contains two arrays. The -first array contains all elements -whose block value was true. The second -array contains all elements whose -block value was false.

    - -

    ISO 15.3.2.2.16

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -286
    -287
    -288
    -289
    -290
    -291
    -292
    -293
    -294
    -295
    -296
    -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|
    -    if block.call(*val)
    -      ary_T.push(val.__svalue)
    -    else
    -      ary_F.push(val.__svalue)
    -    end
    -  }
    -  [ary_T, ary_F]
    -end
    -
    -
    - -
    -

    - - #reject(&block) ⇒ Object - - - - - -

    -
    -

    Call the given block for each element -which is yield by +each+. Return an -array which contains only the elements -whose block value was false.

    - -

    ISO 15.3.2.2.17

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -308
    -309
    -310
    -311
    -312
    -313
    -314
    -315
    -316
    -
    -
    # 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)
    -  }
    -  ary
    -end
    -
    -
    - -
    -

    - - #reverse_each(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.reverse_each { |item| block } -> enum - enum.reverse_each -> an_enumerator

    - -

    Builds a temporary array and traverses that array in reverse order.

    - -

    If no block is given, an enumerator is returned instead.

    - -
     (1..3).reverse_each { |v| p v }
    -
    - -

    produces:

    - -
     3
    - 2
    - 1
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -632
    -633
    -634
    -635
    -636
    -637
    -638
    -639
    -640
    -641
    -642
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 632
    -
    -def reverse_each(&block)
    -  return to_enum :reverse_each unless block
    -
    -  ary = self.to_a
    -  i = ary.size - 1
    -  while i>=0
    -    block.call(ary[i])
    -    i -= 1
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #sort(&block) ⇒ Object - - - - - -

    -
    -

    Return a sorted array of all elements -which are yield by +each+. If no block -is given <=> will be invoked on each -element to define the order. Otherwise -the given block will be used for -sorting.

    - -

    ISO 15.3.2.2.19

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -333
    -334
    -335
    -
    -
    # File 'mrblib/enum.rb', line 333
    -
    -def sort(&block)
    -  self.map{|*val| val.__svalue}.sort(&block)
    -end
    -
    -
    - -
    -

    - - #sort_by(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.sort_by { |obj| block } -> array - enum.sort_by -> an_enumerator

    - -

    Sorts enum using a set of keys generated by mapping the -values in enum through the given block.

    - -

    If no block is given, an enumerator is returned instead.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -193
    -194
    -195
    -196
    -197
    -198
    -199
    -200
    -201
    -202
    -203
    -204
    -205
    -206
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 193
    -
    -def sort_by(&block)
    -  return to_enum :sort_by unless block
    -
    -  ary = []
    -  orig = []
    -  self.each_with_index{|e, i|
    -    orig.push(e)
    -    ary.push([block.call(e), i])
    -  }
    -  if ary.size > 1
    -    ary.sort!
    -  end
    -  ary.collect{|e,i| orig[i]}
    -end
    -
    -
    - -
    -

    - - #take(n) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.take(n) -> array

    - -

    Returns first n elements from enum.

    - -

    a = [1, 2, 3, 4, 5, 0] - a.take(3) #=> [1, 2, 3]

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -58
    -59
    -60
    -61
    -62
    -63
    -64
    -65
    -66
    -67
    -68
    -69
    -70
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 58
    -
    -def take(n)
    -  n = n.__to_int
    -  i = n.to_i
    -  raise ArgumentError, "attempt to take negative size" if i < 0
    -  ary = []
    -  return ary if i == 0
    -  self.each do |*val|
    -    ary << val.__svalue
    -    i -= 1
    -    break if i == 0
    -  end
    -  ary
    -end
    -
    -
    - -
    -

    - - #take_while(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - enum.take_while {|arr| block } -> array - enum.take_while -> an_enumerator

    - -

    Passes elements to the block until the block returns +nil+ or +false+, -then stops iterating and returns an array of all prior elements.

    - -

    If no block is given, an enumerator is returned instead.

    - -
    a = [1, 2, 3, 4, 5, 0]
    -a.take_while {|i| i < 3 }   #=> [1, 2]
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -85
    -86
    -87
    -88
    -89
    -90
    -91
    -92
    -93
    -94
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 85
    -
    -def take_while(&block)
    -  return to_enum :take_while unless block
    -
    -  ary = []
    -  self.each do |*val|
    -    return ary unless block.call(*val)
    -    ary << val.__svalue
    -  end
    -  ary
    -end
    -
    -
    - -
    -

    - - #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 - - - - - -

    -
    -

    call-seq: - enum.to_h -> hash

    - -

    Returns the result of interpreting enum as a list of - [key, value] pairs.

    - -
    %i[hello world].each_with_index.to_h
    -  # => {:hello => 0, :world => 1}
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -794
    -795
    -796
    -797
    -798
    -799
    -800
    -801
    -802
    -803
    -804
    -805
    -806
    -807
    -808
    -809
    -810
    -811
    -812
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 794
    -
    -def to_h(&blk)
    -  h = {}
    -  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
    -
    -
    - -
    -

    - - #uniq(&block) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -814
    -815
    -816
    -817
    -818
    -819
    -820
    -821
    -822
    -823
    -824
    -825
    -826
    -827
    -828
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 814
    -
    -def uniq(&block)
    -  hash = {}
    -  if block
    -    self.each do|*v|
    -      v = v.__svalue
    -      hash[block.call(v)] ||= v
    -    end
    -  else
    -    self.each do|*v|
    -      v = v.__svalue
    -      hash[v] ||= v
    -    end
    -  end
    -  hash.values
    -end
    -
    -
    - -
    -

    - - #zip(*args, &block) ⇒ Object - - - - - -

    -
    -

    use Enumerator to use infinite sequence

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -755
    -756
    -757
    -758
    -759
    -760
    -761
    -762
    -763
    -764
    -765
    -766
    -767
    -768
    -769
    -770
    -771
    -772
    -773
    -774
    -775
    -776
    -777
    -778
    -779
    -780
    -781
    -
    -
    # File 'mrbgems/mruby-enum-ext/mrblib/enum.rb', line 755
    -
    -def zip(*arg, &block)
    -  result = block ? nil : []
    -  arg = arg.map do |a|
    -    unless a.respond_to?(:to_a)
    -      raise TypeError, "wrong argument type #{a.class} (must respond to :to_a)"
    -    end
    -    a.to_a
    -  end
    -
    -  i = 0
    -  self.each do |*val|
    -    a = []
    -    a.push(val.__svalue)
    -    idx = 0
    -    while idx < arg.size
    -      a.push(arg[idx][i])
    -      idx += 1
    -    end
    -    i += 1
    -    if result.nil?
    -      block.call(a)
    -    else
    -      result.push(a)
    -    end
    -  end
    -  result
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Enumerator.html b/docs/api/Enumerator.html deleted file mode 100644 index 17cfd82..0000000 --- a/docs/api/Enumerator.html +++ /dev/null @@ -1,2149 +0,0 @@ - - - - - - - Class: Enumerator - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Enumerator - - - -

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

    Overview

    -
    -

    A class which allows both internal and external iteration.

    - -

    An Enumerator can be created by the following methods. -- Kernel#to_enum -- Kernel#enum_for -- Enumerator.new

    - -

    Most methods have two forms: a block form where the contents -are evaluated for each item in the enumeration, and a non-block form -which returns a new Enumerator wrapping the iteration.

    - -
      enumerator = %w(one two three).each
    -  puts enumerator.class # => Enumerator
    -
    -  enumerator.each_with_object("foo") do |item, obj|
    -    puts "#{obj}: #{item}"
    -  end
    -
    -  # foo: one
    -  # foo: two
    -  # foo: three
    -
    -  enum_with_obj = enumerator.each_with_object("foo")
    -  puts enum_with_obj.class # => Enumerator
    -
    -  enum_with_obj.each do |item, obj|
    -    puts "#{obj}: #{item}"
    -  end
    -
    -  # foo: one
    -  # foo: two
    -  # foo: three
    -
    - -

    This allows you to chain Enumerators together. For example, you -can map a list’s elements to strings containing the index -and the element as a string via:

    - -
      puts %w[foo bar baz].map.with_index { |w, i| "#{i}:#{w}" }
    -  # => ["0:foo", "1:bar", "2:baz"]
    -
    - -

    An Enumerator can also be used as an external iterator. -For example, Enumerator#next returns the next value of the iterator -or raises StopIteration if the Enumerator is at the end.

    - -
      e = [1,2,3].each   # returns an enumerator object.
    -  puts e.next   # => 1
    -  puts e.next   # => 2
    -  puts e.next   # => 3
    -  puts e.next   # raises StopIteration
    -
    - -

    You can use this to implement an internal iterator as follows:

    - -
      def ext_each(e)
    -    while true
    -      begin
    -        vs = e.next_values
    -      rescue StopIteration
    -        return $!.result
    -      end
    -      y = yield(*vs)
    -      e.feed y
    -    end
    -  end
    -
    -  o = Object.new
    -
    -  def o.each
    -    puts yield
    -    puts yield(1)
    -    puts yield(1, 2)
    -    3
    -  end
    -
    -  # use o.each as an internal iterator directly.
    -  puts o.each {|*x| puts x; [:b, *x] }
    -  # => [], [:b], [1], [:b, 1], [1, 2], [:b, 1, 2], 3
    -
    -  # convert o.each to an external iterator for
    -  # implementing an internal iterator.
    -  puts ext_each(o.to_enum) {|*x| puts x; [:b, *x] }
    -  # => [], [:b], [1], [:b, 1], [1, 2], [:b, 1, 2], 3
    -
    - - -
    -
    -
    - - -
    - -
    -

    Direct Known Subclasses

    -

    Lazy

    -
    -

    Defined Under Namespace

    -

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

    - - - -

    Constant Summary

    - -

    Constants included - from Enumerable

    -

    Enumerable::NONE

    - - -

    Instance Attribute Summary collapse

    -
      - -
    • - - - #args ⇒ Object - - - - - - - - - - - - - - - - -

      Returns the value of attribute args.

      -
      - -
    • - - -
    • - - - #fib ⇒ Object - - - - - - - - - readonly - - - - - - - - - -

      Returns the value of attribute fib.

      -
      - -
    • - - -
    • - - - #meth ⇒ Object - - - - - - - - - - - - - - - - -

      Returns the value of attribute meth.

      -
      - -
    • - - -
    • - - - #obj ⇒ Object - - - - - - - - - - - - - - - - -

      Returns the value of attribute obj.

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

    - Class Method Summary - collapse -

    - - - -

    - 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_object, #entries, #filter_map, #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, #tally, #to_h, #uniq, #zip

    -
    -

    Constructor Details

    - -
    -

    - - #initialize(obj, method = :each, *args) ⇒ Enumerator - - - - - -

    -
    -

    Creates a new Enumerator object, which can be used as an -Enumerable.

    - -

    In the first form, iteration is defined by the given block, in -which a “yielder” object, given as block parameter, can be used to -yield a value by calling the +yield+ method (aliased as +«+):

    - -
    fib = Enumerator.new do |y|
    -  a = b = 1
    -  loop do
    -    y << a
    -    a, b = b, a + b
    -  end
    -end
    -
    -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.

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -117
    -118
    -119
    -120
    -121
    -122
    -123
    -124
    -125
    -126
    -127
    -128
    -129
    -130
    -131
    -132
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 117
    -
    -def initialize(obj=NONE, meth=:each, *args, &block)
    -  if block
    -    obj = Generator.new(&block)
    -  elsif obj == NONE
    -    raise ArgumentError, "wrong number of arguments (given 0, expected 1+)"
    -  end
    -
    -  @obj = obj
    -  @meth = meth
    -  @args = args
    -  @fib = nil
    -  @dst = nil
    -  @lookahead = nil
    -  @feedvalue = nil
    -  @stop_exc = false
    -end
    -
    -
    - -
    - -
    -

    Instance Attribute Details

    - - - -
    -

    - - #argsObject - - - - - -

    -
    -

    Returns the value of attribute args

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -133
    -134
    -135
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 133
    -
    -def args
    -  @args
    -end
    -
    -
    - - - -
    -

    - - #fibObject (readonly) - - - - - -

    -
    -

    Returns the value of attribute fib

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -134
    -135
    -136
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 134
    -
    -def fib
    -  @fib
    -end
    -
    -
    - - - -
    -

    - - #methObject - - - - - -

    -
    -

    Returns the value of attribute meth

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -133
    -134
    -135
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 133
    -
    -def meth
    -  @meth
    -end
    -
    -
    - - - -
    -

    - - #objObject - - - - - -

    -
    -

    Returns the value of attribute obj

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -133
    -134
    -135
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 133
    -
    -def obj
    -  @obj
    -end
    -
    -
    - -
    - - -
    -

    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

    - - -
    -

    - - #+(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 - - - - - -

    -
    -

    call-seq: - enum.each { |elm| block } -> obj - enum.each -> enum - enum.each(appending_args) { |elm| block } -> obj - enum.each(appending_args) -> an_enumerator

    - -

    Iterates over the block according to how this Enumerator was constructed. -If no block and no arguments are given, returns self.

    - -

    === Examples

    - -

    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

    - -

    def obj.each_arg(a, b=:b, *rest) - yield a - yield b - yield rest - :method_returned - end

    - -

    enum = obj.to_enum :each_arg, :a, :x

    - -

    enum.each.to_a #=> [:a, :x, []] - enum.each.equal?(enum) #=> true - enum.each { |elm| elm } #=> :method_returned

    - -

    enum.each(:y, :z).to_a #=> [:a, :x, [:y, :z]] - enum.each(:y, :z).equal?(enum) #=> false - enum.each(:y, :z) { |elm| elm } #=> :method_returned

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -270
    -271
    -272
    -273
    -274
    -275
    -276
    -277
    -278
    -279
    -280
    -281
    -282
    -283
    -284
    -285
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 270
    -
    -def each(*argv, &block)
    -  obj = self
    -  if 0 < argv.length
    -    obj = self.dup
    -    args = obj.args
    -    if !args.empty?
    -      args = args.dup
    -      args.concat argv
    -    else
    -      args = argv.dup
    -    end
    -    obj.args = args
    -  end
    -  return obj unless block
    -  enumerator_block_call(&block)
    -end
    -
    -
    - -
    -

    - - #each_with_index(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - e.each_with_index {|(*args), idx| … } - e.each_with_index

    - -

    Same as Enumerator#with_index(0), i.e. there is no starting offset.

    - -

    If no block is given, a new Enumerator is returned that includes the index.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -184
    -185
    -186
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 184
    -
    -def each_with_index(&block)
    -  with_index(0, &block)
    -end
    -
    -
    - -
    -

    - - #feed(value) ⇒ Object - - - - - -

    -
    -

    call-seq: - e.feed obj -> nil

    - -

    Sets the value to be returned by the next yield inside +e+.

    - -

    If the value is not set, the yield returns nil.

    - -

    This value is cleared after being yielded.

    - -

    # Array#map passes the array’s elements to “yield” and collects the - # results of “yield” as an array. - # Following example shows that “next” returns the passed elements and - # values passed to “feed” are collected as an array which can be - # obtained by StopIteration#result. - e = [1,2,3].map - p e.next #=> 1 - e.feed “a” - p e.next #=> 2 - e.feed “b” - p e.next #=> 3 - e.feed “c” - begin - e.next - rescue StopIteration - p $!.result #=> [“a”, “b”, “c”] - end

    - -

    o = Object.new - def o.each - x = yield # (2) blocks - p x # (5) => “foo” - x = yield # (6) blocks - p x # (8) => nil - x = yield # (9) blocks - p x # not reached w/o another e.next - end

    - -

    e = o.to_enum - e.next # (1) - e.feed “foo” # (3) - e.next # (4) - e.next # (7) - # (10)

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -520
    -521
    -522
    -523
    -524
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 520
    -
    -def feed(value)
    -  raise TypeError, "feed value already set" if @feedvalue
    -  @feedvalue = value
    -  nil
    -end
    -
    -
    - -
    -

    - - #initialize_copy(obj) ⇒ Object - - - - - -

    -
    - - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -136
    -137
    -138
    -139
    -140
    -141
    -142
    -143
    -144
    -145
    -146
    -
    -
    # 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
    -  raise TypeError, "can't copy execution context" if obj.fib
    -  @obj = obj.obj
    -  @meth = obj.meth
    -  @args = obj.args
    -  @fib = nil
    -  @lookahead = nil
    -  @feedvalue = nil
    -  self
    -end
    -
    -
    - -
    -

    - - #inspectObject - - - - - -

    - - - - -
    -
    -
    -
    -225
    -226
    -227
    -228
    -229
    -230
    -231
    -232
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 225
    -
    -def inspect
    -  if @args && @args.size > 0
    -    args = @args.join(", ")
    -    "#<#{self.class}: #{@obj.inspect}:#{@meth}(#{args})>"
    -  else
    -    "#<#{self.class}: #{@obj.inspect}:#{@meth}>"
    -  end
    -end
    -
    -
    - -
    -

    - - #nextObject - - - - - -

    -
    -

    call-seq: - e.next -> object

    - -

    Returns the next object in the enumerator, and move the internal position -forward. When the position reached at the end, StopIteration is raised.

    - -

    === Example

    - -

    a = [1,2,3] - e = a.to_enum - p e.next #=> 1 - p e.next #=> 2 - p e.next #=> 3 - p e.next #raises StopIteration

    - -

    Note that enumeration sequence by +next+ does not affect other non-external -enumeration methods, unless the underlying iteration methods itself has -side-effect

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -312
    -313
    -314
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 312
    -
    -def next
    -  next_values.__svalue
    -end
    -
    -
    - -
    -

    - - #next_valuesObject - - - - - -

    -
    -

    call-seq: - e.next_values -> array

    - -

    Returns the next object as an array in the enumerator, and move the -internal position forward. When the position reached at the end, -StopIteration is raised.

    - -

    This method can be used to distinguish yield and yield -nil.

    - -

    === Example

    - -

    o = Object.new - def o.each - yield - yield 1 - yield 1, 2 - yield nil - yield [1, 2] - end - e = o.to_enum - p e.next_values - p e.next_values - p e.next_values - p e.next_values - p e.next_values - e = o.to_enum - p e.next - p e.next - p e.next - p e.next - p e.next

    - -

    ## yield args next_values next - # yield [] nil - # yield 1 [1] 1 - # yield 1, 2 [1, 2] [1, 2] - # yield nil [nil] nil - # yield [1, 2] [[1, 2]] [1, 2]

    - -

    Note that +next_values+ does not affect other non-external enumeration -methods unless underlying iteration method itself has side-effect

    - - -
    -
    -
    - -

    Raises:

    -
      - -
    • - - - (@stop_exc) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -360
    -361
    -362
    -363
    -364
    -365
    -366
    -367
    -368
    -369
    -370
    -371
    -372
    -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
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 360
    -
    -def next_values
    -  if @lookahead
    -    vs = @lookahead
    -    @lookahead = nil
    -    return vs
    -  end
    -  raise @stop_exc if @stop_exc
    -
    -  curr = Fiber.current
    -
    -  if !@fib || !@fib.alive?
    -    @dst = curr
    -    @fib = Fiber.new do
    -      result = each do |*args|
    -        feedvalue = nil
    -        Fiber.yield args
    -        if @feedvalue
    -          feedvalue = @feedvalue
    -          @feedvalue = nil
    -        end
    -        feedvalue
    -      end
    -      @stop_exc = StopIteration.new "iteration reached an end"
    -      @stop_exc.result = result
    -      Fiber.yield nil
    -    end
    -    @lookahead = nil
    -  end
    -
    -  vs = @fib.resume curr
    -  if @stop_exc
    -    @fib = nil
    -    @dst = nil
    -    @lookahead = nil
    -    @feedvalue = nil
    -    raise @stop_exc
    -  end
    -  vs
    -end
    -
    -
    - -
    -

    - - #peekObject - - - - - -

    -
    -

    call-seq: - e.peek -> object

    - -

    Returns the next object in the enumerator, but doesn’t move the internal -position forward. If the position is already at the end, StopIteration -is raised.

    - -

    === Example

    - -

    a = [1,2,3] - e = a.to_enum - p e.next #=> 1 - p e.peek #=> 2 - p e.peek #=> 2 - p e.peek #=> 2 - p e.next #=> 2 - p e.next #=> 3 - p e.next #raises StopIteration

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -420
    -421
    -422
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 420
    -
    -def peek
    -  peek_values.__svalue
    -end
    -
    -
    - -
    -

    - - #peek_valuesObject - - - - - -

    -
    -

    call-seq: - e.peek_values -> array

    - -

    Returns the next object as an array, similar to Enumerator#next_values, but -doesn’t move the internal position forward. If the position is already at -the end, StopIteration is raised.

    - -

    === Example

    - -

    o = Object.new - def o.each - yield - yield 1 - yield 1, 2 - end - e = o.to_enum - p e.peek_values #=> [] - e.next - p e.peek_values #=> [1] - p e.peek_values #=> [1] - e.next - p e.peek_values #=> [1, 2] - e.next - p e.peek_values # raises StopIteration

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -450
    -451
    -452
    -453
    -454
    -455
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 450
    -
    -def peek_values
    -  if @lookahead.nil?
    -    @lookahead = next_values
    -  end
    -  @lookahead.dup
    -end
    -
    -
    - -
    -

    - - #rewindObject - - - - - -

    -
    -

    call-seq: - e.rewind -> e

    - -

    Rewinds the enumeration sequence to the beginning.

    - -

    If the enclosed object responds to a “rewind” method, it is called.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -465
    -466
    -467
    -468
    -469
    -470
    -471
    -472
    -473
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 465
    -
    -def rewind
    -  @obj.rewind if @obj.respond_to? :rewind
    -  @fib = nil
    -  @dst = nil
    -  @lookahead = nil
    -  @feedvalue = nil
    -  @stop_exc = false
    -  self
    -end
    -
    -
    - -
    -

    - - #with_index(offset = 0, &block) ⇒ Object - - - - - -

    -
    -

    call-seq: - e.with_index(offset = 0) {|(*args), idx| … } - e.with_index(offset = 0)

    - -

    Iterates the given block for each element with an index, which -starts from +offset+. If no block is given, returns a new Enumerator -that includes the index, starting from +offset+

    - -

    +offset+:: the starting index to use

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -159
    -160
    -161
    -162
    -163
    -164
    -165
    -166
    -167
    -168
    -169
    -170
    -171
    -172
    -173
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 159
    -
    -def with_index(offset=0, &block)
    -  return to_enum :with_index, offset unless block
    -
    -  if offset.nil?
    -    offset = 0
    -  else
    -    offset = offset.__to_int
    -  end
    -
    -  n = offset - 1
    -  enumerator_block_call do |*i|
    -    n += 1
    -    block.call i.__svalue, n
    -  end
    -end
    -
    -
    - -
    -

    - - #with_object(object, &block) ⇒ Object - - - - - -

    -
    -

    call-seq: - e.each_with_object(obj) {|(args), obj| … } - e.each_with_object(obj) - e.with_object(obj) {|(args), obj| … } - e.with_object(obj)

    - -

    Iterates the given block for each element with an arbitrary object, +obj+, -and returns +obj+

    - -

    If no block is given, returns a new Enumerator.

    - - -
    -
    -
    - -
    -

    Examples:

    - - -
    to_three = Enumerator.new do |y|
    -  3.times do |x|
    -    y << x
    -  end
    -end
    -
    -to_three_with_string = to_three.with_object("foo")
    -to_three_with_string.each do |x,string|
    -  puts "#{string}: #{x}"
    -end
    -
    -# => foo:0
    -# => foo:1
    -# => foo:2
    - -
    - - -
    - - - - - - -
    -
    -
    -
    -216
    -217
    -218
    -219
    -220
    -221
    -222
    -223
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 216
    -
    -def with_object(object, &block)
    -  return to_enum(:with_object, object) unless block
    -
    -  enumerator_block_call do |i|
    -    block.call [i,object]
    -  end
    -  object
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Enumerator/Chain.html b/docs/api/Enumerator/Chain.html deleted file mode 100644 index dec58e4..0000000 --- a/docs/api/Enumerator/Chain.html +++ /dev/null @@ -1,538 +0,0 @@ - - - - - - - Class: Enumerator::Chain - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    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, #filter_map, #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, #tally, #to_h, #uniq, #zip

    -
    -

    Constructor Details

    - -
    -

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

    -
    -

    Returns a new instance of Chain

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

    Instance Method Details

    - - -
    -

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

    - - - - -
    -
    -
    -
    -54
    -55
    -56
    -
    -
    # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 54
    -
    -def +(other)
    -  self.class.new(self, other)
    -end
    -
    -
    - -
    -

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

    - - - - -
    -
    -
    -
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -
    -
    # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 24
    -
    -def each(&block)
    -  return to_enum unless block
    -
    -  i = 0
    -  while i < @enums.size
    -    @pos = i
    -    @enums[i].each(&block)
    -    i += 1
    -  end
    -
    -  self
    -end
    -
    -
    - -
    -

    - - #inspectObject - - - - - -

    - - - - -
    -
    -
    -
    -58
    -59
    -60
    -
    -
    # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 58
    -
    -def inspect
    -  "#<#{self.class}: #{@enums.inspect}>"
    -end
    -
    -
    - -
    -

    - - #rewindObject - - - - - -

    - - - - -
    -
    -
    -
    -44
    -45
    -46
    -47
    -48
    -49
    -50
    -51
    -52
    -
    -
    # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 44
    -
    -def rewind
    -  while 0 <= @pos && @pos < @enums.size
    -    e = @enums[@pos]
    -    e.rewind if e.respond_to?(:rewind)
    -    @pos -= 1
    -  end
    -
    -  self
    -end
    -
    -
    - -
    -

    - - #sizeObject - - - - - -

    - - - - -
    -
    -
    -
    -37
    -38
    -39
    -40
    -41
    -42
    -
    -
    # File 'mrbgems/mruby-enum-chain/mrblib/chain.rb', line 37
    -
    -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 deleted file mode 100644 index f9f5982..0000000 --- a/docs/api/Enumerator/Generator.html +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - - Class: Enumerator::Generator - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Enumerator::Generator - - - -

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

    Overview

    -
    -

    just for internal

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

    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, #filter_map, #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, #tally, #to_h, #uniq, #zip

    -
    -

    Constructor Details

    - -
    -

    - - #initialize(&block) ⇒ Generator - - - - - -

    -
    -

    Returns a new instance of Generator

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -529
    -530
    -531
    -532
    -533
    -
    -
    # 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
    -
    -  @proc = block
    -end
    -
    -
    - -
    - - -
    -

    Instance Method Details

    - - -
    -

    - - #each(*args, &block) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -535
    -536
    -537
    -538
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 535
    -
    -def each(*args, &block)
    -  args.unshift Yielder.new(&block)
    -  @proc.call(*args)
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Enumerator/Lazy.html b/docs/api/Enumerator/Lazy.html deleted file mode 100644 index a16110f..0000000 --- a/docs/api/Enumerator/Lazy.html +++ /dev/null @@ -1,1104 +0,0 @@ - - - - - - - Class: Enumerator::Lazy - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Enumerator::Lazy - - - -

    -
    - -
    -
    Inherits:
    -
    - Enumerator - -
      -
    • Object
    • - - - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-enum-lazy/mrblib/lazy.rb
    -
    - -
    - -

    Overview

    -
    -

    == Acknowledgements

    - -

    Based on https://github.com/yhara/enumerable-lazy - Inspired by https://github.com/antimon2/enumerable_lz - http://jp.rubyist.net/magazine/?0034-Enumerable_lz (ja)

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

    Constant Summary

    - -

    Constants included - from Enumerable

    -

    Enumerable::NONE

    - - - - -

    Instance Attribute Summary

    - -

    Attributes inherited from Enumerator

    -

    #args, #fib, #meth, #obj

    - - - -

    - Instance Method Summary - collapse -

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

    Methods inherited from Enumerator

    -

    #+, #each, #each_with_index, #feed, #initialize_copy, #inspect, #next, #next_values, #peek, #peek_values, produce, #rewind, #with_index, #with_object

    - - - - - - - - - -

    Methods included from Enumerable

    -

    __update_hash, #all?, #any?, #chain, #count, #cycle, #detect, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #filter_map, #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, #tally, #to_h

    -
    -

    Constructor Details

    - -
    -

    - - #initialize(obj, &block) ⇒ Lazy - - - - - -

    -
    -

    Returns a new instance of Lazy

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    -42
    -43
    -
    -
    # File 'mrbgems/mruby-enum-lazy/mrblib/lazy.rb', line 30
    -
    -def initialize(obj, &block)
    -  super(){|yielder|
    -    begin
    -      obj.each{|x|
    -        if block
    -          block.call(yielder, x)
    -        else
    -          yielder << x
    -        end
    -      }
    -    rescue StopIteration
    -    end
    -  }
    -end
    -
    -
    - -
    - - -
    -

    Instance Method Details

    - - -
    -

    - - #drop(n) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -89
    -90
    -91
    -92
    -93
    -94
    -95
    -96
    -97
    -98
    -
    -
    # File 'mrbgems/mruby-enum-lazy/mrblib/lazy.rb', line 89
    -
    -def drop(n)
    -  dropped = 0
    -  Lazy.new(self){|yielder, val|
    -    if dropped < n
    -      dropped += 1
    -    else
    -      yielder << val
    -    end
    -  }
    -end
    -
    -
    - -
    -

    - - #drop_while(&block) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -100
    -101
    -102
    -103
    -104
    -105
    -106
    -107
    -108
    -109
    -110
    -111
    -112
    -
    -
    # File 'mrbgems/mruby-enum-lazy/mrblib/lazy.rb', line 100
    -
    -def drop_while(&block)
    -  dropping = true
    -  Lazy.new(self){|yielder, val|
    -    if dropping
    -      if not block.call(val)
    -        yielder << val
    -        dropping = false
    -      end
    -    else
    -      yielder << val
    -    end
    -  }
    -end
    -
    -
    - -
    -

    - - #flat_map(&block) ⇒ Object - - - - Also known as: - collect_concat - - - - -

    - - - - -
    -
    -
    -
    -138
    -139
    -140
    -141
    -142
    -143
    -144
    -145
    -146
    -
    -
    # File 'mrbgems/mruby-enum-lazy/mrblib/lazy.rb', line 138
    -
    -def flat_map(&block)
    -  Lazy.new(self){|yielder, val|
    -    ary = block.call(val)
    -    # TODO: check ary is an Array
    -    ary.each{|x|
    -      yielder << x
    -    }
    -  }
    -end
    -
    -
    - -
    -

    - - #grep(pattern) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -81
    -82
    -83
    -84
    -85
    -86
    -87
    -
    -
    # File 'mrbgems/mruby-enum-lazy/mrblib/lazy.rb', line 81
    -
    -def grep(pattern)
    -  Lazy.new(self){|yielder, val|
    -    if pattern === val
    -      yielder << val
    -    end
    -  }
    -end
    -
    -
    - -
    -

    - - #map(&block) ⇒ Object - - - - Also known as: - collect - - - - -

    - - - - -
    -
    -
    -
    -57
    -58
    -59
    -60
    -61
    -
    -
    # File 'mrbgems/mruby-enum-lazy/mrblib/lazy.rb', line 57
    -
    -def map(&block)
    -  Lazy.new(self){|yielder, val|
    -    yielder << block.call(val)
    -  }
    -end
    -
    -
    - -
    -

    - - #reject(&block) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -73
    -74
    -75
    -76
    -77
    -78
    -79
    -
    -
    # File 'mrbgems/mruby-enum-lazy/mrblib/lazy.rb', line 73
    -
    -def reject(&block)
    -  Lazy.new(self){|yielder, val|
    -    unless block.call(val)
    -      yielder << val
    -    end
    -  }
    -end
    -
    -
    - -
    -

    - - #select(&block) ⇒ Object - - - - Also known as: - find_all - - - - -

    - - - - -
    -
    -
    -
    -64
    -65
    -66
    -67
    -68
    -69
    -70
    -
    -
    # File 'mrbgems/mruby-enum-lazy/mrblib/lazy.rb', line 64
    -
    -def select(&block)
    -  Lazy.new(self){|yielder, val|
    -    if block.call(val)
    -      yielder << val
    -    end
    -  }
    -end
    -
    -
    - -
    -

    - - #take(n) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -114
    -115
    -116
    -117
    -118
    -119
    -120
    -121
    -122
    -123
    -124
    -125
    -126
    -
    -
    # File 'mrbgems/mruby-enum-lazy/mrblib/lazy.rb', line 114
    -
    -def take(n)
    -  if n == 0
    -    return Lazy.new(self){raise StopIteration}
    -  end
    -  taken = 0
    -  Lazy.new(self){|yielder, val|
    -    yielder << val
    -    taken += 1
    -    if taken >= n
    -      raise StopIteration
    -    end
    -  }
    -end
    -
    -
    - -
    -

    - - #take_while(&block) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -128
    -129
    -130
    -131
    -132
    -133
    -134
    -135
    -136
    -
    -
    # File 'mrbgems/mruby-enum-lazy/mrblib/lazy.rb', line 128
    -
    -def take_while(&block)
    -  Lazy.new(self){|yielder, val|
    -    if block.call(val)
    -      yielder << val
    -    else
    -      raise StopIteration
    -    end
    -  }
    -end
    -
    -
    - -
    -

    - - #to_enum(meth = :each, *args, &block) ⇒ Object - - - - Also known as: - enum_for - - - - -

    - - - - -
    -
    -
    -
    -45
    -46
    -47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -
    -
    # File 'mrbgems/mruby-enum-lazy/mrblib/lazy.rb', line 45
    -
    -def to_enum(meth=:each, *args, &block)
    -  unless self.respond_to?(meth)
    -    raise ArgumentError, "undefined method #{meth}"
    -  end
    -  lz = Lazy.new(self, &block)
    -  lz.obj = self
    -  lz.meth = meth
    -  lz.args = args
    -  lz
    -end
    -
    -
    - -
    -

    - - #uniq(&block) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -161
    -162
    -163
    -164
    -165
    -166
    -167
    -168
    -169
    -170
    -171
    -172
    -173
    -174
    -
    -
    # File 'mrbgems/mruby-enum-lazy/mrblib/lazy.rb', line 161
    -
    -def uniq(&block)
    -  hash = {}
    -  Lazy.new(self){|yielder, val|
    -    if block
    -      v = block.call(val)
    -    else
    -      v = val
    -    end
    -    unless hash.include?(v)
    -      yielder << val
    -      hash[v] = val
    -    end
    -  }
    -end
    -
    -
    - -
    -

    - - #zip(*args, &block) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -149
    -150
    -151
    -152
    -153
    -154
    -155
    -156
    -157
    -158
    -159
    -
    -
    # File 'mrbgems/mruby-enum-lazy/mrblib/lazy.rb', line 149
    -
    -def zip(*args, &block)
    -  enums = [self] + args
    -  Lazy.new(self){|yielder, val|
    -    ary = enums.map{|e| e.next}
    -    if block
    -      yielder << block.call(ary)
    -    else
    -      yielder << ary
    -    end
    -  }
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Enumerator/Yielder.html b/docs/api/Enumerator/Yielder.html deleted file mode 100644 index 94663fe..0000000 --- a/docs/api/Enumerator/Yielder.html +++ /dev/null @@ -1,350 +0,0 @@ - - - - - - - Class: Enumerator::Yielder - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Enumerator::Yielder - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-enumerator/mrblib/enumerator.rb
    -
    - -
    - -

    Overview

    -
    -

    just for internal

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

    - Instance Method Summary - collapse -

    - - - - -
    -

    Constructor Details

    - -
    -

    - - #initialize(&block) ⇒ Yielder - - - - - -

    -
    -

    Returns a new instance of Yielder

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -543
    -544
    -545
    -546
    -547
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 543
    -
    -def initialize(&block)
    -  raise LocalJumpError, "no block given" unless block
    -
    -  @proc = block
    -end
    -
    -
    - -
    - - -
    -

    Instance Method Details

    - - -
    -

    - - #<<(*args) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -553
    -554
    -555
    -556
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 553
    -
    -def << *args
    -  self.yield(*args)
    -  self
    -end
    -
    -
    - -
    -

    - - #yield(*args) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -549
    -550
    -551
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 549
    -
    -def yield(*args)
    -  @proc.call(*args)
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Exception.html b/docs/api/Exception.html deleted file mode 100644 index fba2773..0000000 --- a/docs/api/Exception.html +++ /dev/null @@ -1,820 +0,0 @@ - - - - - - - Exception: Exception - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: Exception - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    src/error.c
    -
    - -
    - -

    Overview

    -
    -

    15.2.22

    - - -
    -
    -
    - - -
    - -
    -

    Direct Known Subclasses

    -

    NoMemoryError, ScriptError, StandardError, SystemStackError

    -
    - - - - - - - - -

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #backtrace ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #exception ⇒ Object - - - - - - - - - - - - - -

      call-seq: exc.exception(string) -> an_exception or exc.

      -
      - -
    • - - -
    • - - - #new(msg = nil) ⇒ Exception - - - - - - - constructor - - - - - - - - -

      Construct a new Exception object, optionally passing in a message.

      -
      - -
    • - - -
    • - - - #inspect ⇒ String - - - - - - - - - - - - - -

      Returns this exception’s file name, line number, message and class name.

      -
      - -
    • - - -
    • - - - #message ⇒ String - - - - - - - - - - - - - -

      Returns the result of invoking exception.to_s.

      -
      - -
    • - - -
    • - - - #set_backtrace ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #to_s ⇒ String - - - - - - - - - - - - - -

      Returns exception’s message (or the name of the exception if no message is set).

      -
      - -
    • - - -
    - - -
    -

    Constructor Details

    - -
    -

    - - #new(msg = nil) ⇒ Exception - - - - - -

    -
    -

    Construct a new Exception object, optionally passing in - a message.

    - - -
    -
    -
    - -
    -
    - - - -
    -
    -
    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -43
    -44
    -45
    -46
    -47
    -48
    -49
    -50
    -51
    -52
    -
    -
    # File 'src/error.c', line 43
    -
    -static mrb_value
    -exc_initialize(mrb_state *mrb, mrb_value exc)
    -{
    -  mrb_value mesg;
    -
    -  if (mrb_get_args(mrb, "|o", &mesg) == 1) {
    -    mrb_iv_set(mrb, exc, mrb_intern_lit(mrb, "mesg"), mesg);
    -  }
    -  return exc;
    -}
    -
    -
    - -
    - - -
    -

    Instance Method Details

    - - -
    -

    - - #backtraceObject - - - - - -

    -
    - -
    -

    - - #exceptionObject - - - - - -

    -
    -

    call-seq: - exc.exception(string) -> an_exception or exc

    - -

    With no argument, or if the argument is the same as the receiver, -return the receiver. Otherwise, create a new -exception object of the same class as the receiver, but with a -message equal to string.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -67
    -68
    -69
    -70
    -71
    -72
    -73
    -74
    -75
    -76
    -77
    -78
    -79
    -80
    -81
    -
    -
    # File 'src/error.c', line 67
    -
    -static mrb_value
    -exc_exception(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value exc;
    -  mrb_value a;
    -  mrb_int argc;
    -
    -  argc = mrb_get_args(mrb, "|o", &a);
    -  if (argc == 0) return self;
    -  if (mrb_obj_equal(mrb, self, a)) return self;
    -  exc = mrb_obj_clone(mrb, self);
    -  mrb_iv_set(mrb, exc, mrb_intern_lit(mrb, "mesg"), a);
    -
    -  return exc;
    -}
    -
    -
    - -
    -

    - - #inspectString - - - - - -

    -
    -

    Returns this exception’s file name, line number, -message and class name. -If file name or line number is not set, -returns message and class name.

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'src/error.c', line 131
    -
    -static mrb_value
    -exc_inspect(mrb_state *mrb, mrb_value exc)
    -{
    -  mrb_value str, mesg, file, line;
    -  mrb_bool append_mesg;
    -  const char *cname;
    -
    -  mesg = mrb_attr_get(mrb, exc, mrb_intern_lit(mrb, "mesg"));
    -  file = mrb_attr_get(mrb, exc, mrb_intern_lit(mrb, "file"));
    -  line = mrb_attr_get(mrb, exc, mrb_intern_lit(mrb, "line"));
    -
    -  append_mesg = !mrb_nil_p(mesg);
    -  if (append_mesg) {
    -    mesg = mrb_obj_as_string(mrb, mesg);
    -    append_mesg = RSTRING_LEN(mesg) > 0;
    -  }
    -
    -  cname = mrb_obj_classname(mrb, exc);
    -  str = mrb_str_new_cstr(mrb, cname);
    -  if (mrb_string_p(file) && mrb_fixnum_p(line)) {
    -    if (append_mesg) {
    -      str = mrb_format(mrb, "%v:%v: %v (%v)", file, line, mesg, str);
    -    }
    -    else {
    -      str = mrb_format(mrb, "%v:%v: %v", file, line, str);
    -    }
    -  }
    -  else if (append_mesg) {
    -    str = mrb_format(mrb, "%v: %v", str, mesg);
    -  }
    -  return str;
    -}
    -
    -
    - -
    -

    - - #messageString - - - - - -

    -
    -

    Returns the result of invoking exception.to_s. -Normally this returns the exception’s message or name.

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -115
    -116
    -117
    -118
    -119
    -
    -
    # File 'src/error.c', line 115
    -
    -static mrb_value
    -exc_message(mrb_state *mrb, mrb_value exc)
    -{
    -  return mrb_funcall(mrb, exc, "to_s", 0);
    -}
    -
    -
    - -
    -

    - - #set_backtraceObject - - - - - -

    - - - - -
    -
    -
    -
    -185
    -186
    -187
    -188
    -189
    -190
    -191
    -192
    -193
    -
    -
    # File 'src/error.c', line 185
    -
    -static mrb_value
    -exc_set_backtrace(mrb_state *mrb, mrb_value exc)
    -{
    -  mrb_value backtrace;
    -
    -  mrb_get_args(mrb, "o", &backtrace);
    -  set_backtrace(mrb, exc, backtrace);
    -  return backtrace;
    -}
    -
    -
    - -
    -

    - - #to_sString - - - - - -

    -
    -

    Returns exception’s message (or the name of the exception if -no message is set).

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -91
    -92
    -93
    -94
    -95
    -96
    -97
    -98
    -99
    -100
    -101
    -102
    -103
    -104
    -105
    -
    -
    # File 'src/error.c', line 91
    -
    -static mrb_value
    -exc_to_s(mrb_state *mrb, mrb_value exc)
    -{
    -  mrb_value mesg = mrb_attr_get(mrb, exc, mrb_intern_lit(mrb, "mesg"));
    -  struct RObject *p;
    -
    -  if (!mrb_string_p(mesg)) {
    -    return mrb_str_new_cstr(mrb, mrb_obj_classname(mrb, exc));
    -  }
    -  p = mrb_obj_ptr(mesg);
    -  if (!p->c) {
    -    p->c = mrb->string_class;
    -  }
    -  return mesg;
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/FalseClass.html b/docs/api/FalseClass.html deleted file mode 100644 index df9bfb3..0000000 --- a/docs/api/FalseClass.html +++ /dev/null @@ -1,721 +0,0 @@ - - - - - - - Class: FalseClass - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: FalseClass - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    src/object.c
    -
    - -
    - - - - - - - - - -

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #& ⇒ Object - - - - - - - - - - - - - -

      And—Returns false.

      -
      - -
    • - - -
    • - - - #^ ⇒ Object - - - - - - - - - - - - - -

      Exclusive Or—If obj is nil or false, returns false; otherwise, returns true.

      -
      - -
    • - - -
    • - - - #to_s ⇒ Object - - - - - - - - - - - - - -

      ‘nuf said…

      -
      - -
    • - - -
    • - - - #to_s ⇒ Object - - - - - - - - - - - - - -

      ‘nuf said…

      -
      - -
    • - - -
    • - - - #| ⇒ Object - - - - - - - - - - - - - -

      Or—Returns false if obj is nil or false; true otherwise.

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

    Instance Method Details

    - - -
    -

    - - - #&(obj) ⇒ false - - #&(obj) ⇒ false - - - - - - -

    -
    -

    And—Returns false. obj is always -evaluated as it is the argument to a method call—there is no -short-circuit evaluation in this case.

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #&(obj) ⇒ false -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (false) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #&(obj) ⇒ false -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (false) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -201
    -202
    -203
    -204
    -205
    -
    -
    # File 'src/object.c', line 201
    -
    -static mrb_value
    -false_and(mrb_state *mrb, mrb_value obj)
    -{
    -  return mrb_false_value();
    -}
    -
    -
    - -
    -

    - - - #^(obj) ⇒ Boolean - - #^(obj) ⇒ Boolean - - - - - - -

    -
    -

    Exclusive Or—If obj is nil or -false, returns false; otherwise, returns -true.

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #^(obj) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #^(obj) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -220
    -221
    -222
    -223
    -224
    -225
    -226
    -227
    -
    -
    # File 'src/object.c', line 220
    -
    -static mrb_value
    -false_xor(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_bool obj2;
    -
    -  mrb_get_args(mrb, "b", &obj2);
    -  return mrb_bool_value(obj2);
    -}
    -
    -
    - -
    -

    - - #to_sObject - - - - - -

    -
    -

    ‘nuf said…

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -257
    -258
    -259
    -260
    -261
    -
    -
    # File 'src/object.c', line 257
    -
    -static mrb_value
    -false_to_s(mrb_state *mrb, mrb_value obj)
    -{
    -  return mrb_str_new_lit_frozen(mrb, "false");
    -}
    -
    -
    - -
    -

    - - #to_sObject - - - - - -

    -
    -

    ‘nuf said…

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -257
    -258
    -259
    -260
    -261
    -
    -
    # File 'src/object.c', line 257
    -
    -static mrb_value
    -false_to_s(mrb_state *mrb, mrb_value obj)
    -{
    -  return mrb_str_new_lit_frozen(mrb, "false");
    -}
    -
    -
    - -
    -

    - - - #|(obj) ⇒ Boolean - - #|(obj) ⇒ Boolean - - - - - - -

    -
    -

    Or—Returns false if obj is -nil or false; true otherwise.

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #|(obj) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #|(obj) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -240
    -241
    -242
    -243
    -244
    -245
    -246
    -247
    -
    -
    # File 'src/object.c', line 240
    -
    -static mrb_value
    -false_or(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_bool obj2;
    -
    -  mrb_get_args(mrb, "b", &obj2);
    -  return mrb_bool_value(obj2);
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Fiber.html b/docs/api/Fiber.html deleted file mode 100644 index f21ca56..0000000 --- a/docs/api/Fiber.html +++ /dev/null @@ -1,813 +0,0 @@ - - - - - - - Class: Fiber - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Fiber - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-fiber/src/fiber.c
    -
    - -
    - - - - - - - - - -

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #== ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #alive? ⇒ Boolean - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #new { ... } ⇒ Object - - - - - - - constructor - - - - - - - - -

      Creates a fiber, whose execution is suspend until it is explicitly resumed using Fiber#resume method.

      -
      - -
    • - - -
    • - - - #resume(args, ...) ⇒ Object - - - - - - - - - - - - - -

      Resumes the fiber from the point at which the last Fiber.yield was called, or starts running it if it is the first call to resume.

      -
      - -
    • - - -
    • - - - #transfer(args, ...) ⇒ Object - - - - - - - - - - - - - -

      Transfers control to receiver fiber of the method call.

      -
      - -
    • - - -
    - - -
    -

    Constructor Details

    - -
    -

    - - #new { ... } ⇒ Object - - - - - -

    -
    -

    Creates a fiber, whose execution is suspend until it is explicitly -resumed using Fiber#resume method. -The code running inside the fiber can give up control by calling -Fiber.yield in which case it yields control back to caller -(the caller of the Fiber#resume).

    - -

    Upon yielding or termination the Fiber returns the value of the last -executed expression

    - -

    For instance:

    - -

    fiber = Fiber.new do - Fiber.yield 1 - 2 - end

    - -

    puts fiber.resume - puts fiber.resume - puts fiber.resume

    - -

    produces

    - -

    1 - 2 - resuming dead fiber (FiberError)

    - -

    The Fiber#resume method accepts an arbitrary number of -parameters, if it is the first call to resume then they -will be passed as block arguments. Otherwise they will be the return -value of the call to Fiber.yield

    - -

    Example:

    - -

    fiber = Fiber.new do |first| - second = Fiber.yield first + 2 - end

    - -

    puts fiber.resume 10 - puts fiber.resume 14 - puts fiber.resume 18

    - -

    produces

    - -

    12 - 14 - resuming dead fiber (FiberError)

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

    Yields:

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

      []

      -
      - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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
    -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
    -
    -
    # File 'mrbgems/mruby-fiber/src/fiber.c', line 64
    -
    -static mrb_value
    -fiber_init(mrb_state *mrb, mrb_value self)
    -{
    -  static const struct mrb_context mrb_context_zero = { 0 };
    -  struct RFiber *f = fiber_ptr(self);
    -  struct mrb_context *c;
    -  struct RProc *p;
    -  mrb_callinfo *ci;
    -  mrb_value blk;
    -  size_t slen;
    -
    -  mrb_get_args(mrb, "&!", &blk);
    -
    -  if (f->cxt) {
    -    mrb_raise(mrb, E_RUNTIME_ERROR, "cannot initialize twice");
    -  }
    -  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");
    -  }
    -
    -  c = (struct mrb_context*)mrb_malloc(mrb, sizeof(struct mrb_context));
    -  *c = mrb_context_zero;
    -  f->cxt = c;
    -
    -  /* initialize VM stack */
    -  slen = FIBER_STACK_INIT_SIZE;
    -  if (p->body.irep->nregs > slen) {
    -    slen += p->body.irep->nregs;
    -  }
    -  c->stbase = (mrb_value *)mrb_malloc(mrb, slen*sizeof(mrb_value));
    -  c->stend = c->stbase + slen;
    -  c->stack = c->stbase;
    -
    -#ifdef MRB_NAN_BOXING
    -  {
    -    mrb_value *p = c->stbase;
    -    mrb_value *pend = c->stend;
    -
    -    while (p < pend) {
    -      SET_NIL_VALUE(*p);
    -      p++;
    -    }
    -  }
    -#else
    -  memset(c->stbase, 0, slen * sizeof(mrb_value));
    -#endif
    -
    -  /* copy receiver from a block */
    -  c->stack[0] = mrb->c->stack[0];
    -
    -  /* initialize callinfo stack */
    -  c->cibase = (mrb_callinfo *)mrb_calloc(mrb, FIBER_CI_INIT_SIZE, sizeof(mrb_callinfo));
    -  c->ciend = c->cibase + FIBER_CI_INIT_SIZE;
    -  c->ci = c->cibase;
    -  c->ci->stackent = c->stack;
    -
    -  /* adjust return callinfo */
    -  ci = c->ci;
    -  ci->target_class = MRB_PROC_TARGET_CLASS(p);
    -  ci->proc = p;
    -  mrb_field_write_barrier(mrb, (struct RBasic*)mrb_obj_ptr(self), (struct RBasic*)p);
    -  ci->pc = p->body.irep->iseq;
    -  ci[1] = ci[0];
    -  c->ci++;                      /* push dummy callinfo */
    -
    -  c->fib = f;
    -  c->status = MRB_FIBER_CREATED;
    -
    -  return self;
    -}
    -
    -
    - -
    - - -
    -

    Instance Method Details

    - - -
    -

    - - #==Object - - - - - -

    - - - - -
    -
    -
    -
    -291
    -292
    -293
    -294
    -295
    -296
    -297
    -298
    -299
    -300
    -301
    -
    -
    # File 'mrbgems/mruby-fiber/src/fiber.c', line 291
    -
    -static mrb_value
    -fiber_eq(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value other;
    -  mrb_get_args(mrb, "o", &other);
    -
    -  if (!mrb_fiber_p(other)) {
    -    return mrb_false_value();
    -  }
    -  return mrb_bool_value(fiber_ptr(self) == fiber_ptr(other));
    -}
    -
    -
    - -
    -

    - - #alive?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

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

    - - #resume(args, ...) ⇒ Object - - - - - -

    -
    -

    Resumes the fiber from the point at which the last Fiber.yield -was called, or starts running it if it is the first call to -resume. Arguments passed to resume will be the value of -the Fiber.yield expression or will be passed as block -parameters to the fiber’s block if this is the first resume.

    - -

    Alternatively, when resume is called it evaluates to the arguments passed -to the next Fiber.yield statement inside the fiber’s block -or to the block value if it runs to completion without any -Fiber.yield

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

    Returns:

    -
      - -
    • - - - (Object) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -255
    -256
    -257
    -258
    -259
    -260
    -261
    -262
    -263
    -264
    -265
    -266
    -267
    -
    -
    # File 'mrbgems/mruby-fiber/src/fiber.c', line 255
    -
    -static mrb_value
    -fiber_resume(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value *a;
    -  mrb_int len;
    -  mrb_bool vmexec = FALSE;
    -
    -  mrb_get_args(mrb, "*!", &a, &len);
    -  if (mrb->c->ci->acc < 0) {
    -    vmexec = TRUE;
    -  }
    -  return fiber_switch(mrb, self, len, a, TRUE, vmexec);
    -}
    -
    -
    - -
    -

    - - #transfer(args, ...) ⇒ Object - - - - - -

    -
    -

    Transfers control to receiver fiber of the method call. -Unlike resume the receiver wouldn’t be pushed to call -stack of fibers. Instead it will switch to the call stack of -transferring fiber. -When resuming a fiber that was transferred to another fiber it would -cause double resume error. Though when the fiber is re-transferred -and Fiber.yield is called, the fiber would be resumable.

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

    Returns:

    -
      - -
    • - - - (Object) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -315
    -316
    -317
    -318
    -319
    -320
    -321
    -322
    -323
    -324
    -325
    -326
    -327
    -328
    -329
    -330
    -331
    -332
    -333
    -334
    -335
    -336
    -337
    -
    -
    # File 'mrbgems/mruby-fiber/src/fiber.c', line 315
    -
    -static mrb_value
    -fiber_transfer(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_context *c = fiber_check(mrb, self);
    -  mrb_value* a;
    -  mrb_int len;
    -
    -  fiber_check_cfunc(mrb, mrb->c);
    -  mrb_get_args(mrb, "*!", &a, &len);
    -
    -  if (c == mrb->root_c) {
    -    mrb->c->status = MRB_FIBER_TRANSFERRED;
    -    fiber_switch_context(mrb, c);
    -    MARK_CONTEXT_MODIFY(c);
    -    return fiber_result(mrb, a, len);
    -  }
    -
    -  if (c == mrb->c) {
    -    return fiber_result(mrb, a, len);
    -  }
    -
    -  return fiber_switch(mrb, self, len, a, FALSE, FALSE);
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/File.html b/docs/api/File.html deleted file mode 100644 index 98db1b3..0000000 --- a/docs/api/File.html +++ /dev/null @@ -1,1955 +0,0 @@ - - - - - - - Class: File - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: File - - - -

    -
    - -
    -
    Inherits:
    -
    - IO - -
      -
    • Object
    • - - - - - -
    - show all - -
    -
    - - - - - - -
    -
    Includes:
    -
    Constants
    -
    - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-io/src/file.c,
    - mrbgems/mruby-io/mrblib/file.rb,
    mrbgems/mruby-io/mrblib/file_constants.rb,
    mrbgems/mruby-io/mrblib/file_constants.rb
    -
    -
    - -
    - -

    Defined Under Namespace

    -

    - - - Modules: Constants - - - - -

    - - - -

    Constant Summary

    - -

    Constants included - from Constants

    -

    Constants::APPEND, Constants::BINARY, Constants::CREAT, Constants::DSYNC, Constants::EXCL, Constants::FNM_CASEFOLD, Constants::FNM_DOTMATCH, Constants::FNM_NOESCAPE, Constants::FNM_PATHNAME, Constants::FNM_SYSCASE, Constants::NOCTTY, Constants::NOFOLLOW, Constants::NONBLOCK, Constants::RDONLY, Constants::RDWR, Constants::SYNC, Constants::TRUNC, Constants::WRONLY

    - - - -

    Constants inherited - from IO

    -

    IO::BUF_SIZE, IO::SEEK_CUR, IO::SEEK_END, IO::SEEK_SET

    - - -

    Instance Attribute Summary collapse

    -
      - -
    • - - - #path ⇒ Object - - - - - - - - - - - - - - - - -

      Returns the value of attribute path.

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

    - Class Method Summary - collapse -

    - - - -

    - Instance Method Summary - collapse -

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

    Methods inherited from IO

    -

    #<<, #_check_readable, #_read_buf, #close, #close_on_exec=, #close_on_exec?, #close_write, #closed?, #each, #each_byte, #eof?, #fileno, #flush, #getc, #gets, #hash, #initialize_copy, #isatty, open, #pid, pipe, popen, #pos, #pos=, #print, #printf, #puts, read, #read, #readchar, #readline, #readlines, #rewind, #seek, #sync, #sync=, #sysread, #sysseek, #syswrite, #ungetc, #write

    -
    -

    Constructor Details

    - -
    -

    - - #initialize(fd_or_path, mode = "r", perm = 0666) ⇒ File - - - - - -

    -
    -

    Returns a new instance of File

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -4
    -5
    -6
    -7
    -8
    -9
    -10
    -11
    -12
    -
    -
    # 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
    -    super(fd_or_path, mode)
    -  else
    -    @path = fd_or_path
    -    fd = IO.sysopen(@path, mode, perm)
    -    super(fd, mode)
    -  end
    -end
    -
    -
    - -
    - -
    -

    Instance Attribute Details

    - - - -
    -

    - - #pathObject - - - - - -

    -
    -

    Returns the value of attribute path

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -2
    -3
    -4
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 2
    -
    -def path
    -  @path
    -end
    -
    -
    - -
    - - -
    -

    Class Method Details

    - - -
    -

    - - .directory?(file) ⇒ Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -147
    -148
    -149
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 147
    -
    -def self.directory?(file)
    -  FileTest.directory?(file)
    -end
    -
    -
    - -
    -

    - - .exist?(file) ⇒ Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -151
    -152
    -153
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 151
    -
    -def self.exist?(file)
    -  FileTest.exist?(file)
    -end
    -
    -
    - -
    -

    - - .exists?(file) ⇒ Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -155
    -156
    -157
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 155
    -
    -def self.exists?(file)
    -  FileTest.exists?(file)
    -end
    -
    -
    - -
    -

    - - .expand_path(path, default_dir = '.') ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -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
    -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
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 58
    -
    -def self.expand_path(path, default_dir = '.')
    -  def concat_path(path, base_path)
    -    if path[0] == "/" || path[1] == ':' # Windows root!
    -      expanded_path = path
    -    elsif path[0] == "~"
    -      if (path[1] == "/" || path[1] == nil)
    -        dir = path[1, path.size]
    -        home_dir = _gethome
    -
    -        unless home_dir
    -          raise ArgumentError, "couldn't find HOME environment -- expanding '~'"
    -        end
    -
    -        expanded_path = home_dir
    -        expanded_path += dir if dir
    -        expanded_path += "/"
    -      else
    -        splitted_path = path.split("/")
    -        user = splitted_path[0][1, splitted_path[0].size]
    -        dir = "/" + splitted_path[1, splitted_path.size].join("/")
    -
    -        home_dir = _gethome(user)
    -
    -        unless home_dir
    -          raise ArgumentError, "user #{user} doesn't exist"
    -        end
    -
    -        expanded_path = home_dir
    -        expanded_path += dir if dir
    -        expanded_path += "/"
    -      end
    -    else
    -      expanded_path = concat_path(base_path, _getwd)
    -      expanded_path += "/" + path
    -    end
    -
    -    expanded_path
    -  end
    -
    -  expanded_path = concat_path(path, default_dir)
    -  drive_prefix = ""
    -  if File::ALT_SEPARATOR && expanded_path.size > 2 &&
    -      ("A".."Z").include?(expanded_path[0].upcase) && expanded_path[1] == ":"
    -    drive_prefix = expanded_path[0, 2]
    -    expanded_path = expanded_path[2, expanded_path.size]
    -  end
    -  expand_path_array = []
    -  if File::ALT_SEPARATOR && expanded_path.include?(File::ALT_SEPARATOR)
    -    expanded_path.gsub!(File::ALT_SEPARATOR, '/')
    -  end
    -  while expanded_path.include?('//')
    -    expanded_path = expanded_path.gsub('//', '/')
    -  end
    -
    -  if expanded_path != "/"
    -    expanded_path.split('/').each do |path_token|
    -      if path_token == '..'
    -        if expand_path_array.size > 1
    -          expand_path_array.pop
    -        end
    -      elsif path_token == '.'
    -        # nothing to do.
    -      else
    -        expand_path_array << path_token
    -      end
    -    end
    -
    -    expanded_path = expand_path_array.join("/")
    -    if expanded_path.empty?
    -      expanded_path = '/'
    -    end
    -  end
    -  if drive_prefix.empty?
    -    expanded_path
    -  else
    -    drive_prefix + expanded_path.gsub("/", File::ALT_SEPARATOR)
    -  end
    -end
    -
    -
    - -
    -

    - - .extname(filename) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -187
    -188
    -189
    -190
    -191
    -192
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 187
    -
    -def self.extname(filename)
    -  fname = self.basename(filename)
    -  return '' if fname[0] == '.' || fname.index('.').nil?
    -  ext = fname.split('.').last
    -  ext.empty? ? '' : ".#{ext}"
    -end
    -
    -
    - -
    -

    - - .file?(file) ⇒ Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -159
    -160
    -161
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 159
    -
    -def self.file?(file)
    -  FileTest.file?(file)
    -end
    -
    -
    - -
    -

    - - .foreach(file) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -137
    -138
    -139
    -140
    -141
    -142
    -143
    -144
    -145
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 137
    -
    -def self.foreach(file)
    -  if block_given?
    -    self.open(file) do |f|
    -      f.each {|l| yield l}
    -    end
    -  else
    -    return self.new(file)
    -  end
    -end
    -
    -
    - -
    -

    - - .join(*names) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -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
    -53
    -54
    -55
    -56
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 14
    -
    -def self.join(*names)
    -  return "" if names.empty?
    -
    -  names.map! do |name|
    -    case name
    -    when String
    -      name
    -    when Array
    -      if names == name
    -        raise ArgumentError, "recursive array"
    -      end
    -      join(*name)
    -    else
    -      raise TypeError, "no implicit conversion of #{name.class} into String"
    -    end
    -  end
    -
    -  return names[0] if names.size == 1
    -
    -  if names[0][-1] == File::SEPARATOR
    -    s = names[0][0..-2]
    -  else
    -    s = names[0].dup
    -  end
    -
    -  (1..names.size-2).each { |i|
    -    t = names[i]
    -    if t[0] == File::SEPARATOR and t[-1] == File::SEPARATOR
    -      t = t[1..-2]
    -    elsif t[0] == File::SEPARATOR
    -      t = t[1..-1]
    -    elsif t[-1] == File::SEPARATOR
    -      t = t[0..-2]
    -    end
    -    s += File::SEPARATOR + t if t != ""
    -  }
    -  if names[-1][0] == File::SEPARATOR
    -    s += File::SEPARATOR + names[-1][1..-1]
    -  else
    -    s += File::SEPARATOR + names[-1]
    -  end
    -  s
    -end
    -
    -
    - -
    -

    - - .path(filename) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -194
    -195
    -196
    -197
    -198
    -199
    -200
    -201
    -202
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 194
    -
    -def self.path(filename)
    -  if filename.kind_of?(String)
    -    filename
    -  elsif filename.respond_to?(:to_path)
    -    filename.to_path
    -  else
    -    raise TypeError, "no implicit conversion of #{filename.class} into String"
    -  end
    -end
    -
    -
    - -
    -

    - - .pipe?(file) ⇒ Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -163
    -164
    -165
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 163
    -
    -def self.pipe?(file)
    -  FileTest.pipe?(file)
    -end
    -
    -
    - -
    -

    - - .size(file) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -167
    -168
    -169
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 167
    -
    -def self.size(file)
    -  FileTest.size(file)
    -end
    -
    -
    - -
    -

    - - .size?(file) ⇒ Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -171
    -172
    -173
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 171
    -
    -def self.size?(file)
    -  FileTest.size?(file)
    -end
    -
    -
    - -
    -

    - - .socket?(file) ⇒ Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -175
    -176
    -177
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 175
    -
    -def self.socket?(file)
    -  FileTest.socket?(file)
    -end
    -
    -
    - -
    -

    - - .symlink?(file) ⇒ Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -179
    -180
    -181
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 179
    -
    -def self.symlink?(file)
    -  FileTest.symlink?(file)
    -end
    -
    -
    - -
    -

    - - .zero?(file) ⇒ Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -183
    -184
    -185
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 183
    -
    -def self.zero?(file)
    -  FileTest.zero?(file)
    -end
    -
    -
    - -
    - -
    -

    Instance Method Details

    - - -
    -

    - - #concat_path(path, base_path) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'mrbgems/mruby-io/mrblib/file.rb', line 59
    -
    -def concat_path(path, base_path)
    -  if path[0] == "/" || path[1] == ':' # Windows root!
    -    expanded_path = path
    -  elsif path[0] == "~"
    -    if (path[1] == "/" || path[1] == nil)
    -      dir = path[1, path.size]
    -      home_dir = _gethome
    -
    -      unless home_dir
    -        raise ArgumentError, "couldn't find HOME environment -- expanding '~'"
    -      end
    -
    -      expanded_path = home_dir
    -      expanded_path += dir if dir
    -      expanded_path += "/"
    -    else
    -      splitted_path = path.split("/")
    -      user = splitted_path[0][1, splitted_path[0].size]
    -      dir = "/" + splitted_path[1, splitted_path.size].join("/")
    -
    -      home_dir = _gethome(user)
    -
    -      unless home_dir
    -        raise ArgumentError, "user #{user} doesn't exist"
    -      end
    -
    -      expanded_path = home_dir
    -      expanded_path += dir if dir
    -      expanded_path += "/"
    -    end
    -  else
    -    expanded_path = concat_path(base_path, _getwd)
    -    expanded_path += "/" + path
    -  end
    -
    -  expanded_path
    -end
    -
    -
    - -
    -

    - - #flockObject - - - - - -

    - - - - -
    -
    -
    -
    -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
    -380
    -381
    -382
    -383
    -384
    -385
    -
    -
    # File 'mrbgems/mruby-io/src/file.c', line 353
    -
    -mrb_value
    -mrb_file_flock(mrb_state *mrb, mrb_value self)
    -{
    -#if defined(sun)
    -  mrb_raise(mrb, E_NOTIMP_ERROR, "flock is not supported on Illumos/Solaris/Windows");
    -#else
    -  mrb_int operation;
    -  int fd;
    -
    -  mrb_get_args(mrb, "i", &operation);
    -  fd = (int)mrb_fixnum(mrb_io_fileno(mrb, self));
    -
    -  while (flock(fd, (int)operation) == -1) {
    -    switch (errno) {
    -      case EINTR:
    -        /* retry */
    -        break;
    -      case EAGAIN:      /* NetBSD */
    -#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
    -      case EWOULDBLOCK: /* FreeBSD OpenBSD Linux */
    -#endif
    -        if (operation & LOCK_NB) {
    -          return mrb_false_value();
    -        }
    -        /* FALLTHRU - should not happen */
    -      default:
    -        mrb_sys_fail(mrb, "flock failed");
    -        break;
    -    }
    -  }
    -#endif
    -  return mrb_fixnum_value(0);
    -}
    -
    -
    - -
    -

    - - #mtimeObject - - - - - -

    - - - - -
    -
    -
    -
    -339
    -340
    -341
    -342
    -343
    -344
    -345
    -346
    -347
    -348
    -349
    -350
    -351
    -
    -
    # File 'mrbgems/mruby-io/src/file.c', line 339
    -
    -static mrb_value
    -mrb_file_mtime(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value obj;
    -  struct stat st;
    -  int fd;
    -
    -  obj = mrb_obj_value(mrb_class_get(mrb, "Time"));
    -  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_fixnum_value(st.st_mtime));
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/File/Constants.html b/docs/api/File/Constants.html deleted file mode 100644 index 23a593f..0000000 --- a/docs/api/File/Constants.html +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - Module: File::Constants - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Module: File::Constants - - - -

    -
    - - - - - - - - - -
    -
    Included in:
    -
    File
    -
    - - - -
    -
    Defined in:
    -
    mrbgems/mruby-io/src/file.c,
    - mrbgems/mruby-io/mrblib/file_constants.rb
    -
    -
    - -
    - - - -

    - 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
    - -
    - - - - - - - - - - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/FileTest.html b/docs/api/FileTest.html deleted file mode 100644 index 8971ed1..0000000 --- a/docs/api/FileTest.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - Class: FileTest - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: FileTest - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-io/src/file_test.c
    -
    - -
    - - - - - - - - - - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Fixnum.html b/docs/api/Fixnum.html deleted file mode 100644 index ec36e8b..0000000 --- a/docs/api/Fixnum.html +++ /dev/null @@ -1,1825 +0,0 @@ - - - - - - - Class: Fixnum - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Fixnum - - - -

    -
    - -
    -
    Inherits:
    -
    - Integer - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    src/numeric.c
    -
    - -
    - -

    Overview

    -
    -

    Fixnum Class

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

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #% ⇒ Object - - - - - - - - - - - - - -

      Returns fix modulo other.

      -
      - -
    • - - -
    • - - - #&(integer) ⇒ Object - - - - - - - - - - - - - -

      Bitwise AND.

      -
      - -
    • - - -
    • - - - #*(numeric) ⇒ Object - - - - - - - - - - - - - -

      Performs multiplication: the class of the resulting object depends on the class of numeric and on the magnitude of the result.

      -
      - -
    • - - -
    • - - - #+(numeric) ⇒ Object - - - - - - - - - - - - - -

      Performs addition: the class of the resulting object depends on the class of numeric and on the magnitude of the result.

      -
      - -
    • - - -
    • - - - #-(numeric) ⇒ Object - - - - - - - - - - - - - -

      Performs subtraction: the class of the resulting object depends on the class of numeric and on the magnitude of the result.

      -
      - -
    • - - -
    • - - - #<<(count) ⇒ Integer, Float - - - - - - - - - - - - - -

      Shifts fix left count positions (right if count is negative).

      -
      - -
    • - - -
    • - - - #==(other) ⇒ Boolean - - - - - - - - - - - - - -

      Return true if fix equals other numerically.

      -
      - -
    • - - -
    • - - - #>>(count) ⇒ Integer, Float - - - - - - - - - - - - - -

      Shifts fix right count positions (left if count is negative).

      -
      - -
    • - - -
    • - - - #^(integer) ⇒ Object - - - - - - - - - - - - - -

      Bitwise EXCLUSIVE OR.

      -
      - -
    • - - -
    • - - - #divmod(numeric) ⇒ Array - - - - - - - - - - - - - -

      See Numeric#divmod.

      -
      - -
    • - - -
    • - - - #eql?(numeric) ⇒ Boolean - - - - - - - - - - - - - -

      Returns true if num and numeric are the same type and have equal values.

      -
      - -
    • - - -
    • - - - #to_s(base = 10) ⇒ String - - - - - - - - - - - - - -

      Returns a string containing the representation of fix radix base (between 2 and 36).

      -
      - -
    • - - -
    • - - - #to_f ⇒ Object - - - - - - - - - - - - - -

      15.2.8.3.23.

      -
      - -
    • - - -
    • - - - #to_s(base = 10) ⇒ String - - - - - - - - - - - - - -

      Returns a string containing the representation of fix radix base (between 2 and 36).

      -
      - -
    • - - -
    • - - - #|(integer) ⇒ Object - - - - - - - - - - - - - -

      Bitwise OR.

      -
      - -
    • - - -
    • - - - #~ ⇒ Integer - - - - - - - - - - - - - -

      One’s complement: returns a number where each bit is flipped.

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

    Methods inherited from Integer

    -

    #ceil, #floor, #to_i, #to_int

    - - - - - - - - - -

    Methods included from Integral

    -

    #**, #/, #<, #<=, #<=>, #>, #>=, #__coerce_step_counter, #div, #downto, #next, #quo, #step, #times, #upto

    - - - - - - - - - -

    Methods inherited from Numeric

    -

    #+@, #-@, #abs, #finite?, #infinite?, #negative?, #nonzero?, #positive?, #to_r, #zero?

    - - - - - - - - - -

    Methods included from Comparable

    -

    #<, #<=, #>, #>=, #between?, #clamp

    - - -
    -

    Instance Method Details

    - - -
    -

    - - - #%(other) ⇒ Object - - #modulo(other) ⇒ Object - - - - - - -

    -
    -

    Returns fix modulo other. -See numeric.divmod for more information.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -886
    -887
    -888
    -889
    -890
    -891
    -892
    -893
    -894
    -895
    -896
    -897
    -898
    -899
    -900
    -901
    -902
    -903
    -904
    -905
    -906
    -907
    -908
    -909
    -910
    -911
    -912
    -913
    -914
    -915
    -916
    -917
    -918
    -919
    -920
    -
    -
    # File 'src/numeric.c', line 886
    -
    -static mrb_value
    -fix_mod(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -  mrb_int a, b;
    -
    -  mrb_get_args(mrb, "o", &y);
    -  a = mrb_fixnum(x);
    -   if (mrb_fixnum_p(y) && a != MRB_INT_MIN && (b=mrb_fixnum(y)) != MRB_INT_MIN) {
    -    mrb_int mod;
    -
    -    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, NULL, &mod);
    -    return mrb_fixnum_value(mod);
    -  }
    -#ifdef MRB_WITHOUT_FLOAT
    -  mrb_raise(mrb, E_TYPE_ERROR, "non fixnum value");
    -#else
    -  else {
    -    mrb_float mod;
    -
    -    flodivmod(mrb, (mrb_float)a, mrb_to_flo(mrb, y), NULL, &mod);
    -    return mrb_float_value(mrb, mod);
    -  }
    -#endif
    -}
    -
    -
    - -
    -

    - - #&(integer) ⇒ Object - - - - - -

    -
    -

    Bitwise AND.

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1054
    -1055
    -1056
    -1057
    -1058
    -1059
    -1060
    -1061
    -
    -
    # File 'src/numeric.c', line 1054
    -
    -static mrb_value
    -fix_and(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -
    -  mrb_get_args(mrb, "o", &y);
    -  bit_op(x, y, and, &);
    -}
    -
    -
    - -
    -

    - - #*(numeric) ⇒ Object - - - - - -

    -
    -

    Performs multiplication: the class of the resulting object depends on -the class of numeric and on the magnitude of the -result.

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -839
    -840
    -841
    -842
    -843
    -844
    -845
    -846
    -
    -
    # File 'src/numeric.c', line 839
    -
    -static mrb_value
    -fix_mul(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -
    -  mrb_get_args(mrb, "o", &y);
    -  return fixnum_mul(mrb, x, y);
    -}
    -
    -
    - -
    -

    - - #+(numeric) ⇒ Object - - - - - -

    -
    -

    Performs addition: the class of the resulting object depends on -the class of numeric and on the magnitude of the -result.

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1312
    -1313
    -1314
    -1315
    -1316
    -1317
    -1318
    -1319
    -
    -
    # File 'src/numeric.c', line 1312
    -
    -static mrb_value
    -fix_plus(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value other;
    -
    -  mrb_get_args(mrb, "o", &other);
    -  return fixnum_plus(mrb, self, other);
    -}
    -
    -
    - -
    -

    - - #-(numeric) ⇒ Object - - - - - -

    -
    -

    Performs subtraction: the class of the resulting object depends on -the class of numeric and on the magnitude of the -result.

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1370
    -1371
    -1372
    -1373
    -1374
    -1375
    -1376
    -1377
    -
    -
    # File 'src/numeric.c', line 1370
    -
    -static mrb_value
    -fix_minus(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value other;
    -
    -  mrb_get_args(mrb, "o", &other);
    -  return fixnum_minus(mrb, self, other);
    -}
    -
    -
    - -
    -

    - - #<<(count) ⇒ Integer, Float - - - - - -

    -
    -

    Shifts fix left count positions (right if count is negative).

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

    Returns:

    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1167
    -1168
    -1169
    -1170
    -1171
    -1172
    -1173
    -1174
    -1175
    -1176
    -1177
    -1178
    -1179
    -1180
    -1181
    -1182
    -
    -
    # File 'src/numeric.c', line 1167
    -
    -static mrb_value
    -fix_lshift(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_int width, val;
    -
    -  mrb_get_args(mrb, "i", &width);
    -  if (width == 0) {
    -    return x;
    -  }
    -  val = mrb_fixnum(x);
    -  if (val == 0) return x;
    -  if (width < 0) {
    -    return rshift(val, -width);
    -  }
    -  return lshift(mrb, val, width);
    -}
    -
    -
    - -
    -

    - - #==(other) ⇒ Boolean - - - - - -

    -
    -

    Return true if fix equals other -numerically.

    - -

    1 == 2 #=> false - 1 == 1.0 #=> true

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -995
    -996
    -997
    -998
    -999
    -1000
    -1001
    -1002
    -1003
    -1004
    -1005
    -1006
    -1007
    -1008
    -1009
    -1010
    -1011
    -
    -
    # File 'src/numeric.c', line 995
    -
    -static mrb_value
    -fix_equal(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -
    -  mrb_get_args(mrb, "o", &y);
    -  switch (mrb_type(y)) {
    -  case MRB_TT_FIXNUM:
    -    return mrb_bool_value(mrb_fixnum(x) == mrb_fixnum(y));
    -#ifndef MRB_WITHOUT_FLOAT
    -  case MRB_TT_FLOAT:
    -    return mrb_bool_value((mrb_float)mrb_fixnum(x) == mrb_float(y));
    -#endif
    -  default:
    -    return mrb_false_value();
    -  }
    -}
    -
    -
    - -
    -

    - - #>>(count) ⇒ Integer, Float - - - - - -

    -
    -

    Shifts fix right count positions (left if count is negative).

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

    Returns:

    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1192
    -1193
    -1194
    -1195
    -1196
    -1197
    -1198
    -1199
    -1200
    -1201
    -1202
    -1203
    -1204
    -1205
    -1206
    -1207
    -
    -
    # File 'src/numeric.c', line 1192
    -
    -static mrb_value
    -fix_rshift(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_int width, val;
    -
    -  mrb_get_args(mrb, "i", &width);
    -  if (width == 0) {
    -    return x;
    -  }
    -  val = mrb_fixnum(x);
    -  if (val == 0) return x;
    -  if (width < 0) {
    -    return lshift(mrb, val, -width);
    -  }
    -  return rshift(val, width);
    -}
    -
    -
    - -
    -

    - - #^(integer) ⇒ Object - - - - - -

    -
    -

    Bitwise EXCLUSIVE OR.

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1088
    -1089
    -1090
    -1091
    -1092
    -1093
    -1094
    -1095
    -
    -
    # File 'src/numeric.c', line 1088
    -
    -static mrb_value
    -fix_xor(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -
    -  mrb_get_args(mrb, "o", &y);
    -  bit_op(x, y, or, ^);
    -}
    -
    -
    - -
    -

    - - #divmod(numeric) ⇒ Array - - - - - -

    -
    -

    See Numeric#divmod.

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'src/numeric.c', line 928
    -
    -static mrb_value
    -fix_divmod(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -
    -  mrb_get_args(mrb, "o", &y);
    -
    -  if (mrb_fixnum_p(y)) {
    -    mrb_int div, mod;
    -
    -    if (mrb_fixnum(y) == 0) {
    -#ifdef MRB_WITHOUT_FLOAT
    -      return mrb_assoc_new(mrb, mrb_fixnum_value(0), mrb_fixnum_value(0));
    -#else
    -      return mrb_assoc_new(mrb, ((mrb_fixnum(x) == 0) ?
    -                                 mrb_float_value(mrb, NAN):
    -                                 mrb_float_value(mrb, INFINITY)),
    -                           mrb_float_value(mrb, NAN));
    -#endif
    -    }
    -    fixdivmod(mrb, mrb_fixnum(x), mrb_fixnum(y), &div, &mod);
    -    return mrb_assoc_new(mrb, mrb_fixnum_value(div), mrb_fixnum_value(mod));
    -  }
    -#ifdef MRB_WITHOUT_FLOAT
    -  mrb_raise(mrb, E_TYPE_ERROR, "non fixnum value");
    -#else
    -  else {
    -    mrb_float div, mod;
    -    mrb_value a, b;
    -
    -    flodivmod(mrb, (mrb_float)mrb_fixnum(x), mrb_to_flo(mrb, y), &div, &mod);
    -    a = mrb_int_value(mrb, div);
    -    b = mrb_float_value(mrb, mod);
    -    return mrb_assoc_new(mrb, a, b);
    -  }
    -#endif
    -}
    -
    -
    - -
    -

    - - #eql?(numeric) ⇒ Boolean - - - - - -

    -
    -

    Returns true if num and numeric are the -same type and have equal values.

    - -

    1 == 1.0 #=> true - 1.eql?(1.0) #=> false - (1.0).eql?(1.0) #=> true

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -368
    -369
    -370
    -371
    -372
    -373
    -374
    -375
    -376
    -
    -
    # File 'src/numeric.c', line 368
    -
    -static mrb_value
    -fix_eql(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -
    -  mrb_get_args(mrb, "o", &y);
    -  if (!mrb_fixnum_p(y)) return mrb_false_value();
    -  return mrb_bool_value(mrb_fixnum(x) == mrb_fixnum(y));
    -}
    -
    -
    - -
    -

    - - #to_s(base = 10) ⇒ String - - - - - -

    -
    -

    Returns a string containing the representation of fix radix -base (between 2 and 36).

    - -

    12345.to_s #=> “12345” - 12345.to_s(2) #=> “11000000111001” - 12345.to_s(8) #=> “30071” - 12345.to_s(10) #=> “12345” - 12345.to_s(16) #=> “3039” - 12345.to_s(36) #=> “9ix”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1425
    -1426
    -1427
    -1428
    -1429
    -1430
    -1431
    -1432
    -
    -
    # File 'src/numeric.c', line 1425
    -
    -static mrb_value
    -fix_to_s(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int base = 10;
    -
    -  mrb_get_args(mrb, "|i", &base);
    -  return mrb_fixnum_to_str(mrb, self, base);
    -}
    -
    -
    - -
    -

    - - #to_fObject - - - - - -

    -
    -

    15.2.8.3.23

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1219
    -1220
    -1221
    -1222
    -1223
    -
    -
    # File 'src/numeric.c', line 1219
    -
    -static mrb_value
    -fix_to_f(mrb_state *mrb, mrb_value num)
    -{
    -  return mrb_float_value(mrb, (mrb_float)mrb_fixnum(num));
    -}
    -
    -
    - -
    -

    - - #to_s(base = 10) ⇒ String - - - - - -

    -
    -

    Returns a string containing the representation of fix radix -base (between 2 and 36).

    - -

    12345.to_s #=> “12345” - 12345.to_s(2) #=> “11000000111001” - 12345.to_s(8) #=> “30071” - 12345.to_s(10) #=> “12345” - 12345.to_s(16) #=> “3039” - 12345.to_s(36) #=> “9ix”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1425
    -1426
    -1427
    -1428
    -1429
    -1430
    -1431
    -1432
    -
    -
    # File 'src/numeric.c', line 1425
    -
    -static mrb_value
    -fix_to_s(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int base = 10;
    -
    -  mrb_get_args(mrb, "|i", &base);
    -  return mrb_fixnum_to_str(mrb, self, base);
    -}
    -
    -
    - -
    -

    - - #|(integer) ⇒ Object - - - - - -

    -
    -

    Bitwise OR.

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1071
    -1072
    -1073
    -1074
    -1075
    -1076
    -1077
    -1078
    -
    -
    # File 'src/numeric.c', line 1071
    -
    -static mrb_value
    -fix_or(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -
    -  mrb_get_args(mrb, "o", &y);
    -  bit_op(x, y, or, |);
    -}
    -
    -
    - -
    -

    - - #~Integer - - - - - -

    -
    -

    One’s complement: returns a number where each bit is flipped. - ex.0—00001 (1)-> 1—11110 (-2) - ex.0—00010 (2)-> 1—11101 (-3) - ex.0—00100 (4)-> 1—11011 (-5)

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

    Returns:

    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1024
    -1025
    -1026
    -1027
    -1028
    -1029
    -1030
    -
    -
    # File 'src/numeric.c', line 1024
    -
    -static mrb_value
    -fix_rev(mrb_state *mrb, mrb_value num)
    -{
    -  mrb_int val = mrb_fixnum(num);
    -
    -  return mrb_fixnum_value(~val);
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Float.html b/docs/api/Float.html deleted file mode 100644 index 0e8efb2..0000000 --- a/docs/api/Float.html +++ /dev/null @@ -1,2877 +0,0 @@ - - - - - - - Class: Float - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Float - - - -

    -
    - -
    -
    Inherits:
    -
    - Numeric - -
      -
    • Object
    • - - - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    src/numeric.c
    -
    - -
    - -

    Overview

    -
    -

    15.2.9

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

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #% ⇒ Object - - - - - - - - - - - - - -

      Return the modulo after division of flt by other.

      -
      - -
    • - - -
    • - - - #& ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #*(other) ⇒ Float - - - - - - - - - - - - - -

      Returns a new float which is the product of float and other.

      -
      - -
    • - - -
    • - - - #+ ⇒ Object - - - - - - - - - - - - - -

      15.2.9.3.1.

      -
      - -
    • - - -
    • - - - #-(other) ⇒ Float - - - - - - - - - - - - - -

      Returns a new float which is the difference of float and other.

      -
      - -
    • - - -
    • - - - #<< ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #==(obj) ⇒ Boolean - - - - - - - - - - - - - -

      Returns true only if obj has the same value as flt.

      -
      - -
    • - - -
    • - - - #>> ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #^ ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #ceil ⇒ Integer - - - - - - - - - - - - - -

      Returns the smallest Integer greater than or equal to flt.

      -
      - -
    • - - -
    • - - - #divmod ⇒ Object - - - - - - - - - - - - - -

      15.2.9.3.15.

      -
      - -
    • - - -
    • - - - #eql? ⇒ Boolean - - - - - - - - - - - - - -

      15.2.8.3.16.

      -
      - -
    • - - -
    • - - - #finite? ⇒ Boolean - - - - - - - - - - - - - -

      Returns true if flt is a valid IEEE floating point number (it is not infinite, and nan? is false).

      -
      - -
    • - - -
    • - - - #floor ⇒ Integer - - - - - - - - - - - - - -

      Returns the largest integer less than or equal to flt.

      -
      - -
    • - - -
    • - - - #infinite? ⇒ nil, ... - - - - - - - - - - - - - -

      Returns nil, -1, or +1 depending on whether flt is finite, -infinity, or +infinity.

      -
      - -
    • - - -
    • - - - #to_s ⇒ String - - - - - - - - - - - - - -

      Returns a string containing a representation of self.

      -
      - -
    • - - -
    • - - - #nan? ⇒ Boolean - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #round([ndigits]) ⇒ Integer, Float - - - - - - - - - - - - - -

      Rounds flt to a given precision in decimal digits (default 0 digits).

      -
      - -
    • - - -
    • - - - #to_f ⇒ self - - - - - - - - - - - - - -

      As flt is already a float, returns +self+.

      -
      - -
    • - - -
    • - - - #to_i ⇒ Object - - - - - - - - - - - - - -

      Returns flt truncated to an Integer.

      -
      - -
    • - - -
    • - - - #to_int ⇒ Object - - - - - - - - - - - - - -

      Returns flt truncated to an Integer.

      -
      - -
    • - - -
    • - - - #to_s ⇒ String - - - - - - - - - - - - - -

      Returns a string containing a representation of self.

      -
      - -
    • - - -
    • - - - #truncate ⇒ Object - - - - - - - - - - - - - -

      Returns flt truncated to an Integer.

      -
      - -
    • - - -
    • - - - #| ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #~ ⇒ Object - - - - - - - - - - - - - -

      15.2.9.3.7.

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

    Methods inherited from Numeric

    -

    #+@, #-@, #abs, #negative?, #nonzero?, #positive?, #to_r, #zero?

    - - - - - - - - - -

    Methods included from Comparable

    -

    #<, #<=, #>, #>=, #between?, #clamp

    - - -
    -

    Instance Method Details

    - - -
    -

    - - - #%(other) ⇒ Float - - #modulo(other) ⇒ Float - - - - - - -

    -
    -

    Return the modulo after division of flt by other.

    - -

    6543.21.modulo(137) #=> 104.21 - 6543.21.modulo(137.24) #=> 92.9299999999996

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #%(other) ⇒ Float -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Float) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #modulo(other) ⇒ Float -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Float) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -343
    -344
    -345
    -346
    -347
    -348
    -349
    -350
    -351
    -352
    -353
    -
    -
    # File 'src/numeric.c', line 343
    -
    -static mrb_value
    -flo_mod(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -  mrb_float mod;
    -
    -  mrb_get_args(mrb, "o", &y);
    -
    -  flodivmod(mrb, mrb_float(x), mrb_to_flo(mrb, y), 0, &mod);
    -  return mrb_float_value(mrb, mod);
    -}
    -
    -
    - -
    -

    - - #&Object - - - - - -

    - - - - -
    -
    -
    -
    -1037
    -
    -
    # File 'src/numeric.c', line 1037
    -
    -static mrb_value flo_and(mrb_state *mrb, mrb_value x);
    -
    -
    - -
    -

    - - #*(other) ⇒ Float - - - - - -

    -
    -

    Returns a new float which is the product of float -and other.

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -281
    -282
    -283
    -284
    -285
    -286
    -287
    -288
    -
    -
    # File 'src/numeric.c', line 281
    -
    -static mrb_value
    -flo_mul(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -
    -  mrb_get_args(mrb, "o", &y);
    -  return mrb_float_value(mrb, mrb_float(x) * mrb_to_flo(mrb, y));
    -}
    -
    -
    - -
    -

    - - #+Object - - - - - -

    -
    -

    15.2.9.3.1

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1597
    -1598
    -1599
    -1600
    -1601
    -1602
    -1603
    -1604
    -
    -
    # File 'src/numeric.c', line 1597
    -
    -static mrb_value
    -flo_plus(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -
    -  mrb_get_args(mrb, "o", &y);
    -  return mrb_float_value(mrb, mrb_float(x) + mrb_to_flo(mrb, y));
    -}
    -
    -
    - -
    -

    - - #-(other) ⇒ Float - - - - - -

    -
    -

    Returns a new float which is the difference of float -and other.

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -263
    -264
    -265
    -266
    -267
    -268
    -269
    -270
    -
    -
    # File 'src/numeric.c', line 263
    -
    -static mrb_value
    -flo_minus(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -
    -  mrb_get_args(mrb, "o", &y);
    -  return mrb_float_value(mrb, mrb_float(x) - mrb_to_flo(mrb, y));
    -}
    -
    -
    - -
    -

    - - #<<Object - - - - - -

    - - - - -
    -
    -
    -
    -535
    -536
    -537
    -538
    -539
    -540
    -541
    -542
    -
    -
    # File 'src/numeric.c', line 535
    -
    -static mrb_value
    -flo_lshift(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_int width;
    -
    -  mrb_get_args(mrb, "i", &width);
    -  return flo_shift(mrb, x, width);
    -}
    -
    -
    - -
    -

    - - #==(obj) ⇒ Boolean - - - - - -

    -
    -

    Returns true only if obj has the same value -as flt. Contrast this with Float#eql?, which -requires obj to be a Float.

    - -

    1.0 == 1 #=> true

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -402
    -403
    -404
    -405
    -406
    -407
    -408
    -409
    -410
    -411
    -412
    -413
    -414
    -415
    -416
    -
    -
    # File 'src/numeric.c', line 402
    -
    -static mrb_value
    -flo_eq(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -  mrb_get_args(mrb, "o", &y);
    -
    -  switch (mrb_type(y)) {
    -  case MRB_TT_FIXNUM:
    -    return mrb_bool_value(mrb_float(x) == (mrb_float)mrb_fixnum(y));
    -  case MRB_TT_FLOAT:
    -    return mrb_bool_value(mrb_float(x) == mrb_float(y));
    -  default:
    -    return mrb_false_value();
    -  }
    -}
    -
    -
    - -
    -

    - - #>>Object - - - - - -

    - - - - -
    -
    -
    -
    -526
    -527
    -528
    -529
    -530
    -531
    -532
    -533
    -
    -
    # File 'src/numeric.c', line 526
    -
    -static mrb_value
    -flo_rshift(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_int width;
    -
    -  mrb_get_args(mrb, "i", &width);
    -  return flo_shift(mrb, x, -width);
    -}
    -
    -
    - -
    -

    - - #^Object - - - - - -

    - - - - -
    -
    -
    -
    -1039
    -
    -
    # File 'src/numeric.c', line 1039
    -
    -static mrb_value flo_xor(mrb_state *mrb, mrb_value x);
    -
    -
    - -
    -

    - - #ceilInteger - - - - - -

    -
    -

    Returns the smallest Integer greater than or equal to -flt.

    - -

    1.2.ceil #=> 2 - 2.0.ceil #=> 2 - (-1.2).ceil #=> -1 - (-2.0).ceil #=> -2

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

    Returns:

    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -646
    -647
    -648
    -649
    -650
    -651
    -652
    -653
    -
    -
    # File 'src/numeric.c', line 646
    -
    -static mrb_value
    -flo_ceil(mrb_state *mrb, mrb_value num)
    -{
    -  mrb_float f = ceil(mrb_float(num));
    -
    -  mrb_check_num_exact(mrb, f);
    -  return mrb_int_value(mrb, f);
    -}
    -
    -
    - -
    -

    - - #divmodObject - - - - - -

    -
    -

    15.2.9.3.15

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -967
    -968
    -969
    -970
    -971
    -972
    -973
    -974
    -975
    -976
    -977
    -978
    -979
    -980
    -
    -
    # File 'src/numeric.c', line 967
    -
    -static mrb_value
    -flo_divmod(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -  mrb_float div, mod;
    -  mrb_value a, b;
    -
    -  mrb_get_args(mrb, "o", &y);
    -
    -  flodivmod(mrb, mrb_float(x), mrb_to_flo(mrb, y), &div, &mod);
    -  a = mrb_int_value(mrb, div);
    -  b = mrb_float_value(mrb, mod);
    -  return mrb_assoc_new(mrb, a, b);
    -}
    -
    -
    - -
    -

    - - #eql?Boolean - - - - - -

    -
    -

    15.2.8.3.16

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -379
    -380
    -381
    -382
    -383
    -384
    -385
    -386
    -387
    -
    -
    # File 'src/numeric.c', line 379
    -
    -static mrb_value
    -flo_eql(mrb_state *mrb, mrb_value x)
    -{
    -  mrb_value y;
    -
    -  mrb_get_args(mrb, "o", &y);
    -  if (!mrb_float_p(y)) return mrb_false_value();
    -  return mrb_bool_value(mrb_float(x) == mrb_float(y));
    -}
    -
    -
    - -
    -

    - - #finite?Boolean - - - - - -

    -
    -

    Returns true if flt is a valid IEEE floating -point number (it is not infinite, and nan? is -false).

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -593
    -594
    -595
    -596
    -597
    -
    -
    # File 'src/numeric.c', line 593
    -
    -static mrb_value
    -flo_finite_p(mrb_state *mrb, mrb_value num)
    -{
    -  return mrb_bool_value(isfinite(mrb_float(num)));
    -}
    -
    -
    - -
    -

    - - #floorInteger - - - - - -

    -
    -

    Returns the largest integer less than or equal to flt.

    - -

    1.2.floor #=> 1 - 2.0.floor #=> 2 - (-1.2).floor #=> -2 - (-2.0).floor #=> -2

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

    Returns:

    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -623
    -624
    -625
    -626
    -627
    -628
    -629
    -630
    -
    -
    # File 'src/numeric.c', line 623
    -
    -static mrb_value
    -flo_floor(mrb_state *mrb, mrb_value num)
    -{
    -  mrb_float f = floor(mrb_float(num));
    -
    -  mrb_check_num_exact(mrb, f);
    -  return mrb_int_value(mrb, f);
    -}
    -
    -
    - -
    -

    - - #infinite?nil, ... - - - - - -

    -
    -

    Returns nil, -1, or +1 depending on whether flt -is finite, -infinity, or +infinity.

    - -

    (0.0).infinite? #=> nil - (-1.0/0.0).infinite? #=> -1 - (+1.0/0.0).infinite? #=> 1

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

    Returns:

    -
      - -
    • - - - (nil, -1, +1) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -571
    -572
    -573
    -574
    -575
    -576
    -577
    -578
    -579
    -580
    -
    -
    # File 'src/numeric.c', line 571
    -
    -static mrb_value
    -flo_infinite_p(mrb_state *mrb, mrb_value num)
    -{
    -  mrb_float value = mrb_float(num);
    -
    -  if (isinf(value)) {
    -    return mrb_fixnum_value(value < 0 ? -1 : 1);
    -  }
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #to_sString - - - - - -

    -
    -

    Returns a string containing a representation of self. As well as a -fixed or exponential form of the number, the call may return -“NaN”, “Infinity”, and -“-Infinity”.

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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
    -244
    -245
    -246
    -247
    -248
    -249
    -250
    -251
    -252
    -
    -
    # File 'src/numeric.c', line 209
    -
    -static mrb_value
    -flo_to_s(mrb_state *mrb, mrb_value 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");
    -  }
    -  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, *p, *endp;
    -
    -    insert_dot_zero:
    -    begp = RSTRING_PTR(str);
    -    len = RSTRING_LEN(str);
    -    for (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;
    -    }
    -
    -    return str;
    -  }
    -}
    -
    -
    - -
    -

    - - #nan?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -759
    -760
    -761
    -762
    -763
    -
    -
    # File 'src/numeric.c', line 759
    -
    -static mrb_value
    -flo_nan_p(mrb_state *mrb, mrb_value num)
    -{
    -  return mrb_bool_value(isnan(mrb_float(num)));
    -}
    -
    -
    - -
    -

    - - #round([ndigits]) ⇒ Integer, Float - - - - - -

    -
    -

    Rounds flt to a given precision in decimal digits (default 0 digits). -Precision may be negative. Returns a floating point number when ndigits -is more than zero.

    - -

    1.4.round #=> 1 - 1.5.round #=> 2 - 1.6.round #=> 2 - (-1.5).round #=> -2

    - -

    1.234567.round(2) #=> 1.23 - 1.234567.round(3) #=> 1.235 - 1.234567.round(4) #=> 1.2346 - 1.234567.round(5) #=> 1.23457

    - -

    34567.89.round(-5) #=> 0 - 34567.89.round(-4) #=> 30000 - 34567.89.round(-3) #=> 35000 - 34567.89.round(-2) #=> 34600 - 34567.89.round(-1) #=> 34570 - 34567.89.round(0) #=> 34568 - 34567.89.round(1) #=> 34567.9 - 34567.89.round(2) #=> 34567.89 - 34567.89.round(3) #=> 34567.89

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

    Returns:

    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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
    -727
    -728
    -729
    -730
    -731
    -732
    -733
    -734
    -735
    -
    -
    # File 'src/numeric.c', line 686
    -
    -static mrb_value
    -flo_round(mrb_state *mrb, mrb_value num)
    -{
    -  double number, f;
    -  mrb_int ndigits = 0;
    -  mrb_int i;
    -
    -  mrb_get_args(mrb, "|i", &ndigits);
    -  number = mrb_float(num);
    -
    -  if (0 < ndigits && (isinf(number) || isnan(number))) {
    -    return num;
    -  }
    -  mrb_check_num_exact(mrb, number);
    -
    -  f = 1.0;
    -  i = ndigits >= 0 ? ndigits : -ndigits;
    -  if (ndigits > DBL_DIG+2) return num;
    -  while  (--i >= 0)
    -    f = f*10.0;
    -
    -  if (isinf(f)) {
    -    if (ndigits < 0) number = 0;
    -  }
    -  else {
    -    double d;
    -
    -    if (ndigits < 0) number /= f;
    -    else number *= f;
    -
    -    /* home-made inline implementation of round(3) */
    -    if (number > 0.0) {
    -      d = floor(number);
    -      number = d + (number - d >= 0.5);
    -    }
    -    else if (number < 0.0) {
    -      d = ceil(number);
    -      number = d - (d - number >= 0.5);
    -    }
    -
    -    if (ndigits < 0) number *= f;
    -    else number /= f;
    -  }
    -
    -  if (ndigits > 0) {
    -    if (!isfinite(number)) return num;
    -    return mrb_float_value(mrb, number);
    -  }
    -  return mrb_int_value(mrb, number);
    -}
    -
    -
    - -
    -

    - - #to_fself - - - - - -

    -
    -

    As flt is already a float, returns +self+.

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

    Returns:

    -
      - -
    • - - - (self) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -552
    -553
    -554
    -555
    -556
    -
    -
    # File 'src/numeric.c', line 552
    -
    -static mrb_value
    -flo_to_f(mrb_state *mrb, mrb_value num)
    -{
    -  return num;
    -}
    -
    -
    - -
    -

    - - - #to_iInteger - - #truncateInteger - - - - - - -

    -
    -

    Returns flt truncated to an Integer.

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #to_iInteger -
      -
      - - - -
      -
      -
      - -

      Returns:

      - - -
      - - -
    • - - -
    • - #truncateInteger -
      -
      - - - -
      -
      -
      - -

      Returns:

      - - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -747
    -748
    -749
    -750
    -751
    -752
    -753
    -754
    -755
    -756
    -757
    -
    -
    # File 'src/numeric.c', line 747
    -
    -static mrb_value
    -flo_truncate(mrb_state *mrb, mrb_value num)
    -{
    -  mrb_float f = mrb_float(num);
    -
    -  if (f > 0.0) f = floor(f);
    -  if (f < 0.0) f = ceil(f);
    -
    -  mrb_check_num_exact(mrb, f);
    -  return mrb_int_value(mrb, f);
    -}
    -
    -
    - -
    -

    - - - #to_iInteger - - #truncateInteger - - - - - - -

    -
    -

    Returns flt truncated to an Integer.

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #to_iInteger -
      -
      - - - -
      -
      -
      - -

      Returns:

      - - -
      - - -
    • - - -
    • - #truncateInteger -
      -
      - - - -
      -
      -
      - -

      Returns:

      - - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -747
    -748
    -749
    -750
    -751
    -752
    -753
    -754
    -755
    -756
    -757
    -
    -
    # File 'src/numeric.c', line 747
    -
    -static mrb_value
    -flo_truncate(mrb_state *mrb, mrb_value num)
    -{
    -  mrb_float f = mrb_float(num);
    -
    -  if (f > 0.0) f = floor(f);
    -  if (f < 0.0) f = ceil(f);
    -
    -  mrb_check_num_exact(mrb, f);
    -  return mrb_int_value(mrb, f);
    -}
    -
    -
    - -
    -

    - - #to_sString - - - - - -

    -
    -

    Returns a string containing a representation of self. As well as a -fixed or exponential form of the number, the call may return -“NaN”, “Infinity”, and -“-Infinity”.

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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
    -244
    -245
    -246
    -247
    -248
    -249
    -250
    -251
    -252
    -
    -
    # File 'src/numeric.c', line 209
    -
    -static mrb_value
    -flo_to_s(mrb_state *mrb, mrb_value 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");
    -  }
    -  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, *p, *endp;
    -
    -    insert_dot_zero:
    -    begp = RSTRING_PTR(str);
    -    len = RSTRING_LEN(str);
    -    for (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;
    -    }
    -
    -    return str;
    -  }
    -}
    -
    -
    - -
    -

    - - - #to_iInteger - - #truncateInteger - - - - - - -

    -
    -

    Returns flt truncated to an Integer.

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #to_iInteger -
      -
      - - - -
      -
      -
      - -

      Returns:

      - - -
      - - -
    • - - -
    • - #truncateInteger -
      -
      - - - -
      -
      -
      - -

      Returns:

      - - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -747
    -748
    -749
    -750
    -751
    -752
    -753
    -754
    -755
    -756
    -757
    -
    -
    # File 'src/numeric.c', line 747
    -
    -static mrb_value
    -flo_truncate(mrb_state *mrb, mrb_value num)
    -{
    -  mrb_float f = mrb_float(num);
    -
    -  if (f > 0.0) f = floor(f);
    -  if (f < 0.0) f = ceil(f);
    -
    -  mrb_check_num_exact(mrb, f);
    -  return mrb_int_value(mrb, f);
    -}
    -
    -
    - -
    -

    - - #|Object - - - - - -

    - - - - -
    -
    -
    -
    -1038
    -
    -
    # File 'src/numeric.c', line 1038
    -
    -static mrb_value flo_or(mrb_state *mrb, mrb_value x);
    -
    -
    - -
    -

    - - #~Object - - - - - -

    -
    -

    15.2.9.3.7

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -444
    -445
    -446
    -447
    -448
    -449
    -450
    -
    -
    # File 'src/numeric.c', line 444
    -
    -static mrb_value
    -flo_rev(mrb_state *mrb, mrb_value x)
    -{
    -  int64_t v1;
    -  v1 = (int64_t)mrb_float(x);
    -  return int64_value(mrb, ~v1);
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/FloatDomainError.html b/docs/api/FloatDomainError.html deleted file mode 100644 index cb7fa5a..0000000 --- a/docs/api/FloatDomainError.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - Exception: FloatDomainError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: FloatDomainError - - - -

    -
    - -
    -
    Inherits:
    -
    - RangeError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/10error.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/FrozenError.html b/docs/api/FrozenError.html deleted file mode 100644 index 809b093..0000000 --- a/docs/api/FrozenError.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - Exception: FrozenError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: FrozenError - - - -

    -
    - -
    -
    Inherits:
    -
    - RuntimeError - -
      -
    • Object
    • - - - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/10error.rb
    -
    - -
    - - - - - - - - - - - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/GC.html b/docs/api/GC.html deleted file mode 100644 index f83c793..0000000 --- a/docs/api/GC.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - Module: GC - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Module: GC - - - -

    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    src/gc.c
    -
    - -
    - - - - - - - - - - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Hash.html b/docs/api/Hash.html deleted file mode 100644 index 2477504..0000000 --- a/docs/api/Hash.html +++ /dev/null @@ -1,6535 +0,0 @@ - - - - - - - Class: Hash - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Hash - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - -
    -
    Includes:
    -
    Enumerable
    -
    - - - - - - -
    -
    Defined in:
    -
    mrblib/hash.rb,
    - src/hash.c,
    mrblib/hash.rb,
    mrbgems/mruby-hash-ext/mrblib/hash.rb
    -
    -
    - -
    - -

    Overview

    -
    -

    Hash is enumerable

    - -

    ISO 15.2.13.3

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

    Constant Summary

    - -

    Constants included - from Enumerable

    -

    Enumerable::NONE

    - - - - - - -

    - Class Method Summary - collapse -

    - -
      - -
    • - - - .[](*object) ⇒ Object - - - - - - - - - - - - - -

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

      -
      - -
    • - - -
    - -

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #<(hash) ⇒ Object - - - - - - - - - - - - - -

      call-seq: hash < other -> true or false.

      -
      - -
    • - - -
    • - - - #<=(hash) ⇒ Object - - - - - - - - - - - - - -

      call-seq: hash <= other -> true or false.

      -
      - -
    • - - -
    • - - - #==(hash) ⇒ Object - - - - - - - - - - - - - -

      Equality—Two hashes are equal if they each contain the same number of keys and if each key-value pair is equal to (according to Object#==) the corresponding elements in the other hash.

      -
      - -
    • - - -
    • - - - #>(hash) ⇒ Object - - - - - - - - - - - - - -

      call-seq: hash > other -> true or false.

      -
      - -
    • - - -
    • - - - #>=(hash) ⇒ Object - - - - - - - - - - - - - -

      call-seq: hash >= other -> true or false.

      -
      - -
    • - - -
    • - - - #[](key) ⇒ Object - - - - - - - - - - - - - -

      Element Reference—Retrieves the value object corresponding to the key object.

      -
      - -
    • - - -
    • - - - #[]= ⇒ Object - - - - - - - - - - - - - -

      Element Assignment—Associates the value given by value with the key given by key.

      -
      - -
    • - - -
    • - - - #__delete ⇒ Object - - - - - - - - - - - - - -

      core of 15.2.13.4.8.

      -
      - -
    • - - -
    • - - - #_inspect(recur_list) ⇒ Object - - - - - - - - - - - - - -

      internal method for Hash inspection.

      -
      - -
    • - - -
    • - - - #clear ⇒ Hash - - - - - - - - - - - - - -

      Removes all key-value pairs from hsh.

      -
      - -
    • - - -
    • - - - #compact ⇒ Object - - - - - - - - - - - - - -

      call-seq: hsh.compact -> new_hsh.

      -
      - -
    • - - -
    • - - - #compact! ⇒ Object - - - - - - - - - - - - - -

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

      -
      - -
    • - - -
    • - - - #default(key = nil) ⇒ Object - - - - - - - - - - - - - -

      Returns the default value, the value that would be returned by hsh[key] if key did not exist in hsh.

      -
      - -
    • - - -
    • - - - #default=(obj) ⇒ Object - - - - - - - - - - - - - -

      Sets the default value, the value returned for a key that does not exist in the hash.

      -
      - -
    • - - -
    • - - - #default_proc ⇒ Object - - - - - - - - - - - - - -

      If Hash::new was invoked with a block, return that block, otherwise return nil.

      -
      - -
    • - - -
    • - - - #default_proc=(proc_obj) ⇒ Proc - - - - - - - - - - - - - -

      Sets the default proc to be executed on each key lookup.

      -
      - -
    • - - -
    • - - - #delete(key, &block) ⇒ Object - - - - - - - - - - - - - -

      Delete the element with the key +key+.

      -
      - -
    • - - -
    • - - - #delete_if(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: hsh.delete_if {key, valueblock } -> hsh hsh.delete_if -> an_enumerator.
      -
      - -
    • - - -
    • - - - #dig(idx, *args) ⇒ Object - - - - - - - - - - - - - -

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

      -
      - -
    • - - -
    • - - - #each(&block) ⇒ Object - - - - (also: #each_pair) - - - - - - - - - - - -

      Calls the given block for each element of +self+ and pass the key and value of each element.

      -
      - -
    • - - -
    • - - - #each_key(&block) ⇒ Object - - - - - - - - - - - - - -

      Calls the given block for each element of +self+ and pass the key of each element.

      -
      - -
    • - - -
    • - - - #each_value(&block) ⇒ Object - - - - - - - - - - - - - -

      Calls the given block for each element of +self+ and pass the value of each element.

      -
      - -
    • - - -
    • - - - #empty? ⇒ Boolean - - - - - - - - - - - - - -

      Returns true if hsh contains no key-value pairs.

      -
      - -
    • - - -
    • - - - #eql?(hash) ⇒ Boolean - - - - - - - - - - - - - -

      Returns true if hash and other are both hashes with the same content compared by eql?.

      -
      - -
    • - - -
    • - - - #fetch(key, none = NONE, &block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: hsh.fetch(key [, default] ) -> obj hsh.fetch(key) {keyblock } -> obj.
      -
      - -
    • - - -
    • - - - #fetch_values(*keys, &block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: hsh.fetch_values(key, …) -> array hsh.fetch_values(key, …) {keyblock } -> array.
      -
      - -
    • - - -
    • - - - #flatten(level = 1) ⇒ Object - - - - - - - - - - - - - -

      call-seq: hash.flatten -> an_array hash.flatten(level) -> an_array.

      -
      - -
    • - - -
    • - - - #has_key? ⇒ Boolean - - - - - - - - - - - - - -

      15.2.13.4.13.

      -
      - -
    • - - -
    • - - - #has_value? ⇒ Object - - - - - - - - - - - - - -

      Returns true if the given value is present for some key in hsh.

      -
      - -
    • - - -
    • - - - #include? ⇒ Boolean - - - - - - - - - - - - - -

      15.2.13.4.15.

      -
      - -
    • - - -
    • - - - #initialize ⇒ Object - - - - - - - constructor - - - - - - - - -

      Returns a new, empty hash.

      -
      - -
    • - - -
    • - - - #inspect ⇒ Object - - - - (also: #to_s) - - - - - - - - - - - -

      ISO 15.2.13.4.30 (x).

      -
      - -
    • - - -
    • - - - #invert ⇒ Object - - - - - - - - - - - - - -

      call-seq: hsh.invert -> new_hash.

      -
      - -
    • - - -
    • - - - #keep_if(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: hsh.keep_if {key, valueblock } -> hsh hsh.keep_if -> an_enumerator.
      -
      - -
    • - - -
    • - - - #key(val) ⇒ Object - - - - - - - - - - - - - -

      call-seq: hsh.key(value) -> key.

      -
      - -
    • - - -
    • - - - #key? ⇒ Boolean - - - - - - - - - - - - - -

      15.2.13.4.18.

      -
      - -
    • - - -
    • - - - #keys ⇒ Array - - - - - - - - - - - - - -

      Returns a new array populated with the keys from this hash.

      -
      - -
    • - - -
    • - - - #length ⇒ Object - - - - - - - - - - - - - -

      Returns the number of key-value pairs in the hash.

      -
      - -
    • - - -
    • - - - #member? ⇒ Boolean - - - - - - - - - - - - - -

      15.2.13.4.21.

      -
      - -
    • - - -
    • - - - #merge(other, &block) ⇒ Object - - - - - - - - - - - - - -

      Return a hash which contains the content of +self+ and +other+.

      -
      - -
    • - - -
    • - - - #merge!(other, &block) ⇒ Object - - - - (also: #update) - - - - - - - - - - - -
      - - - - - - -
      call-seq: hsh.merge!(other_hash) -> hsh hsh.merge!(other_hash) key, oldval, newvalblock -> hsh.
      -
      - -
    • - - -
    • - - - #rehash ⇒ Hash - - - - - - - - - - - - - -

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

      -
      - -
    • - - -
    • - - - #reject(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - -
      call-seq: hsh.reject key, valueblock -> a_hash hsh.reject -> an_enumerator.
      -
      - -
    • - - -
    • - - - #reject!(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: hsh.reject! {key, valueblock } -> hsh or nil hsh.reject! -> an_enumerator.
      -
      - -
    • - - -
    • - - - #replace(hash) ⇒ Object - - - - (also: #initialize_copy) - - - - - - - - - - - -

      Replaces the contents of hsh with the contents of other hash.

      -
      - -
    • - - -
    • - - - #select(&block) ⇒ Object - - - - (also: #filter) - - - - - - - - - - - -
      - - - - - - -
      call-seq: hsh.select key, valueblock -> a_hash hsh.select -> an_enumerator.
      -
      - -
    • - - -
    • - - - #select!(&block) ⇒ Object - - - - (also: #filter!) - - - - - - - - - - - -
      - - - - - - - -
      call-seq: hsh.select! {key, valueblock } -> hsh or nil hsh.select! -> an_enumerator.
      -
      - -
    • - - -
    • - - - #shift ⇒ Array, Object - - - - - - - - - - - - - -

      Removes a key-value pair from hsh and returns it as the two-item array [ key, value ], or the hash’s default value if the hash is empty.

      -
      - -
    • - - -
    • - - - #size ⇒ Object - - - - - - - - - - - - - -

      Returns the number of key-value pairs in the hash.

      -
      - -
    • - - -
    • - - - #slice(*keys) ⇒ Hash - - - - - - - - - - - - - -

      Returns a hash containing only the given keys and their values.

      -
      - -
    • - - -
    • - - - #store ⇒ Object - - - - - - - - - - - - - -

      Element Assignment—Associates the value given by value with the key given by key.

      -
      - -
    • - - -
    • - - - #to_h ⇒ Object - - - - - - - - - - - - - -

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

      -
      - -
    • - - -
    • - - - #to_proc ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #transform_keys(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: hsh.transform_keys {keyblock } -> new_hash hsh.transform_keys -> an_enumerator.
      -
      - -
    • - - -
    • - - - #transform_keys!(&block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: hsh.transform_keys! {keyblock } -> hsh hsh.transform_keys! -> an_enumerator.
      -
      - -
    • - - -
    • - - - #transform_values(&b) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: hsh.transform_values {valueblock } -> new_hash hsh.transform_values -> an_enumerator.
      -
      - -
    • - - -
    • - - - #transform_values!(&b) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: hsh.transform_values! {keyblock } -> hsh hsh.transform_values! -> an_enumerator.
      -
      - -
    • - - -
    • - - - #value? ⇒ Object - - - - - - - - - - - - - -

      Returns true if the given value is present for some key in hsh.

      -
      - -
    • - - -
    • - - - #values ⇒ Array - - - - - - - - - - - - - -

      Returns a new array populated with the values from hsh.

      -
      - -
    • - - -
    • - - - #values_at(key, ...) ⇒ Array - - - - - - - - - - - - - -

      Return an array containing the values associated with the given keys.

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

    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, #filter_map, #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, #tally, #uniq, #zip

    -
    -

    Constructor Details

    - -
    -

    - - - #newObject - - #new(obj) ⇒ Object - - #new {|hash, key| ... } ⇒ Object - - - - - - -

    -
    -

    Returns a new, empty hash. If this hash is subsequently accessed by -a key that doesn’t correspond to a hash entry, the value returned -depends on the style of new used to create the hash. In -the first form, the access returns nil. If -obj is specified, this single object will be used for -all default values. If a block is specified, it will be -called with the hash object and the key, and should return the -default value. It is the block’s responsibility to store the value -in the hash if required.

    - -
    h = Hash.new("Go Fish")
    -h["a"] = 100
    -h["b"] = 200
    -h["a"]           #=> 100
    -h["c"]           #=> "Go Fish"
    -# The following alters the single default object
    -h["c"].upcase!   #=> "GO FISH"
    -h["d"]           #=> "GO FISH"
    -h.keys           #=> ["a", "b"]
    -
    -# While this creates a new default object each time
    -h = Hash.new { |hash, key| hash[key] = "Go Fish: #{key}" }
    -h["c"]           #=> "Go Fish: c"
    -h["c"].upcase!   #=> "GO FISH: C"
    -h["d"]           #=> "Go Fish: d"
    -h.keys           #=> ["c", "d"]
    -
    - - -
    -
    -
    - -

    Overloads:

    -
      - - - - -
    • - #new {|hash, key| ... } ⇒ Object -
      -
      - - - -
      -
      -
      - -

      Yields:

      - - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -792
    -793
    -794
    -795
    -796
    -797
    -798
    -799
    -800
    -801
    -802
    -803
    -804
    -805
    -806
    -807
    -808
    -809
    -810
    -811
    -812
    -813
    -
    -
    # File 'src/hash.c', line 792
    -
    -static mrb_value
    -mrb_hash_init(mrb_state *mrb, mrb_value hash)
    -{
    -  mrb_value block, ifnone;
    -  mrb_bool ifnone_p;
    -
    -  ifnone = mrb_nil_value();
    -  mrb_get_args(mrb, "&|o?", &block, &ifnone, &ifnone_p);
    -  mrb_hash_modify(mrb, hash);
    -  if (!mrb_nil_p(block)) {
    -    if (ifnone_p) {
    -      mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments");
    -    }
    -    RHASH(hash)->flags |= MRB_HASH_PROC_DEFAULT;
    -    ifnone = block;
    -  }
    -  if (!mrb_nil_p(ifnone)) {
    -    RHASH(hash)->flags |= MRB_HASH_DEFAULT;
    -    mrb_iv_set(mrb, hash, mrb_intern_lit(mrb, "ifnone"), ifnone);
    -  }
    -  return hash;
    -}
    -
    -
    - -
    - - -
    -

    Class Method Details

    - - -
    -

    - - .[](*object) ⇒ Object - - - - - -

    -
    -

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

    - -

    Creates a new hash populated with the given objects.

    - -

    Similar to the literal { _key_ => _value_, ... }. In the first -form, keys and values occur in pairs, so there must be an even number of -arguments.

    - -

    The second and third form take a single argument which is either an array -of key-value pairs or an object convertible to a hash.

    - -
    Hash["a", 100, "b", 200] #=> {"a"=>100, "b"=>200}
    -Hash[ [ ["a", 100], ["b", 200] ] ] #=> {"a"=>100, "b"=>200}
    -Hash["a" => 100, "b" => 200] #=> {"a"=>100, "b"=>200}
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -61
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 26
    -
    -def self.[](*object)
    -  length = object.length
    -  if length == 1
    -    o = object[0]
    -    if Hash === o
    -      h = self.new
    -      o.each { |k, v| h[k] = v }
    -      return h
    -    elsif o.respond_to?(:to_a)
    -      h = self.new
    -      o.to_a.each do |i|
    -        raise ArgumentError, "wrong element type #{i.class} (expected array)" unless i.respond_to?(:to_a)
    -        k, v = nil
    -        case i.size
    -        when 2
    -          k = i[0]
    -          v = i[1]
    -        when 1
    -          k = i[0]
    -        else
    -          raise ArgumentError, "invalid number of elements (#{i.size} for 1..2)"
    -        end
    -        h[k] = v
    -      end
    -      return h
    -    end
    -  end
    -  unless length % 2 == 0
    -    raise ArgumentError, 'odd number of arguments for Hash'
    -  end
    -  h = self.new
    -  0.step(length - 2, 2) do |i|
    -    h[object[i]] = object[i + 1]
    -  end
    -  h
    -end
    -
    -
    - -
    - -
    -

    Instance Method Details

    - - -
    -

    - - #<(hash) ⇒ Object - - - - - -

    -
    -

    call-seq: - hash < other -> true or false

    - -

    Returns true if hash is subset of - other.

    - -
    h1 = {a:1, b:2}
    -h2 = {a:1, b:2, c:3}
    -h1 < h2    #=> true
    -h2 < h1    #=> false
    -h1 < h1    #=> false
    -
    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -312
    -313
    -314
    -315
    -316
    -317
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 312
    -
    -def <(hash)
    -  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
    -  }
    -end
    -
    -
    - -
    -

    - - #<=(hash) ⇒ Object - - - - - -

    -
    -

    call-seq: - hash <= other -> true or false

    - -

    Returns true if hash is subset of - other or equals to other.

    - -
    h1 = {a:1, b:2}
    -h2 = {a:1, b:2, c:3}
    -h1 <= h2   #=> true
    -h2 <= h1   #=> false
    -h1 <= h1   #=> true
    -
    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -332
    -333
    -334
    -335
    -336
    -337
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 332
    -
    -def <=(hash)
    -  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
    -  }
    -end
    -
    -
    - -
    -

    - - #==(hash) ⇒ Object - - - - - -

    -
    -

    Equality—Two hashes are equal if they each contain the same number - of keys and if each key-value pair is equal to (according to - Object#==) the corresponding elements in the other - hash.

    - -

    ISO 15.2.13.4.1

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -
    -
    # File 'mrblib/hash.rb', line 13
    -
    -def ==(hash)
    -  return true if self.equal?(hash)
    -  unless Hash === hash
    -    return false
    -  end
    -  return false if self.size != hash.size
    -  self.each do |k,v|
    -    return false unless hash.key?(k)
    -    return false unless self[k] == hash[k]
    -  end
    -  return true
    -end
    -
    -
    - -
    -

    - - #>(hash) ⇒ Object - - - - - -

    -
    -

    call-seq: - hash > other -> true or false

    - -

    Returns true if other is subset of - hash.

    - -
    h1 = {a:1, b:2}
    -h2 = {a:1, b:2, c:3}
    -h1 > h2    #=> false
    -h2 > h1    #=> true
    -h1 > h1    #=> false
    -
    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -352
    -353
    -354
    -355
    -356
    -357
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 352
    -
    -def >(hash)
    -  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
    -  }
    -end
    -
    -
    - -
    -

    - - #>=(hash) ⇒ Object - - - - - -

    -
    -

    call-seq: - hash >= other -> true or false

    - -

    Returns true if other is subset of - hash or equals to hash.

    - -
    h1 = {a:1, b:2}
    -h2 = {a:1, b:2, c:3}
    -h1 >= h2   #=> false
    -h2 >= h1   #=> true
    -h1 >= h1   #=> true
    -
    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -372
    -373
    -374
    -375
    -376
    -377
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 372
    -
    -def >=(hash)
    -  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
    -  }
    -end
    -
    -
    - -
    -

    - - #[](key) ⇒ Object - - - - - -

    -
    -

    Element Reference—Retrieves the value object corresponding -to the key object. If not found, returns the default value (see -Hash::new for details).

    - -

    h = { “a” => 100, “b” => 200 } - h[“a”] #=> 100 - h[“c”] #=> nil

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -829
    -830
    -831
    -832
    -833
    -834
    -835
    -836
    -
    -
    # File 'src/hash.c', line 829
    -
    -static mrb_value
    -mrb_hash_aget(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value key;
    -
    -  mrb_get_args(mrb, "o", &key);
    -  return mrb_hash_get(mrb, self, key);
    -}
    -
    -
    - -
    -

    - - - #[]=(key) ⇒ Object - - #store(key, value) ⇒ Object - - - - - - -

    -
    -

    Element Assignment—Associates the value given by -value with the key given by key. -key should not have its value changed while it is in -use as a key (a String passed as a key will be -duplicated and frozen).

    - -
    h = { "a" => 100, "b" => 200 }
    -h["a"] = 9
    -h["c"] = 4
    -h   #=> {"a"=>9, "b"=>200, "c"=>4}
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1125
    -1126
    -1127
    -1128
    -1129
    -1130
    -1131
    -1132
    -1133
    -
    -
    # File 'src/hash.c', line 1125
    -
    -static mrb_value
    -mrb_hash_aset(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value key, val;
    -
    -  mrb_get_args(mrb, "oo", &key, &val);
    -  mrb_hash_set(mrb, self, key, val);
    -  return val;
    -}
    -
    -
    - -
    -

    - - #__deleteObject - - - - - -

    -
    -

    core of 15.2.13.4.8

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1004
    -1005
    -1006
    -1007
    -1008
    -1009
    -1010
    -1011
    -1012
    -
    -
    # File 'src/hash.c', line 1004
    -
    -static mrb_value
    -mrb_hash_delete(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value key;
    -
    -  mrb_get_args(mrb, "o", &key);
    -  mrb_hash_modify(mrb, self);
    -  return mrb_hash_delete_key(mrb, self, key);
    -}
    -
    -
    - -
    -

    - - #_inspect(recur_list) ⇒ Object - - - - - -

    -
    -

    internal method for Hash inspection

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -189
    -190
    -191
    -192
    -193
    -194
    -195
    -196
    -197
    -198
    -199
    -200
    -201
    -202
    -203
    -
    -
    # File 'mrblib/hash.rb', line 189
    -
    -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(recur_list) + "=>" + self[k]._inspect(recur_list))
    -    i+=1
    -  end
    -  "{"+ary.join(", ")+"}"
    -end
    -
    -
    - -
    -

    - - #clearHash - - - - - -

    -
    -

    Removes all key-value pairs from hsh.

    - -
    h = { "a" => 100, "b" => 200 }   #=> {"a"=>100, "b"=>200}
    -h.clear                          #=> {}
    -
    - - -
    -
    -
    - -
    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Hash) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1093
    -1094
    -1095
    -1096
    -1097
    -1098
    -1099
    -1100
    -1101
    -1102
    -1103
    -1104
    -
    -
    # File 'src/hash.c', line 1093
    -
    -MRB_API mrb_value
    -mrb_hash_clear(mrb_state *mrb, mrb_value hash)
    -{
    -  htable *t = RHASH_TBL(hash);
    -
    -  mrb_hash_modify(mrb, hash);
    -  if (t) {
    -    ht_free(mrb, t);
    -    RHASH_TBL(hash) = NULL;
    -  }
    -  return hash;
    -}
    -
    -
    - -
    -

    - - #compactObject - - - - - -

    -
    -

    call-seq: - hsh.compact -> new_hsh

    - -

    Returns a new hash with the nil values/key pairs removed

    - -

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

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -133
    -134
    -135
    -136
    -137
    -138
    -139
    -140
    -141
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 133
    -
    -def compact
    -  h = {}
    -  self.keys.select{|k|
    -    self[k] != nil
    -  }.each {|k|
    -    h[k] = self[k]
    -  }
    -  h
    -end
    -
    -
    - -
    -

    - - #compact!Object - - - - - -

    -
    -

    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 }

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -109
    -110
    -111
    -112
    -113
    -114
    -115
    -116
    -117
    -118
    -119
    -120
    -121
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 109
    -
    -def compact!
    -  keys = self.keys
    -  nk = keys.select{|k|
    -    self[k] != nil
    -  }
    -  return nil if (keys.size == nk.size)
    -  h = {}
    -  nk.each {|k|
    -    h[k] = self[k]
    -  }
    -  h
    -  self.replace(h)
    -end
    -
    -
    - -
    -

    - - #default(key = nil) ⇒ Object - - - - - -

    -
    -

    Returns the default value, the value that would be returned by -hsh[key] if key did not exist in hsh. -See also Hash::new and Hash#default=.

    - -

    h = Hash.new #=> {} - h.default #=> nil - h.default(2) #=> nil

    - -

    h = Hash.new(“cat”) #=> {} - h.default #=> “cat” - h.default(2) #=> “cat”

    - -

    h = Hash.new {|h,k| h[k] = k.to_i*10} #=> {} - h.default #=> nil - h.default(2) #=> 20

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

    Returns:

    -
      - -
    • - - - (Object) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -874
    -875
    -876
    -877
    -878
    -879
    -880
    -881
    -882
    -883
    -884
    -885
    -886
    -887
    -888
    -889
    -890
    -891
    -
    -
    # File 'src/hash.c', line 874
    -
    -static mrb_value
    -mrb_hash_default(mrb_state *mrb, mrb_value hash)
    -{
    -  mrb_value key;
    -  mrb_bool given;
    -
    -  mrb_get_args(mrb, "|o?", &key, &given);
    -  if (MRB_RHASH_DEFAULT_P(hash)) {
    -    if (MRB_RHASH_PROCDEFAULT_P(hash)) {
    -      if (!given) return mrb_nil_value();
    -      return mrb_funcall(mrb, RHASH_PROCDEFAULT(hash), "call", 2, hash, key);
    -    }
    -    else {
    -      return RHASH_IFNONE(hash);
    -    }
    -  }
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #default=(obj) ⇒ Object - - - - - -

    -
    -

    Sets the default value, the value returned for a key that does not -exist in the hash. It is not possible to set the default to a -Proc that will be executed on each key lookup.

    - -

    h = { “a” => 100, “b” => 200 } - h.default = “Go fish” - h[“a”] #=> 100 - h[“z”] #=> “Go fish” - # This doesn’t do what you might hope… - h.default = proc do |hash, key| - hash[key] = key + key - end - h[2] #=> #<Proc:0x401b3948@-:6> - h[“cat”] #=> #<Proc:0x401b3948@-:6>

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

    Returns:

    -
      - -
    • - - - (Object) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -914
    -915
    -916
    -917
    -918
    -919
    -920
    -921
    -922
    -923
    -924
    -925
    -926
    -927
    -928
    -929
    -930
    -
    -
    # File 'src/hash.c', line 914
    -
    -static mrb_value
    -mrb_hash_set_default(mrb_state *mrb, mrb_value hash)
    -{
    -  mrb_value ifnone;
    -
    -  mrb_get_args(mrb, "o", &ifnone);
    -  mrb_hash_modify(mrb, hash);
    -  mrb_iv_set(mrb, hash, mrb_intern_lit(mrb, "ifnone"), ifnone);
    -  RHASH(hash)->flags &= ~MRB_HASH_PROC_DEFAULT;
    -  if (!mrb_nil_p(ifnone)) {
    -    RHASH(hash)->flags |= MRB_HASH_DEFAULT;
    -  }
    -  else {
    -    RHASH(hash)->flags &= ~MRB_HASH_DEFAULT;
    -  }
    -  return ifnone;
    -}
    -
    -
    - -
    -

    - - #default_procObject - - - - - -

    -
    -

    If Hash::new was invoked with a block, return that -block, otherwise return nil.

    - -

    h = Hash.new {|h,k| h[k] = k*k } #=> {} - p = h.default_proc #=> #<Proc:0x401b3d08@-:1> - a = [] #=> [] - p.call(a, 2) - a #=> [nil, nil, 4]

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

    Returns:

    -
      - -
    • - - - (Object) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -948
    -949
    -950
    -951
    -952
    -953
    -954
    -955
    -
    -
    # File 'src/hash.c', line 948
    -
    -static mrb_value
    -mrb_hash_default_proc(mrb_state *mrb, mrb_value hash)
    -{
    -  if (MRB_RHASH_PROCDEFAULT_P(hash)) {
    -    return RHASH_PROCDEFAULT(hash);
    -  }
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #default_proc=(proc_obj) ⇒ Proc - - - - - -

    -
    -

    Sets the default proc to be executed on each key lookup.

    - -

    h.default_proc = proc do |hash, key| - hash[key] = key + key - end - h[2] #=> 4 - h[“cat”] #=> “catcat”

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

    Returns:

    -
      - -
    • - - - (Proc) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -970
    -971
    -972
    -973
    -974
    -975
    -976
    -977
    -978
    -979
    -980
    -981
    -982
    -983
    -984
    -985
    -986
    -987
    -988
    -
    -
    # File 'src/hash.c', line 970
    -
    -static mrb_value
    -mrb_hash_set_default_proc(mrb_state *mrb, mrb_value hash)
    -{
    -  mrb_value ifnone;
    -
    -  mrb_get_args(mrb, "o", &ifnone);
    -  mrb_hash_modify(mrb, hash);
    -  mrb_iv_set(mrb, hash, mrb_intern_lit(mrb, "ifnone"), ifnone);
    -  if (!mrb_nil_p(ifnone)) {
    -    RHASH(hash)->flags |= MRB_HASH_PROC_DEFAULT;
    -    RHASH(hash)->flags |= MRB_HASH_DEFAULT;
    -  }
    -  else {
    -    RHASH(hash)->flags &= ~MRB_HASH_DEFAULT;
    -    RHASH(hash)->flags &= ~MRB_HASH_PROC_DEFAULT;
    -  }
    -
    -  return ifnone;
    -}
    -
    -
    - -
    -

    - - #delete(key, &block) ⇒ Object - - - - - -

    -
    -

    Delete the element with the key +key+. -Return the value of the element if +key+ -was found. Return nil if nothing was -found. If a block is given, call the -block with the value of the element.

    - -

    ISO 15.2.13.4.8

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -52
    -53
    -54
    -55
    -56
    -57
    -
    -
    # File 'mrblib/hash.rb', line 52
    -
    -def delete(key, &block)
    -  if block && !self.has_key?(key)
    -    return block.call(key)
    -  end
    -  self.__delete(key)
    -end
    -
    -
    - -
    -

    - - #delete_if(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - hsh.delete_if {| key, value | block } -> hsh - hsh.delete_if -> an_enumerator

    - -

    Deletes every key-value pair from hsh for which block - evaluates to true.

    - -

    If no block is given, an enumerator is returned instead.

    - -
    h = { "a" => 100, "b" => 200, "c" => 300 }
    -h.delete_if {|key, value| key >= "b" }   #=> {"a"=>100}
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -199
    -200
    -201
    -202
    -203
    -204
    -205
    -206
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 199
    -
    -def delete_if(&block)
    -  return to_enum :delete_if unless block
    -
    -  self.each do |k, v|
    -    self.delete(k) if block.call(k, v)
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #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+.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -387
    -388
    -389
    -390
    -391
    -392
    -393
    -394
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 387
    -
    -def dig(idx,*args)
    -  n = self[idx]
    -  if args.size > 0
    -    n&.dig(*args)
    -  else
    -    n
    -  end
    -end
    -
    -
    - -
    -

    - - #each(&block) ⇒ Object - - - - Also known as: - each_pair - - - - -

    -
    -

    Calls the given block for each element of +self+ -and pass the key and value of each element.

    - -

    call-seq: - hsh.each {| key, value | block } -> hsh - hsh.each_pair {| key, value | block } -> hsh - hsh.each -> an_enumerator - hsh.each_pair -> an_enumerator

    - -

    If no block is given, an enumerator is returned instead.

    - -
    h = { "a" => 100, "b" => 200 }
    -h.each {|key, value| puts "#{key} is #{value}" }
    -
    - -

    produces:

    - -

    a is 100 -b is 200

    - -

    ISO 15.2.13.4.9

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -81
    -82
    -83
    -84
    -85
    -86
    -87
    -88
    -89
    -90
    -91
    -92
    -93
    -
    -
    # File 'mrblib/hash.rb', line 81
    -
    -def each(&block)
    -  return to_enum :each unless block
    -
    -  keys = self.keys
    -  vals = self.values
    -  len = self.size
    -  i = 0
    -  while i < len
    -    block.call [keys[i], vals[i]]
    -    i += 1
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #each_key(&block) ⇒ Object - - - - - -

    -
    -

    Calls the given block for each element of +self+ -and pass the key of each element.

    - -

    call-seq: - hsh.each_key {| key | block } -> hsh - hsh.each_key -> an_enumerator

    - -

    If no block is given, an enumerator is returned instead.

    - -

    h = { “a” => 100, “b” => 200 } - h.each_key {|key| puts key }

    - -

    produces:

    - -

    a - b

    - -

    ISO 15.2.13.4.10

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -114
    -115
    -116
    -117
    -118
    -119
    -
    -
    # File 'mrblib/hash.rb', line 114
    -
    -def each_key(&block)
    -  return to_enum :each_key unless block
    -
    -  self.keys.each{|k| block.call(k)}
    -  self
    -end
    -
    -
    - -
    -

    - - #each_value(&block) ⇒ Object - - - - - -

    -
    -

    Calls the given block for each element of +self+ -and pass the value of each element.

    - -

    call-seq: - hsh.each_value {| value | block } -> hsh - hsh.each_value -> an_enumerator

    - -

    If no block is given, an enumerator is returned instead.

    - -

    h = { “a” => 100, “b” => 200 } - h.each_value {|value| puts value }

    - -

    produces:

    - -

    100 - 200

    - -

    ISO 15.2.13.4.11

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -140
    -141
    -142
    -143
    -144
    -145
    -
    -
    # File 'mrblib/hash.rb', line 140
    -
    -def each_value(&block)
    -  return to_enum :each_value unless block
    -
    -  self.keys.each{|k| block.call(self[k])}
    -  self
    -end
    -
    -
    - -
    -

    - - #empty?Boolean - - - - - -

    -
    -

    Returns true if hsh contains no key-value pairs.

    - -

    {}.empty? #=> true

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1184
    -1185
    -1186
    -1187
    -1188
    -
    -
    # File 'src/hash.c', line 1184
    -
    -static mrb_value
    -mrb_hash_empty_m(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_bool_value(mrb_hash_empty_p(mrb, self));
    -}
    -
    -
    - -
    -

    - - #eql?(hash) ⇒ Boolean - - - - - -

    -
    -

    Returns true if hash and other are -both hashes with the same content compared by eql?.

    - -

    ISO 15.2.13.4.32 (x)

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    -42
    -
    -
    # File 'mrblib/hash.rb', line 31
    -
    -def eql?(hash)
    -  return true if self.equal?(hash)
    -  unless Hash === hash
    -    return false
    -  end
    -  return false if self.size != hash.size
    -  self.each do |k,v|
    -    return false unless hash.key?(k)
    -    return false unless self[k].eql?(hash[k])
    -  end
    -  return true
    -end
    -
    -
    - -
    -

    - - #fetch(key, none = NONE, &block) ⇒ Object - - - - - -

    -
    -

    call-seq: - hsh.fetch(key [, default] ) -> obj - hsh.fetch(key) {| key | block } -> obj

    - -

    Returns a value from the hash for the given key. If the key can’t be - found, there are several options: With no other arguments, it will - raise an KeyError exception; if default is - given, then that will be returned; if the optional code block is - specified, then that will be run and its result returned.

    - -
    h = { "a" => 100, "b" => 200 }
    -h.fetch("a")                            #=> 100
    -h.fetch("z", "go fish")                 #=> "go fish"
    -h.fetch("z") { |el| "go fish, #{el}"}   #=> "go fish, z"
    -
    - -

    The following example shows that an exception is raised if the key - is not found and a default value is not supplied.

    - -
    h = { "a" => 100, "b" => 200 }
    -h.fetch("z")
    -
    - -

    produces:

    - -
    prog.rb:2:in 'fetch': key not found (KeyError)
    - from prog.rb:2
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -171
    -172
    -173
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    -181
    -182
    -183
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 171
    -
    -def fetch(key, none=NONE, &block)
    -  unless self.key?(key)
    -    if block
    -      block.call(key)
    -    elsif none != NONE
    -      none
    -    else
    -      raise KeyError, "Key not found: #{key.inspect}"
    -    end
    -  else
    -    self[key]
    -  end
    -end
    -
    -
    - -
    -

    - - #fetch_values(*keys, &block) ⇒ Object - - - - - -

    -
    -

    call-seq: - hsh.fetch_values(key, …) -> array - hsh.fetch_values(key, …) { |key| block } -> array

    - -

    Returns an array containing the values associated with the given keys -but also raises KeyError when one of keys can’t be found. -Also see Hash#values_at and Hash#fetch.

    - -

    h = { “cat” => “feline”, “dog” => “canine”, “cow” => “bovine” }

    - -

    h.fetch_values(“cow”, “cat”) #=> [“bovine”, “feline”] - h.fetch_values(“cow”, “bird”) # raises KeyError - h.fetch_values(“cow”, “bird”) { |k| k.upcase } #=> [“bovine”, “BIRD”]

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -492
    -493
    -494
    -495
    -496
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 492
    -
    -def fetch_values(*keys, &block)
    -  keys.map do |k|
    -    self.fetch(k, &block)
    -  end
    -end
    -
    -
    - -
    -

    - - #flatten(level = 1) ⇒ Object - - - - - -

    -
    -

    call-seq: - hash.flatten -> an_array - hash.flatten(level) -> an_array

    - -

    Returns a new array that is a one-dimensional flattening of this - hash. That is, for every key or value that is an array, extract - its elements into the new array. Unlike Array#flatten, this - method does not flatten recursively by default. The optional - level argument determines the level of recursion to flatten.

    - -
    a =  {1=> "one", 2 => [2,"two"], 3 => "three"}
    -a.flatten    # => [1, "one", 2, [2, "two"], 3, "three"]
    -a.flatten(2) # => [1, "one", 2, 2, "two", 3, "three"]
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -224
    -225
    -226
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 224
    -
    -def flatten(level=1)
    -  self.to_a.flatten(level)
    -end
    -
    -
    - -
    -

    - - #has_key?Boolean - - - - - -

    -
    -

    15.2.13.4.13

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -1289
    -1290
    -1291
    -1292
    -1293
    -1294
    -1295
    -1296
    -1297
    -1298
    -
    -
    # File 'src/hash.c', line 1289
    -
    -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);
    -}
    -
    -
    - -
    -

    - - - #has_value?(value) ⇒ Boolean - - #value?(value) ⇒ Boolean - - - - - - -

    -
    -

    Returns true if the given value is present for some key -in hsh.

    - -

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

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #has_value?(value) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

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

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -1332
    -1333
    -1334
    -1335
    -1336
    -1337
    -1338
    -1339
    -1340
    -1341
    -1342
    -1343
    -
    -
    # File 'src/hash.c', line 1332
    -
    -static mrb_value
    -mrb_hash_has_value(mrb_state *mrb, mrb_value hash)
    -{
    -  mrb_value val;
    -  struct has_v_arg arg;
    -  
    -  mrb_get_args(mrb, "o", &val);
    -  arg.found = FALSE;
    -  arg.val = val;
    -  ht_foreach(mrb, RHASH_TBL(hash), hash_has_value_i, &arg);
    -  return mrb_bool_value(arg.found);
    -}
    -
    -
    - -
    -

    - - #include?Boolean - - - - - -

    -
    -

    15.2.13.4.15

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -1289
    -1290
    -1291
    -1292
    -1293
    -1294
    -1295
    -1296
    -1297
    -1298
    -
    -
    # File 'src/hash.c', line 1289
    -
    -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);
    -}
    -
    -
    - -
    -

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

    -
    -

    ISO 15.2.13.4.30 (x)

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -208
    -209
    -210
    -
    -
    # File 'mrblib/hash.rb', line 208
    -
    -def inspect
    -  self._inspect({})
    -end
    -
    -
    - -
    -

    - - #invertObject - - - - - -

    -
    -

    call-seq: - hsh.invert -> new_hash

    - -

    Returns a new hash created by using hsh’s values as keys, and - the keys as values.

    - -
    h = { "n" => 100, "m" => 100, "y" => 300, "d" => 200, "a" => 0 }
    -h.invert   #=> {0=>"a", 100=>"m", 200=>"d", 300=>"y"}
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -239
    -240
    -241
    -242
    -243
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 239
    -
    -def invert
    -  h = self.class.new
    -  self.each {|k, v| h[v] = k }
    -  h
    -end
    -
    -
    - -
    -

    - - #keep_if(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - hsh.keep_if {| key, value | block } -> hsh - hsh.keep_if -> an_enumerator

    - -

    Deletes every key-value pair from hsh for which block - evaluates to false.

    - -

    If no block is given, an enumerator is returned instead.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -256
    -257
    -258
    -259
    -260
    -261
    -262
    -263
    -264
    -265
    -266
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 256
    -
    -def keep_if(&block)
    -  return to_enum :keep_if unless block
    -
    -  keys = []
    -  self.each do |k, v|
    -    unless block.call([k, v])
    -      self.delete(k)
    -    end
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #key(val) ⇒ Object - - - - - -

    -
    -

    call-seq: - hsh.key(value) -> key

    - -

    Returns the key of an occurrence of a given value. If the value is - not found, returns nil.

    - -
    h = { "a" => 100, "b" => 200, "c" => 300, "d" => 300 }
    -h.key(200)   #=> "b"
    -h.key(300)   #=> "c"
    -h.key(999)   #=> nil
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -281
    -282
    -283
    -284
    -285
    -286
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 281
    -
    -def key(val)
    -  self.each do |k, v|
    -    return k if v == val
    -  end
    -  nil
    -end
    -
    -
    - -
    -

    - - #key?Boolean - - - - - -

    -
    -

    15.2.13.4.18

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -1289
    -1290
    -1291
    -1292
    -1293
    -1294
    -1295
    -1296
    -1297
    -1298
    -
    -
    # File 'src/hash.c', line 1289
    -
    -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);
    -}
    -
    -
    - -
    -

    - - #keysArray - - - - - -

    -
    -

    Returns a new array populated with the keys from this hash. See also -Hash#values.

    - -

    h = { “a” => 100, “b” => 200, “c” => 300, “d” => 400 } - h.keys #=> [“a”, “b”, “c”, “d”]

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1210
    -1211
    -1212
    -1213
    -1214
    -1215
    -1216
    -1217
    -1218
    -1219
    -1220
    -1221
    -1222
    -
    -
    # File 'src/hash.c', line 1210
    -
    -MRB_API mrb_value
    -mrb_hash_keys(mrb_state *mrb, mrb_value hash)
    -{
    -  htable *t = RHASH_TBL(hash);
    -  mrb_int size;
    -  mrb_value ary;
    -
    -  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;
    -}
    -
    -
    - -
    -

    - - - #lengthFixnum - - #sizeFixnum - - - - - - -

    -
    -

    Returns the number of key-value pairs in the hash.

    - -

    h = { “d” => 100, “a” => 200, “v” => 300, “e” => 400 } - h.length #=> 4 - h.delete(“a”) #=> 200 - h.length #=> 3

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #lengthFixnum -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Fixnum) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #sizeFixnum -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Fixnum) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -1158
    -1159
    -1160
    -1161
    -1162
    -1163
    -
    -
    # File 'src/hash.c', line 1158
    -
    -static mrb_value
    -mrb_hash_size_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int size = mrb_hash_size(mrb, self);
    -  return mrb_fixnum_value(size);
    -}
    -
    -
    - -
    -

    - - #member?Boolean - - - - - -

    -
    -

    15.2.13.4.21

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -1289
    -1290
    -1291
    -1292
    -1293
    -1294
    -1295
    -1296
    -1297
    -1298
    -
    -
    # File 'src/hash.c', line 1289
    -
    -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);
    -}
    -
    -
    - -
    -

    - - #merge(other, &block) ⇒ Object - - - - - -

    -
    -

    Return a hash which contains the content of -+self+ and +other+. If a block is given -it will be called for each element with -a duplicate key. The value of the block -will be the final value of this element.

    - -

    ISO 15.2.13.4.22

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -175
    -176
    -177
    -178
    -179
    -180
    -181
    -182
    -183
    -184
    -185
    -186
    -
    -
    # File 'mrblib/hash.rb', line 175
    -
    -def merge(other, &block)
    -  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]
    -    }
    -  else
    -    other.each_key{|k| h[k] = other[k]}
    -  end
    -  h
    -end
    -
    -
    - -
    -

    - - #merge!(other, &block) ⇒ Object - - - - Also known as: - update - - - - -

    -
    -

    call-seq: - hsh.merge!(other_hash) -> hsh - hsh.merge!(other_hash){|key, oldval, newval| block} -> hsh

    - -

    Adds the contents of other_hash to hsh. If no block is specified, - entries with duplicate keys are overwritten with the values from - other_hash, otherwise the value of each duplicate key is determined by - calling the block with the key, its value in hsh and its value in - other_hash.

    - -
    h1 = { "a" => 100, "b" => 200 }
    -h2 = { "b" => 254, "c" => 300 }
    -h1.merge!(h2)   #=> {"a"=>100, "b"=>254, "c"=>300}
    -
    -h1 = { "a" => 100, "b" => 200 }
    -h2 = { "b" => 254, "c" => 300 }
    -h1.merge!(h2) { |key, v1, v2| v1 }
    -                #=> {"a"=>100, "b"=>200, "c"=>300}
    -
    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -84
    -85
    -86
    -87
    -88
    -89
    -90
    -91
    -92
    -93
    -94
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 84
    -
    -def merge!(other, &block)
    -  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]
    -    }
    -  else
    -    other.each_key{|k| self[k] = other[k]}
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #rehashHash - - - - - -

    -
    -

    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.

    - -

    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

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

    Returns:

    -
      - -
    • - - - (Hash) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1398
    -1399
    -1400
    -1401
    -1402
    -1403
    -
    -
    # File 'src/hash.c', line 1398
    -
    -static mrb_value
    -mrb_hash_rehash(mrb_state *mrb, mrb_value self)
    -{
    -  ht_compact(mrb, RHASH_TBL(self));
    -  return self;
    -}
    -
    -
    - -
    -

    - - #reject(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - hsh.reject {|key, value| block} -> a_hash - hsh.reject -> an_enumerator

    - -

    Returns a new hash consisting of entries for which the block returns false.

    - -

    If no block is given, an enumerator is returned instead.

    - -
    h = { "a" => 100, "b" => 200, "c" => 300 }
    -h.reject {|k,v| k < "b"}  #=> {"b" => 200, "c" => 300}
    -h.reject {|k,v| v > 100}  #=> {"a" => 100}
    -
    - -

    1.8/1.9 Hash#reject returns Hash; ISO says nothing.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -255
    -256
    -257
    -258
    -259
    -260
    -261
    -262
    -263
    -264
    -265
    -
    -
    # File 'mrblib/hash.rb', line 255
    -
    -def reject(&block)
    -  return to_enum :reject unless block
    -
    -  h = {}
    -  self.each{|k,v|
    -    unless block.call([k, v])
    -      h[k] = v
    -    end
    -  }
    -  h
    -end
    -
    -
    - -
    -

    - - #reject!(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - hsh.reject! {| key, value | block } -> hsh or nil - hsh.reject! -> an_enumerator

    - -

    Equivalent to Hash#delete_if, but returns - nil if no changes were made.

    - -

    1.8/1.9 Hash#reject! returns Hash; ISO says nothing.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -224
    -225
    -226
    -227
    -228
    -229
    -230
    -231
    -232
    -233
    -234
    -235
    -236
    -237
    -238
    -
    -
    # File 'mrblib/hash.rb', line 224
    -
    -def reject!(&block)
    -  return to_enum :reject! unless block
    -
    -  keys = []
    -  self.each{|k,v|
    -    if block.call([k, v])
    -      keys.push(k)
    -    end
    -  }
    -  return nil if keys.size == 0
    -  keys.each{|k|
    -    self.delete(k)
    -  }
    -  self
    -end
    -
    -
    - -
    -

    - - #replace(hash) ⇒ Object - - - - Also known as: - initialize_copy - - - - -

    -
    -

    Replaces the contents of hsh with the contents of other hash

    - -

    ISO 15.2.13.4.23

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -151
    -152
    -153
    -154
    -155
    -156
    -157
    -158
    -159
    -160
    -161
    -162
    -163
    -
    -
    # File 'mrblib/hash.rb', line 151
    -
    -def replace(hash)
    -  raise TypeError, "Hash required (#{hash.class} given)" unless Hash === hash
    -  self.clear
    -  hash.each_key{|k|
    -    self[k] = hash[k]
    -  }
    -  if hash.default_proc
    -    self.default_proc = hash.default_proc
    -  else
    -    self.default = hash.default
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #select(&block) ⇒ Object - - - - Also known as: - filter - - - - -

    -
    -

    call-seq: - hsh.select {|key, value| block} -> a_hash - hsh.select -> an_enumerator

    - -

    Returns a new hash consisting of entries for which the block returns true.

    - -

    If no block is given, an enumerator is returned instead.

    - -
    h = { "a" => 100, "b" => 200, "c" => 300 }
    -h.select {|k,v| k > "a"}  #=> {"b" => 200, "c" => 300}
    -h.select {|k,v| v < 200}  #=> {"a" => 100}
    -
    - -

    1.9 Hash#select returns Hash; ISO says nothing

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -308
    -309
    -310
    -311
    -312
    -313
    -314
    -315
    -316
    -317
    -318
    -
    -
    # File 'mrblib/hash.rb', line 308
    -
    -def select(&block)
    -  return to_enum :select unless block
    -
    -  h = {}
    -  self.each{|k,v|
    -    if block.call([k, v])
    -      h[k] = v
    -    end
    -  }
    -  h
    -end
    -
    -
    - -
    -

    - - #select!(&block) ⇒ Object - - - - Also known as: - filter! - - - - -

    -
    -

    call-seq: - hsh.select! {| key, value | block } -> hsh or nil - hsh.select! -> an_enumerator

    - -

    Equivalent to Hash#keep_if, but returns - nil if no changes were made.

    - -

    1.9 Hash#select! returns Hash; ISO says nothing.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -277
    -278
    -279
    -280
    -281
    -282
    -283
    -284
    -285
    -286
    -287
    -288
    -289
    -290
    -291
    -
    -
    # File 'mrblib/hash.rb', line 277
    -
    -def select!(&block)
    -  return to_enum :select! unless block
    -
    -  keys = []
    -  self.each{|k,v|
    -    unless block.call([k, v])
    -      keys.push(k)
    -    end
    -  }
    -  return nil if keys.size == 0
    -  keys.each{|k|
    -    self.delete(k)
    -  }
    -  self
    -end
    -
    -
    - -
    -

    - - #shiftArray, Object - - - - - -

    -
    -

    Removes a key-value pair from hsh and returns it as the -two-item array [ key, value ], or -the hash’s default value if the hash is empty.

    - -
    h = { 1 => "a", 2 => "b", 3 => "c" }
    -h.shift   #=> [1, "a"]
    -h         #=> {2=>"b", 3=>"c"}
    -
    - - -
    -
    -
    - -
    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Array, Object) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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/hash.c', line 1055
    -
    -static mrb_value
    -mrb_hash_shift(mrb_state *mrb, mrb_value hash)
    -{
    -  htable *t = RHASH_TBL(hash);
    -
    -  mrb_hash_modify(mrb, hash);
    -  if (t && t->size > 0) {
    -    mrb_value del_key, del_val;
    -
    -    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)) {
    -    if (MRB_RHASH_PROCDEFAULT_P(hash)) {
    -      return mrb_funcall(mrb, RHASH_PROCDEFAULT(hash), "call", 2, hash, mrb_nil_value());
    -    }
    -    else {
    -      return RHASH_IFNONE(hash);
    -    }
    -  }
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - - #lengthFixnum - - #sizeFixnum - - - - - - -

    -
    -

    Returns the number of key-value pairs in the hash.

    - -

    h = { “d” => 100, “a” => 200, “v” => 300, “e” => 400 } - h.length #=> 4 - h.delete(“a”) #=> 200 - h.length #=> 3

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #lengthFixnum -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Fixnum) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #sizeFixnum -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Fixnum) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -1158
    -1159
    -1160
    -1161
    -1162
    -1163
    -
    -
    # File 'src/hash.c', line 1158
    -
    -static mrb_value
    -mrb_hash_size_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int size = mrb_hash_size(mrb, self);
    -  return mrb_fixnum_value(size);
    -}
    -
    -
    - -
    -

    - - #slice(*keys) ⇒ Hash - - - - - -

    -
    -

    Returns a hash containing only the given keys and their values.

    - -

    h = { a: 100, b: 200, c: 300 } - h.slice(:a) #=> :a=>100 - h.slice(:b, :c, :d) #=> :c=>300

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

    Returns:

    -
      - -
    • - - - (Hash) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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 49
    -
    -static mrb_value
    -hash_slice(mrb_state *mrb, mrb_value hash)
    -{
    -  mrb_value *argv, result;
    -  mrb_int argc, i;
    -
    -  mrb_get_args(mrb, "*", &argv, &argc);
    -  if (argc == 0) {
    -    return mrb_hash_new_capa(mrb, argc);
    -  }
    -  result = mrb_hash_new_capa(mrb, argc);
    -  for (i = 0; i < argc; i++) {
    -    mrb_value key = argv[i];
    -    mrb_value val;
    -
    -    val = mrb_hash_fetch(mrb, hash, key, mrb_undef_value());
    -    if (!mrb_undef_p(val)) {
    -      mrb_hash_set(mrb, result, key, val);
    -    }
    -  }
    -  return result;
    -}
    -
    -
    - -
    -

    - - - #[]=(key) ⇒ Object - - #store(key, value) ⇒ Object - - - - - - -

    -
    -

    Element Assignment—Associates the value given by -value with the key given by key. -key should not have its value changed while it is in -use as a key (a String passed as a key will be -duplicated and frozen).

    - -
    h = { "a" => 100, "b" => 200 }
    -h["a"] = 9
    -h["c"] = 4
    -h   #=> {"a"=>9, "b"=>200, "c"=>4}
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1125
    -1126
    -1127
    -1128
    -1129
    -1130
    -1131
    -1132
    -1133
    -
    -
    # File 'src/hash.c', line 1125
    -
    -static mrb_value
    -mrb_hash_aset(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value key, val;
    -
    -  mrb_get_args(mrb, "oo", &key, &val);
    -  mrb_hash_set(mrb, self, key, val);
    -  return val;
    -}
    -
    -
    - -
    -

    - - #to_hObject - - - - - -

    -
    -

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

    - -

    Returns +self+. If called on a subclass of Hash, converts - the receiver to a Hash object.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -295
    -296
    -297
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 295
    -
    -def to_h
    -  self
    -end
    -
    -
    - -
    -

    - - #to_procObject - - - - - -

    - - - - -
    -
    -
    -
    -473
    -474
    -475
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 473
    -
    -def to_proc
    -  ->x{self[x]}
    -end
    -
    -
    - -
    -

    - - #transform_keys(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - hsh.transform_keys {|key| block } -> new_hash - hsh.transform_keys -> an_enumerator

    - -

    Returns a new hash, with the keys computed from running the block -once for each key in the hash, and the values unchanged.

    - -

    If no block is given, an enumerator is returned instead.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -406
    -407
    -408
    -409
    -410
    -411
    -412
    -413
    -414
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 406
    -
    -def transform_keys(&block)
    -  return to_enum :transform_keys unless block
    -  hash = {}
    -  self.keys.each do |k|
    -    new_key = block.call(k)
    -    hash[new_key] = self[k]
    -  end
    -  hash
    -end
    -
    -
    - -
    -

    - - #transform_keys!(&block) ⇒ Object - - - - - -

    -
    -

    call-seq: - hsh.transform_keys! {|key| block } -> hsh - hsh.transform_keys! -> an_enumerator

    - -

    Invokes the given block once for each key in hsh, replacing it -with the new key returned by the block, and then returns hsh.

    - -

    If no block is given, an enumerator is returned instead.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -425
    -426
    -427
    -428
    -429
    -430
    -431
    -432
    -433
    -434
    -
    -
    # 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]
    -    self.__delete(k)
    -    k = block.call(k) if block
    -    self[k] = value
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #transform_values(&b) ⇒ Object - - - - - -

    -
    -

    call-seq: - hsh.transform_values {|value| block } -> new_hash - hsh.transform_values -> an_enumerator

    - -

    Returns a new hash with the results of running the block once for -every value. -This method does not change the keys.

    - -

    If no block is given, an enumerator is returned instead.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -446
    -447
    -448
    -449
    -450
    -451
    -452
    -453
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 446
    -
    -def transform_values(&b)
    -  return to_enum :transform_values unless block_given?
    -  hash = {}
    -  self.keys.each do |k|
    -    hash[k] = yield(self[k])
    -  end
    -  hash
    -end
    -
    -
    - -
    -

    - - #transform_values!(&b) ⇒ Object - - - - - -

    -
    -

    call-seq: - hsh.transform_values! {|key| block } -> hsh - hsh.transform_values! -> an_enumerator

    - -

    Invokes the given block once for each value in the hash, replacing -with the new value returned by the block, and then returns hsh.

    - -

    If no block is given, an enumerator is returned instead.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -465
    -466
    -467
    -468
    -469
    -470
    -471
    -
    -
    # File 'mrbgems/mruby-hash-ext/mrblib/hash.rb', line 465
    -
    -def transform_values!(&b)
    -  return to_enum :transform_values! unless block_given?
    -  self.keys.each do |k|
    -    self[k] = yield(self[k])
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - - #has_value?(value) ⇒ Boolean - - #value?(value) ⇒ Boolean - - - - - - -

    -
    -

    Returns true if the given value is present for some key -in hsh.

    - -

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

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #has_value?(value) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

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

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -1332
    -1333
    -1334
    -1335
    -1336
    -1337
    -1338
    -1339
    -1340
    -1341
    -1342
    -1343
    -
    -
    # File 'src/hash.c', line 1332
    -
    -static mrb_value
    -mrb_hash_has_value(mrb_state *mrb, mrb_value hash)
    -{
    -  mrb_value val;
    -  struct has_v_arg arg;
    -  
    -  mrb_get_args(mrb, "o", &val);
    -  arg.found = FALSE;
    -  arg.val = val;
    -  ht_foreach(mrb, RHASH_TBL(hash), hash_has_value_i, &arg);
    -  return mrb_bool_value(arg.found);
    -}
    -
    -
    - -
    -

    - - #valuesArray - - - - - -

    -
    -

    Returns a new array populated with the values from hsh. See -also Hash#keys.

    - -

    h = { “a” => 100, “b” => 200, “c” => 300 } - h.values #=> [100, 200, 300]

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1244
    -1245
    -1246
    -1247
    -1248
    -1249
    -1250
    -1251
    -1252
    -1253
    -1254
    -1255
    -1256
    -
    -
    # File 'src/hash.c', line 1244
    -
    -MRB_API mrb_value
    -mrb_hash_values(mrb_state *mrb, mrb_value hash)
    -{
    -  htable *t = RHASH_TBL(hash);
    -  mrb_int size;
    -  mrb_value ary;
    -
    -  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;
    -}
    -
    -
    - -
    -

    - - #values_at(key, ...) ⇒ Array - - - - - -

    -
    -

    Return an array containing the values associated with the given keys. -Also see Hash.select.

    - -

    h = { “cat” => “feline”, “dog” => “canine”, “cow” => “bovine” } - h.values_at(“cow”, “cat”) #=> [“bovine”, “feline”]

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -
    -
    # File 'mrbgems/mruby-hash-ext/src/hash-ext.c', line 22
    -
    -static mrb_value
    -hash_values_at(mrb_state *mrb, mrb_value hash)
    -{
    -  mrb_value *argv, result;
    -  mrb_int argc, i;
    -  int ai;
    -
    -  mrb_get_args(mrb, "*", &argv, &argc);
    -  result = mrb_ary_new_capa(mrb, argc);
    -  ai = mrb_gc_arena_save(mrb);
    -  for (i = 0; i < argc; i++) {
    -    mrb_ary_push(mrb, result, mrb_hash_get(mrb, hash, argv[i]));
    -    mrb_gc_arena_restore(mrb, ai);
    -  }
    -  return result;
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/IO.html b/docs/api/IO.html deleted file mode 100644 index e51fbe7..0000000 --- a/docs/api/IO.html +++ /dev/null @@ -1,3754 +0,0 @@ - - - - - - - Class: IO - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: IO - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-io/src/io.c,
    - mrbgems/mruby-io/mrblib/io.rb
    -
    -
    - -
    - -
    -

    Direct Known Subclasses

    -

    BasicSocket, File

    -
    - - -

    - Constant Summary - collapse -

    - -
    - -
    SEEK_SET = - -
    -
    0
    - -
    SEEK_CUR = - -
    -
    1
    - -
    SEEK_END = - -
    -
    2
    - -
    BUF_SIZE = - -
    -
    4096
    - -
    - - - - - - - - - -

    - Class Method Summary - collapse -

    - - - -

    - Instance Method Summary - collapse -

    - - - - -
    -

    Constructor Details

    - -
    -

    - - #initializeObject - - - - - -

    -
    -

    15.2.20.5.21 (x)

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 612
    -
    -mrb_value
    -mrb_io_initialize(mrb_state *mrb, mrb_value io)
    -{
    -  struct mrb_io *fptr;
    -  mrb_int fd;
    -  mrb_value mode, opt;
    -  int flags;
    -
    -  mode = opt = mrb_nil_value();
    -
    -  mrb_get_args(mrb, "i|So", &fd, &mode, &opt);
    -  if (mrb_nil_p(mode)) {
    -    mode = mrb_str_new_cstr(mrb, "r");
    -  }
    -  if (mrb_nil_p(opt)) {
    -    opt = mrb_hash_new(mrb);
    -  }
    -
    -  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, ""));
    -
    -  fptr = (struct mrb_io *)DATA_PTR(io);
    -  if (fptr != NULL) {
    -    fptr_finalize(mrb, fptr, TRUE);
    -    mrb_free(mrb, fptr);
    -  }
    -  fptr = mrb_io_alloc(mrb);
    -
    -  DATA_TYPE(io) = &mrb_io_type;
    -  DATA_PTR(io) = fptr;
    -
    -  fptr->fd = (int)fd;
    -  fptr->readable = ((flags & FMODE_READABLE) != 0);
    -  fptr->writable = ((flags & FMODE_WRITABLE) != 0);
    -  fptr->sync = 0;
    -  return io;
    -}
    -
    -
    - -
    - - -
    -

    Class Method Details

    - - -
    -

    - - .open(*args, &block) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 14
    -
    -def self.open(*args, &block)
    -  io = self.new(*args)
    -
    -  return io unless block
    -
    -  begin
    -    yield io
    -  ensure
    -    begin
    -      io.close unless io.closed?
    -    rescue StandardError
    -    end
    -  end
    -end
    -
    -
    - -
    -

    - - .pipe(&block) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -61
    -62
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 47
    -
    -def self.pipe(&block)
    -  if !self.respond_to?(:_pipe)
    -    raise NotImplementedError, "pipe is not supported on this platform"
    -  end
    -  if block
    -    begin
    -      r, w = IO._pipe
    -      yield r, w
    -    ensure
    -      r.close unless r.closed?
    -      w.close unless w.closed?
    -    end
    -  else
    -    IO._pipe
    -  end
    -end
    -
    -
    - -
    -

    - - .popen(command, mode = 'r', opts = {}, &block) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    -42
    -43
    -44
    -45
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 29
    -
    -def self.popen(command, mode = 'r', opts={}, &block)
    -  if !self.respond_to?(:_popen)
    -    raise NotImplementedError, "popen is not supported on this platform"
    -  end
    -  io = self._popen(command, mode, opts)
    -  return io unless block
    -
    -  begin
    -    yield io
    -  ensure
    -    begin
    -      io.close unless io.closed?
    -    rescue IOError
    -      # nothing
    -    end
    -  end
    -end
    -
    -
    - -
    -

    - - .read(path, length = nil, offset = nil, opt = nil) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -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
    -108
    -109
    -110
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 64
    -
    -def self.read(path, length=nil, offset=nil, opt=nil)
    -  if not opt.nil?        # 4 arguments
    -    offset ||= 0
    -  elsif not offset.nil?  # 3 arguments
    -    if offset.is_a? Hash
    -      opt = offset
    -      offset = 0
    -    else
    -      opt = {}
    -    end
    -  elsif not length.nil?  # 2 arguments
    -    if length.is_a? Hash
    -      opt = length
    -      offset = 0
    -      length = nil
    -    else
    -      offset = 0
    -      opt = {}
    -    end
    -  else                   # only 1 argument
    -    opt = {}
    -    offset = 0
    -    length = nil
    -  end
    -
    -  str = ""
    -  fd = -1
    -  io = nil
    -  begin
    -    if path[0] == "|"
    -      io = IO.popen(path[1..-1], (opt[:mode] || "r"))
    -    else
    -      mode = opt[:mode] || "r"
    -      fd = IO.sysopen(path, mode)
    -      io = IO.open(fd, mode)
    -    end
    -    io.seek(offset) if offset > 0
    -    str = io.read(length)
    -  ensure
    -    if io
    -      io.close
    -    elsif fd != -1
    -      IO._sysclose(fd)
    -    end
    -  end
    -  str
    -end
    -
    -
    - -
    - -
    -

    Instance Method Details

    - - -
    -

    - - #<<(str) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -135
    -136
    -137
    -138
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 135
    -
    -def <<(str)
    -  write(str)
    -  self
    -end
    -
    -
    - -
    -

    - - #_check_readableObject - - - - - -

    - - - - -
    -
    -
    -
    -714
    -715
    -716
    -717
    -718
    -719
    -720
    -721
    -722
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 714
    -
    -mrb_value
    -mrb_io_check_readable(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_io *fptr = io_get_open_fptr(mrb, self);
    -  if (! fptr->readable) {
    -    mrb_raise(mrb, E_IO_ERROR, "not opened for reading");
    -  }
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #_read_bufObject - - - - - -

    - - - - -
    -
    -
    -
    -172
    -173
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 172
    -
    -def _read_buf
    -  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
    -
    -
    - -
    -

    - - #closeObject - - - - - -

    -
    -

    15.2.20.5.1

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -926
    -927
    -928
    -929
    -930
    -931
    -932
    -933
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 926
    -
    -mrb_value
    -mrb_io_close(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_io *fptr;
    -  fptr = io_get_open_fptr(mrb, self);
    -  fptr_finalize(mrb, fptr, FALSE);
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #close_on_exec=Object - - - - - -

    - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 1238
    -
    -mrb_value
    -mrb_io_set_close_on_exec(mrb_state *mrb, mrb_value self)
    -{
    -#if defined(F_GETFD) && defined(F_SETFD) && defined(FD_CLOEXEC)
    -  struct mrb_io *fptr;
    -  int flag, ret;
    -  mrb_bool b;
    -
    -  fptr = io_get_open_fptr(mrb, self);
    -  mrb_get_args(mrb, "b", &b);
    -  flag = b ? FD_CLOEXEC : 0;
    -
    -  if (fptr->fd2 >= 0) {
    -    if ((ret = fcntl(fptr->fd2, F_GETFD)) == -1) mrb_sys_fail(mrb, "F_GETFD failed");
    -    if ((ret & FD_CLOEXEC) != flag) {
    -      ret = (ret & ~FD_CLOEXEC) | flag;
    -      ret = fcntl(fptr->fd2, F_SETFD, ret);
    -
    -      if (ret == -1) mrb_sys_fail(mrb, "F_SETFD failed");
    -    }
    -  }
    -
    -  if ((ret = fcntl(fptr->fd, F_GETFD)) == -1) mrb_sys_fail(mrb, "F_GETFD failed");
    -  if ((ret & FD_CLOEXEC) != flag) {
    -    ret = (ret & ~FD_CLOEXEC) | flag;
    -    ret = fcntl(fptr->fd, F_SETFD, ret);
    -    if (ret == -1) mrb_sys_fail(mrb, "F_SETFD failed");
    -  }
    -
    -  return mrb_bool_value(b);
    -#else
    -  mrb_raise(mrb, E_NOTIMP_ERROR, "IO#close_on_exec= is not supported on the platform");
    -  return mrb_nil_value();
    -#endif
    -}
    -
    -
    - -
    -

    - - #close_on_exec?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -1214
    -1215
    -1216
    -1217
    -1218
    -1219
    -1220
    -1221
    -1222
    -1223
    -1224
    -1225
    -1226
    -1227
    -1228
    -1229
    -1230
    -1231
    -1232
    -1233
    -1234
    -1235
    -1236
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 1214
    -
    -mrb_value
    -mrb_io_close_on_exec_p(mrb_state *mrb, mrb_value self)
    -{
    -#if defined(F_GETFD) && defined(F_SETFD) && defined(FD_CLOEXEC)
    -  struct mrb_io *fptr;
    -  int ret;
    -
    -  fptr = io_get_open_fptr(mrb, self);
    -
    -  if (fptr->fd2 >= 0) {
    -    if ((ret = fcntl(fptr->fd2, F_GETFD)) == -1) mrb_sys_fail(mrb, "F_GETFD failed");
    -    if (!(ret & FD_CLOEXEC)) return mrb_false_value();
    -  }
    -
    -  if ((ret = fcntl(fptr->fd, F_GETFD)) == -1) mrb_sys_fail(mrb, "F_GETFD failed");
    -  if (!(ret & FD_CLOEXEC)) return mrb_false_value();
    -  return mrb_true_value();
    -
    -#else
    -  mrb_raise(mrb, E_NOTIMP_ERROR, "IO#close_on_exec? is not supported on the platform");
    -  return mrb_false_value();
    -#endif
    -}
    -
    -
    - -
    -

    - - #close_writeObject - - - - - -

    -
    -

    15.2.20.5.1

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -935
    -936
    -937
    -938
    -939
    -940
    -941
    -942
    -943
    -944
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 935
    -
    -mrb_value
    -mrb_io_close_write(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_io *fptr;
    -  fptr = io_get_open_fptr(mrb, self);
    -  if (close((int)fptr->fd2) == -1) {
    -    mrb_sys_fail(mrb, "close");
    -  }
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #closed?Boolean - - - - - -

    -
    -

    15.2.20.5.2

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -946
    -947
    -948
    -949
    -950
    -951
    -952
    -953
    -954
    -955
    -956
    -
    -
    # 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_data_get_ptr(mrb, io, &mrb_io_type);
    -  if (fptr == NULL || fptr->fd >= 0) {
    -    return mrb_false_value();
    -  }
    -
    -  return mrb_true_value();
    -}
    -
    -
    - -
    -

    - - #each(&block) ⇒ Object - - - - Also known as: - each_line - - - - -

    -
    -

    15.2.20.5.3

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -305
    -306
    -307
    -308
    -309
    -310
    -311
    -312
    -
    -
    # 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
    -  self
    -end
    -
    -
    - -
    -

    - - #each_byte(&block) ⇒ Object - - - - Also known as: - each_char - - - - -

    -
    -

    15.2.20.5.4

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -315
    -316
    -317
    -318
    -319
    -320
    -321
    -322
    -
    -
    # 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
    -  self
    -end
    -
    -
    - -
    -

    - - #eof?Boolean - - - - Also known as: - eof - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -140
    -141
    -142
    -143
    -144
    -145
    -146
    -147
    -148
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 140
    -
    -def eof?
    -  _check_readable
    -  begin
    -    _read_buf
    -    return @buf.empty?
    -  rescue EOFError
    -    return true
    -  end
    -end
    -
    -
    - -
    -

    - - #filenoObject - - - - Also known as: - to_i - - - - -

    -
    -

    15.2.20.5.2

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1206
    -1207
    -1208
    -1209
    -1210
    -1211
    -1212
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 1206
    -
    -mrb_value
    -mrb_io_fileno(mrb_state *mrb, mrb_value io)
    -{
    -  struct mrb_io *fptr;
    -  fptr = io_get_open_fptr(mrb, io);
    -  return mrb_fixnum_value(fptr->fd);
    -}
    -
    -
    - -
    -

    - - #flushObject - - - - - -

    -
    - - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -112
    -113
    -114
    -115
    -116
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 112
    -
    -def flush
    -  # mruby-io always writes immediately (no output buffer).
    -  raise IOError, "closed stream" if self.closed?
    -  self
    -end
    -
    -
    - -
    -

    - - #getcObject - - - - - -

    - - - - -
    -
    -
    -
    -296
    -297
    -298
    -299
    -300
    -301
    -302
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 296
    -
    -def getc
    -  begin
    -    readchar
    -  rescue EOFError
    -    nil
    -  end
    -end
    -
    -
    - -
    -

    - - #gets(*args) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -281
    -282
    -283
    -284
    -285
    -286
    -287
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 281
    -
    -def gets(*args)
    -  begin
    -    readline(*args)
    -  rescue EOFError
    -    nil
    -  end
    -end
    -
    -
    - -
    -

    - - #hashObject - - - - - -

    - - - - -
    -
    -
    -
    -118
    -119
    -120
    -121
    -122
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 118
    -
    -def hash
    -  # We must define IO#hash here because IO includes Enumerable and
    -  # Enumerable#hash will call IO#read...
    -  self.__id__
    -end
    -
    -
    - -
    -

    - - #initialize_copyObject - - - - - -

    -
    -

    15.2.20.5.21 (x)

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -563
    -564
    -565
    -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
    -596
    -597
    -598
    -599
    -600
    -601
    -602
    -603
    -604
    -605
    -606
    -607
    -608
    -609
    -610
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 563
    -
    -mrb_value
    -mrb_io_initialize_copy(mrb_state *mrb, mrb_value copy)
    -{
    -  mrb_value orig;
    -  mrb_value buf;
    -  struct mrb_io *fptr_copy;
    -  struct mrb_io *fptr_orig;
    -  mrb_bool failed = TRUE;
    -
    -  mrb_get_args(mrb, "o", &orig);
    -  fptr_orig = io_get_open_fptr(mrb, orig);
    -  fptr_copy = (struct mrb_io *)DATA_PTR(copy);
    -  if (fptr_orig == fptr_copy) return copy;
    -  if (fptr_copy != NULL) {
    -    fptr_finalize(mrb, fptr_copy, FALSE);
    -    mrb_free(mrb, fptr_copy);
    -  }
    -  fptr_copy = (struct mrb_io *)mrb_io_alloc(mrb);
    -
    -  DATA_TYPE(copy) = &mrb_io_type;
    -  DATA_PTR(copy) = fptr_copy;
    -
    -  buf = mrb_iv_get(mrb, orig, mrb_intern_cstr(mrb, "@buf"));
    -  mrb_iv_set(mrb, copy, mrb_intern_cstr(mrb, "@buf"), buf);
    -
    -  fptr_copy->fd = mrb_dup(mrb, fptr_orig->fd, &failed);
    -  if (failed) {
    -    mrb_sys_fail(mrb, 0);
    -  }
    -  mrb_fd_cloexec(mrb, fptr_copy->fd);
    -
    -  if (fptr_orig->fd2 != -1) {
    -    fptr_copy->fd2 = mrb_dup(mrb, fptr_orig->fd2, &failed);
    -    if (failed) {
    -      close(fptr_copy->fd);
    -      mrb_sys_fail(mrb, 0);
    -    }
    -    mrb_fd_cloexec(mrb, fptr_copy->fd2);
    -  }
    -
    -  fptr_copy->pid = fptr_orig->pid;
    -  fptr_copy->readable = fptr_orig->readable;
    -  fptr_copy->writable = fptr_orig->writable;
    -  fptr_copy->sync = fptr_orig->sync;
    -  fptr_copy->is_socket = fptr_orig->is_socket;
    -
    -  return copy;
    -}
    -
    -
    - -
    -

    - - #isattyObject - - - - Also known as: - tty? - - - - -

    - - - - -
    -
    -
    -
    -724
    -725
    -726
    -727
    -728
    -729
    -730
    -731
    -732
    -733
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 724
    -
    -mrb_value
    -mrb_io_isatty(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_io *fptr;
    -
    -  fptr = io_get_open_fptr(mrb, self);
    -  if (isatty(fptr->fd) == 0)
    -    return mrb_false_value();
    -  return mrb_true_value();
    -}
    -
    -
    - -
    -

    - - #pidObject - - - - - -

    -
    -

    15.2.20.5.2

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -958
    -959
    -960
    -961
    -962
    -963
    -964
    -965
    -966
    -967
    -968
    -969
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 958
    -
    -mrb_value
    -mrb_io_pid(mrb_state *mrb, mrb_value io)
    -{
    -  struct mrb_io *fptr;
    -  fptr = io_get_open_fptr(mrb, io);
    -
    -  if (fptr->pid > 0) {
    -    return mrb_fixnum_value(fptr->pid);
    -  }
    -
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #posObject - - - - Also known as: - tell - - - - -

    -
    - - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -151
    -152
    -153
    -154
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 151
    -
    -def pos
    -  raise IOError if closed?
    -  sysseek(0, SEEK_CUR) - @buf.bytesize
    -end
    -
    -
    - -
    -

    - - #pos=(i) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -157
    -158
    -159
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 157
    -
    -def pos=(i)
    -  seek(i, SEEK_SET)
    -end
    -
    -
    - -
    - - - - - -
    -
    -
    -
    -350
    -351
    -352
    -353
    -354
    -355
    -356
    -357
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 350
    -
    -def print(*args)
    -  i = 0
    -  len = args.size
    -  while i < len
    -    write args[i].to_s
    -    i += 1
    -  end
    -end
    -
    -
    - -
    -

    - - #printf(*args) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -359
    -360
    -361
    -362
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 359
    -
    -def printf(*args)
    -  write sprintf(*args)
    -  nil
    -end
    -
    -
    - -
    -

    - - #puts(*args) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -337
    -338
    -339
    -340
    -341
    -342
    -343
    -344
    -345
    -346
    -347
    -348
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 337
    -
    -def puts(*args)
    -  i = 0
    -  len = args.size
    -  while i < len
    -    s = args[i].to_s
    -    write s
    -    write "\n" if (s[-1] != "\n")
    -    i += 1
    -  end
    -  write "\n" if len == 0
    -  nil
    -end
    -
    -
    - -
    -

    - - #read(length = nil, outbuf = "") ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -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
    -229
    -230
    -231
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 192
    -
    -def read(length = nil, outbuf = "")
    -  unless length.nil?
    -    unless length.is_a? Fixnum
    -      raise TypeError.new "can't convert #{length.class} into Integer"
    -    end
    -    if length < 0
    -      raise ArgumentError.new "negative length: #{length} given"
    -    end
    -    if length == 0
    -      return ""   # easy case
    -    end
    -  end
    -
    -  array = []
    -  while 1
    -    begin
    -      _read_buf
    -    rescue EOFError
    -      array = nil if array.empty? and (not length.nil?) and length != 0
    -      break
    -    end
    -
    -    if length
    -      consume = (length <= @buf.bytesize) ? length : @buf.bytesize
    -      array.push IO._bufread(@buf, consume)
    -      length -= consume
    -      break if length == 0
    -    else
    -      array.push @buf
    -      @buf = ''
    -    end
    -  end
    -
    -  if array.nil?
    -    outbuf.replace("")
    -    nil
    -  else
    -    outbuf.replace(array.join)
    -  end
    -end
    -
    -
    - -
    -

    - - #readcharObject - - - - - -

    - - - - -
    -
    -
    -
    -289
    -290
    -291
    -292
    -293
    -294
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 289
    -
    -def readchar
    -  _read_buf
    -  c = @buf[0]
    -  @buf[0] = ""
    -  c
    -end
    -
    -
    - -
    -

    - - #readline(arg = "\n", limit = nil) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -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
    -269
    -270
    -271
    -272
    -273
    -274
    -275
    -276
    -277
    -278
    -279
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 233
    -
    -def readline(arg = "\n", limit = nil)
    -  case arg
    -  when String
    -    rs = arg
    -  when Fixnum
    -    rs = "\n"
    -    limit = arg
    -  else
    -    raise ArgumentError
    -  end
    -
    -  if rs.nil?
    -    return read
    -  end
    -
    -  if rs == ""
    -    rs = "\n\n"
    -  end
    -
    -  array = []
    -  while 1
    -    begin
    -      _read_buf
    -    rescue EOFError
    -      array = nil if array.empty?
    -      break
    -    end
    -
    -    if limit && limit <= @buf.size
    -      array.push @buf[0, limit]
    -      @buf[0, limit] = ""
    -      break
    -    elsif idx = @buf.index(rs)
    -      len = idx + rs.size
    -      array.push @buf[0, len]
    -      @buf[0, len] = ""
    -      break
    -    else
    -      array.push @buf
    -      @buf = ''
    -    end
    -  end
    -
    -  raise EOFError.new "end of file reached" if array.nil?
    -
    -  array.join
    -end
    -
    -
    - -
    -

    - - #readlinesObject - - - - - -

    - - - - -
    -
    -
    -
    -329
    -330
    -331
    -332
    -333
    -334
    -335
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 329
    -
    -def readlines
    -  ary = []
    -  while (line = gets)
    -    ary << line
    -  end
    -  ary
    -end
    -
    -
    - -
    -

    - - #rewindObject - - - - - -

    - - - - -
    -
    -
    -
    -161
    -162
    -163
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 161
    -
    -def rewind
    -  seek(0, SEEK_SET)
    -end
    -
    -
    - -
    -

    - - #seek(i, whence = SEEK_SET) ⇒ Object - - - - - -

    -
    - - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -165
    -166
    -167
    -168
    -169
    -170
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 165
    -
    -def seek(i, whence = SEEK_SET)
    -  raise IOError if closed?
    -  sysseek(i, whence)
    -  @buf = ''
    -  0
    -end
    -
    -
    - -
    -

    - - #syncObject - - - - - -

    - - - - -
    -
    -
    -
    -1286
    -1287
    -1288
    -1289
    -1290
    -1291
    -1292
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 1286
    -
    -mrb_value
    -mrb_io_sync(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_io *fptr;
    -  fptr = io_get_open_fptr(mrb, self);
    -  return mrb_bool_value(fptr->sync);
    -}
    -
    -
    - -
    -

    - - #sync=Object - - - - - -

    - - - - -
    -
    -
    -
    -1274
    -1275
    -1276
    -1277
    -1278
    -1279
    -1280
    -1281
    -1282
    -1283
    -1284
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 1274
    -
    -mrb_value
    -mrb_io_set_sync(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_io *fptr;
    -  mrb_bool b;
    -
    -  fptr = io_get_open_fptr(mrb, self);
    -  mrb_get_args(mrb, "b", &b);
    -  fptr->sync = b;
    -  return mrb_bool_value(b);
    -}
    -
    -
    - -
    -

    - - #sysreadObject - - - - - -

    - - - - -
    -
    -
    -
    -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
    -850
    -851
    -852
    -853
    -854
    -855
    -856
    -857
    -858
    -859
    -860
    -861
    -862
    -863
    -864
    -865
    -866
    -867
    -868
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 818
    -
    -mrb_value
    -mrb_io_sysread(mrb_state *mrb, mrb_value io)
    -{
    -  struct mrb_io *fptr;
    -  mrb_value buf = mrb_nil_value();
    -  mrb_int maxlen;
    -  int ret;
    -
    -  mrb_get_args(mrb, "i|S", &maxlen, &buf);
    -  if (maxlen < 0) {
    -    mrb_raise(mrb, E_ARGUMENT_ERROR, "negative expanding string size");
    -  }
    -  else if (maxlen == 0) {
    -    return mrb_str_new(mrb, NULL, maxlen);
    -  }
    -
    -  if (mrb_nil_p(buf)) {
    -    buf = mrb_str_new(mrb, NULL, maxlen);
    -  }
    -
    -  if (RSTRING_LEN(buf) != maxlen) {
    -    buf = mrb_str_resize(mrb, buf, maxlen);
    -  } else {
    -    mrb_str_modify(mrb, RSTRING(buf));
    -  }
    -
    -  fptr = (struct mrb_io *)io_get_open_fptr(mrb, io);
    -  if (!fptr->readable) {
    -    mrb_raise(mrb, E_IO_ERROR, "not opened for reading");
    -  }
    -  ret = read(fptr->fd, RSTRING_PTR(buf), (fsize_t)maxlen);
    -  switch (ret) {
    -    case 0: /* EOF */
    -      if (maxlen == 0) {
    -        buf = mrb_str_new_cstr(mrb, "");
    -      } else {
    -        mrb_raise(mrb, E_EOF_ERROR, "sysread failed: End of File");
    -      }
    -      break;
    -    case -1: /* Error */
    -      mrb_sys_fail(mrb, "sysread failed");
    -      break;
    -    default:
    -      if (RSTRING_LEN(buf) != ret) {
    -        buf = mrb_str_resize(mrb, buf, ret);
    -      }
    -      break;
    -  }
    -
    -  return buf;
    -}
    -
    -
    - -
    -

    - - #sysseekObject - - - - - -

    - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 870
    -
    -mrb_value
    -mrb_io_sysseek(mrb_state *mrb, mrb_value io)
    -{
    -  struct mrb_io *fptr;
    -  off_t pos;
    -  mrb_int offset, whence = -1;
    -
    -  mrb_get_args(mrb, "i|i", &offset, &whence);
    -  if (whence < 0) {
    -    whence = 0;
    -  }
    -
    -  fptr = io_get_open_fptr(mrb, io);
    -  pos = lseek(fptr->fd, (off_t)offset, (int)whence);
    -  if (pos == -1) {
    -    mrb_sys_fail(mrb, "sysseek");
    -  }
    -  if (pos > MRB_INT_MAX) {
    -#ifndef MRB_WITHOUT_FLOAT
    -    return mrb_float_value(mrb, (mrb_float)pos);
    -#else
    -    mrb_raise(mrb, E_IO_ERROR, "sysseek reached too far for MRB_WITHOUT_FLOAT");
    -#endif
    -  } else {
    -    return mrb_fixnum_value(pos);
    -  }
    -}
    -
    -
    - -
    -

    - - #syswriteObject - - - - - -

    - - - - -
    -
    -
    -
    -898
    -899
    -900
    -901
    -902
    -903
    -904
    -905
    -906
    -907
    -908
    -909
    -910
    -911
    -912
    -913
    -914
    -915
    -916
    -917
    -918
    -919
    -920
    -921
    -922
    -923
    -924
    -
    -
    # File 'mrbgems/mruby-io/src/io.c', line 898
    -
    -mrb_value
    -mrb_io_syswrite(mrb_state *mrb, mrb_value io)
    -{
    -  struct mrb_io *fptr;
    -  mrb_value str, buf;
    -  int fd, length;
    -
    -  fptr = io_get_open_fptr(mrb, io);
    -  if (! fptr->writable) {
    -    mrb_raise(mrb, E_IO_ERROR, "not opened for writing");
    -  }
    -
    -  mrb_get_args(mrb, "S", &str);
    -  buf = str;
    -
    -  if (fptr->fd2 == -1) {
    -    fd = fptr->fd;
    -  } else {
    -    fd = fptr->fd2;
    -  }
    -  length = write(fd, RSTRING_PTR(buf), (fsize_t)RSTRING_LEN(buf));
    -  if (length == -1) {
    -    mrb_sys_fail(mrb, 0);
    -  }
    -
    -  return mrb_fixnum_value(length);
    -}
    -
    -
    - -
    -

    - - #ungetc(substr) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -182
    -183
    -184
    -185
    -186
    -187
    -188
    -189
    -190
    -
    -
    # 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)
    -  if @buf.empty?
    -    @buf = substr.dup
    -  else
    -    @buf = substr + @buf
    -  end
    -  nil
    -end
    -
    -
    - -
    -

    - - #write(string) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -124
    -125
    -126
    -127
    -128
    -129
    -130
    -131
    -132
    -133
    -
    -
    # File 'mrbgems/mruby-io/mrblib/io.rb', line 124
    -
    -def write(string)
    -  str = string.is_a?(String) ? string : string.to_s
    -  return 0 if str.empty?
    -  unless @buf.empty?
    -    # reset real pos ignore buf
    -    seek(pos, SEEK_SET)
    -  end
    -  len = syswrite(str)
    -  len
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/IOError.html b/docs/api/IOError.html deleted file mode 100644 index bc9d354..0000000 --- a/docs/api/IOError.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - Exception: IOError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: IOError - - - -

    -
    - -
    -
    Inherits:
    -
    - StandardError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-io/mrblib/io.rb
    -
    - -
    - -

    Overview

    -
    -

    IO

    - - -
    -
    -
    - - -
    - -
    -

    Direct Known Subclasses

    -

    EOFError

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

    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/IPSocket.html b/docs/api/IPSocket.html deleted file mode 100644 index 625be9b..0000000 --- a/docs/api/IPSocket.html +++ /dev/null @@ -1,478 +0,0 @@ - - - - - - - Class: IPSocket - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: IPSocket - - - -

    -
    - -
    -
    Inherits:
    -
    - BasicSocket - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-socket/src/socket.c,
    - mrbgems/mruby-socket/mrblib/socket.rb
    -
    -
    - -
    - -
    -

    Direct Known Subclasses

    -

    TCPSocket, UDPSocket

    -
    - - - -

    Constant Summary

    - -

    Constants inherited - from IO

    -

    IO::BUF_SIZE, IO::SEEK_CUR, IO::SEEK_END, IO::SEEK_SET

    - - - - -

    Instance Attribute Summary

    - -

    Attributes inherited from BasicSocket

    -

    #do_not_reverse_lookup

    - - - -

    - Class Method Summary - collapse -

    - - - -

    - Instance Method Summary - collapse -

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

    Methods inherited from BasicSocket

    -

    #_is_socket=, #_recvfrom, #_setnonblock, #close, do_not_reverse_lookup, do_not_reverse_lookup=, for_fd, #getpeereid, #getpeername, #getsockname, #getsockopt, #initialize, #local_address, #recv, #recv_nonblock, #remote_address, #send, #setsockopt, #shutdown, #sysread, #sysseek, #syswrite

    - - - - - - - - - -

    Methods inherited from IO

    -

    #<<, #_check_readable, #_read_buf, #close, #close_on_exec=, #close_on_exec?, #close_write, #closed?, #each, #each_byte, #eof?, #fileno, #flush, #getc, #gets, #hash, #initialize, #initialize_copy, #isatty, open, #pid, pipe, popen, #pos, #pos=, #print, #printf, #puts, read, #read, #readchar, #readline, #readlines, #rewind, #seek, #sync, #sync=, #sysread, #sysseek, #syswrite, #ungetc, #write

    -
    -

    Constructor Details

    - -

    This class inherits a constructor from BasicSocket

    - -
    - - -
    -

    Class Method Details

    - - -
    -

    - - .getaddress(host) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -212
    -213
    -214
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 212
    -
    -def self.getaddress(host)
    -  Addrinfo.ip(host).ip_address
    -end
    -
    -
    - -
    - -
    -

    Instance Method Details

    - - -
    -

    - - #addrObject - - - - - -

    - - - - -
    -
    -
    -
    -216
    -217
    -218
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 216
    -
    -def addr
    -  Addrinfo.new(self.getsockname)._to_array
    -end
    -
    -
    - -
    -

    - - #peeraddrObject - - - - - -

    - - - - -
    -
    -
    -
    -220
    -221
    -222
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 220
    -
    -def peeraddr
    -  Addrinfo.new(self.getpeername)._to_array
    -end
    -
    -
    - -
    -

    - - #recvfrom(maxlen, flags = 0) ⇒ Object - - - - - -

    -
    -

    dummy

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -558
    -559
    -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
    -
    -
    # File 'mrbgems/mruby-socket/src/socket.c', line 558
    -
    -static mrb_value
    -mrb_ipsocket_recvfrom(mrb_state *mrb, mrb_value self)
    -{
    -  struct sockaddr_storage ss;
    -  socklen_t socklen;
    -  mrb_value a, buf, pair;
    -  mrb_int flags, maxlen;
    -  ssize_t n;
    -  int fd;
    -
    -  fd = socket_fd(mrb, self);
    -  flags = 0;
    -  mrb_get_args(mrb, "i|i", &maxlen, &flags);
    -  buf = mrb_str_buf_new(mrb, maxlen);
    -  socklen = sizeof(ss);
    -  n = recvfrom(fd, RSTRING_PTR(buf), (fsize_t)maxlen, (int)flags,
    -                 (struct sockaddr *)&ss, &socklen);
    -  if (n == -1) {
    -    mrb_sys_fail(mrb, "recvfrom");
    -  }
    -  mrb_str_resize(mrb, buf, (mrb_int)n);
    -  a = sa2addrlist(mrb, (struct sockaddr *)&ss, socklen);
    -  pair = mrb_ary_new_capa(mrb, 2);
    -  mrb_ary_push(mrb, pair, buf);
    -  mrb_ary_push(mrb, pair, a);
    -  return pair;
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/IndexError.html b/docs/api/IndexError.html deleted file mode 100644 index b9c9847..0000000 --- a/docs/api/IndexError.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - Exception: IndexError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: IndexError - - - -

    -
    - -
    -
    Inherits:
    -
    - StandardError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/10error.rb
    -
    - -
    - -

    Overview

    -
    -

    ISO 15.2.33

    - - -
    -
    -
    - - -
    - -
    -

    Direct Known Subclasses

    -

    KeyError, StopIteration

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

    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/Integer.html b/docs/api/Integer.html deleted file mode 100644 index a510cf1..0000000 --- a/docs/api/Integer.html +++ /dev/null @@ -1,544 +0,0 @@ - - - - - - - Class: Integer - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Integer - - - -

    -
    - -
    -
    Inherits:
    -
    - Numeric - -
      -
    • Object
    • - - - - - -
    - show all - -
    -
    - - - - - - -
    -
    Includes:
    -
    Integral
    -
    - - - - - - -
    -
    Defined in:
    -
    mrblib/numeric.rb,
    - src/numeric.c
    -
    -
    - -
    - -

    Overview

    -
    -

    Integer

    - -

    ISO 15.2.8

    - - -
    -
    -
    - - -
    - -
    -

    Direct Known Subclasses

    -

    Fixnum

    -
    - - - - - - - - -

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #ceil ⇒ Object - - - - - - - - - - - - - -

      Returns the receiver simply.

      -
      - -
    • - - -
    • - - - #floor ⇒ Object - - - - (also: #round, #truncate) - - - - - - - - - - - -

      Returns the receiver simply.

      -
      - -
    • - - -
    • - - - #to_i ⇒ Integer - - - - - - - - - - - - - -

      As int is already an Integer, all these methods simply return the receiver.

      -
      - -
    • - - -
    • - - - #to_i ⇒ Integer - - - - - - - - - - - - - -

      As int is already an Integer, all these methods simply return the receiver.

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

    Methods included from Integral

    -

    #**, #/, #<, #<=, #<=>, #>, #>=, #__coerce_step_counter, #div, #downto, #next, #quo, #step, #times, #upto

    - - - - - - - - - -

    Methods inherited from Numeric

    -

    #+@, #-@, #abs, #finite?, #infinite?, #negative?, #nonzero?, #positive?, #to_r, #zero?

    - - - - - - - - - -

    Methods included from Comparable

    -

    #<, #<=, #==, #>, #>=, #between?, #clamp

    - - -
    -

    Instance Method Details

    - - -
    -

    - - #ceilObject - - - - - -

    -
    -

    Returns the receiver simply.

    - -

    ISO 15.2.8.3.14

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -783
    -784
    -785
    -786
    -787
    -
    -
    # File 'src/numeric.c', line 783
    -
    -static mrb_value
    -int_to_i(mrb_state *mrb, mrb_value num)
    -{
    -  return num;
    -}
    -
    -
    - -
    -

    - - #floorObject - - - - Also known as: - round, truncate - - - - -

    -
    -

    Returns the receiver simply.

    - -

    ISO 15.2.8.3.17

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -783
    -784
    -785
    -786
    -787
    -
    -
    # File 'src/numeric.c', line 783
    -
    -static mrb_value
    -int_to_i(mrb_state *mrb, mrb_value num)
    -{
    -  return num;
    -}
    -
    -
    - -
    -

    - - #to_iInteger - - - - - -

    -
    -

    As int is already an Integer, all these -methods simply return the receiver.

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

    Returns:

    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -783
    -784
    -785
    -786
    -787
    -
    -
    # File 'src/numeric.c', line 783
    -
    -static mrb_value
    -int_to_i(mrb_state *mrb, mrb_value num)
    -{
    -  return num;
    -}
    -
    -
    - -
    -

    - - #to_iInteger - - - - - -

    -
    -

    As int is already an Integer, all these -methods simply return the receiver.

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

    Returns:

    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -783
    -784
    -785
    -786
    -787
    -
    -
    # File 'src/numeric.c', line 783
    -
    -static mrb_value
    -int_to_i(mrb_state *mrb, mrb_value num)
    -{
    -  return num;
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Integral.html b/docs/api/Integral.html deleted file mode 100644 index 1890d87..0000000 --- a/docs/api/Integral.html +++ /dev/null @@ -1,1592 +0,0 @@ - - - - - - - Module: Integral - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Module: Integral - - - -

    -
    - - - - - - - - - -
    -
    Included in:
    -
    Integer
    -
    - - - -
    -
    Defined in:
    -
    mrblib/numeric.rb,
    - src/numeric.c
    -
    -
    - -
    - -

    Overview

    -
    -

    Integral

    - -

    mruby special - module to share methods between Floats and Integers - to make them compatible

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

    - Instance Method Summary - collapse -

    - - - - - - -
    -

    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) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #<-1 -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (-1) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -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);
    -}
    -
    -
    - -
    -

    - - #>Object - - - - - -

    - - - - -
    -
    -
    -
    -1529
    -1530
    -1531
    -1532
    -1533
    -1534
    -1535
    -1536
    -1537
    -1538
    -1539
    -1540
    -
    -
    # 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();
    -}
    -
    -
    - -
    -

    - - #>=Object - - - - - -

    - - - - -
    -
    -
    -
    -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 - - - - - -

    - - - - -
    -
    -
    -
    -172
    -173
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    -181
    -182
    -183
    -184
    -185
    -186
    -
    -
    # File 'src/numeric.c', line 172
    -
    -static mrb_value
    -integral_coerce_step_counter(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value 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)) {
    -    return mrb_Float(mrb, self);
    -  }
    -#endif
    -
    -  return self;
    -}
    -
    -
    - -
    -

    - - #divObject - - - - - -

    -
    -

    15.2.7.4.5 (x)

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -115
    -116
    -117
    -118
    -119
    -120
    -121
    -122
    -123
    -124
    -125
    -126
    -127
    -128
    -129
    -130
    -131
    -132
    -
    -
    # 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
    -}
    -
    -
    - -
    -

    - - #downto(num, &block) ⇒ Object - - - - - -

    -
    -

    Calls the given block once for each Integer -from +self+ downto +num+.

    - -

    ISO 15.2.8.3.15

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    -56
    -
    -
    # File 'mrblib/numeric.rb', line 47
    -
    -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
    -
    -
    - -
    -

    - - #nextObject - - - - Also known as: - succ - - - - -

    -
    -

    Returns self + 1

    - -

    ISO 15.2.8.3.19

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -62
    -63
    -64
    -
    -
    # File 'mrblib/numeric.rb', line 62
    -
    -def next
    -  self + 1
    -end
    -
    -
    - -
    -

    - - #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
    -}
    -
    -
    - -
    -

    - - #step(num = nil, step = 1, &block) ⇒ Object - - - - - -

    -
    -

    Calls the given block from +self+ to +num+ -incremented by +step+ (default 1).

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -103
    -104
    -105
    -106
    -107
    -108
    -109
    -110
    -111
    -112
    -113
    -114
    -115
    -116
    -117
    -118
    -119
    -120
    -121
    -122
    -123
    -124
    -125
    -126
    -127
    -
    -
    # File 'mrblib/numeric.rb', line 103
    -
    -def step(num=nil, step=1, &block)
    -  raise ArgumentError, "step can't be 0" if step == 0
    -  return to_enum(:step, num, step) unless block
    -
    -  i = __coerce_step_counter(num, step)
    -  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
    -  elsif step > 0
    -    while i <= num
    -      block.call(i)
    -      i += step
    -    end
    -  else
    -    while i >= num
    -      block.call(i)
    -      i += step
    -    end
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #times(&block) ⇒ Object - - - - - -

    -
    -

    Calls the given block +self+ times.

    - -

    ISO 15.2.8.3.22

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -72
    -73
    -74
    -75
    -76
    -77
    -78
    -79
    -80
    -81
    -
    -
    # File 'mrblib/numeric.rb', line 72
    -
    -def times &block
    -  return to_enum :times unless block
    -
    -  i = 0
    -  while i < self
    -    block.call i
    -    i += 1
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #upto(num, &block) ⇒ Object - - - - - -

    -
    -

    Calls the given block once for each Integer -from +self+ upto +num+.

    - -

    ISO 15.2.8.3.27

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -88
    -89
    -90
    -91
    -92
    -93
    -94
    -95
    -96
    -97
    -
    -
    # File 'mrblib/numeric.rb', line 88
    -
    -def upto(num, &block)
    -  return to_enum(:upto, num) unless block
    -
    -  i = self.to_i
    -  while i <= num
    -    block.call(i)
    -    i += 1
    -  end
    -  self
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Kernel.html b/docs/api/Kernel.html deleted file mode 100644 index 385885d..0000000 --- a/docs/api/Kernel.html +++ /dev/null @@ -1,7293 +0,0 @@ - - - - - - - Module: Kernel - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Module: Kernel - - - -

    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/kernel.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
    -
    -
    - -
    - -

    Overview

    -
    -

    Kernel

    - -

    ISO 15.3.1

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

    - Class Method Summary - collapse -

    - - - -

    - Instance Method Summary - collapse -

    - - - - -
    -

    Dynamic Method Handling

    -

    - This class handles dynamic methods through the method_missing method - -

    - -
    -

    - - #method_missingObject - - - - - -

    -
    -

    15.3.1.3.30

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -689
    -690
    -691
    -692
    -693
    -694
    -695
    -696
    -697
    -698
    -699
    -700
    -
    -
    # File 'src/kernel.c', line 689
    -
    -static mrb_value
    -mrb_obj_missing(mrb_state *mrb, mrb_value mod)
    -{
    -  mrb_sym name;
    -  mrb_value *a;
    -  mrb_int alen;
    -
    -  mrb_get_args(mrb, "n*!", &name, &a, &alen);
    -  mrb_method_missing(mrb, name, mod, mrb_ary_new_from_values(mrb, alen, a));
    -  /* not reached */
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    - - -
    -

    Class Method Details

    - - -
    -

    - - .Array(arg) ⇒ Array - - - - - -

    -
    -

    Returns +arg+ as an Array using to_a method.

    - -

    Array(1..5) #=> [1, 2, 3, 4, 5]

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -168
    -169
    -170
    -171
    -172
    -173
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    -
    -
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 168
    -
    -static mrb_value
    -mrb_f_array(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value arg, tmp;
    -
    -  mrb_get_args(mrb, "o", &arg);
    -  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);
    -  }
    -
    -  return tmp;
    -}
    -
    -
    - -
    -

    - - .callerObject - - - - - -

    - - - - -
    -
    -
    -
    -7
    -8
    -9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -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
    -53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -61
    -
    -
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 7
    -
    -static mrb_value
    -mrb_f_caller(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value bt, v, length;
    -  mrb_int bt_len, argc, lev, n;
    -
    -  bt = mrb_get_backtrace(mrb);
    -  bt_len = RARRAY_LEN(bt);
    -  argc = mrb_get_args(mrb, "|oo", &v, &length);
    -
    -  switch (argc) {
    -    case 0:
    -      lev = 1;
    -      n = bt_len - lev;
    -      break;
    -    case 1:
    -      if (mrb_range_p(v)) {
    -        mrb_int beg, len;
    -        if (mrb_range_beg_len(mrb, v, &beg, &len, bt_len, TRUE) == MRB_RANGE_OK) {
    -          lev = beg;
    -          n = len;
    -        }
    -        else {
    -          return mrb_nil_value();
    -        }
    -      }
    -      else {
    -        lev = mrb_int(mrb, v);
    -        if (lev < 0) {
    -          mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative level (%v)", v);
    -        }
    -        n = bt_len - lev;
    -      }
    -      break;
    -    case 2:
    -      lev = mrb_int(mrb, v);
    -      n = mrb_int(mrb, length);
    -      if (lev < 0) {
    -        mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative level (%v)", v);
    -      }
    -      if (n < 0) {
    -        mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative size (%v)", length);
    -      }
    -      break;
    -    default:
    -      lev = n = 0;
    -      break;
    -  }
    -
    -  if (n == 0) {
    -    return mrb_ary_new(mrb);
    -  }
    -
    -  return mrb_funcall(mrb, bt, "[]", 2, mrb_fixnum_value(lev), mrb_fixnum_value(n));
    -}
    -
    -
    - -
    -

    - - - .raiseObject - - .raise(string) ⇒ Object - - .raise(exception[, string]) ⇒ Object - - - - - - -

    -
    -

    With no arguments, raises a RuntimeError -With a single +String+ argument, raises a -+RuntimeError+ with the string as a message. Otherwise, -the first parameter should be the name of an +Exception+ -class (or an object that returns an +Exception+ object when sent -an +exception+ message). The optional second parameter sets the -message associated with the exception, and the third parameter is an -array of callback information. Exceptions are caught by the -+rescue+ clause of begin...end blocks.

    - -

    raise “Failed to create socket” - raise ArgumentError, “No parameters”, caller

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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 585
    -
    -MRB_API mrb_value
    -mrb_f_raise(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value a[2], exc;
    -  mrb_int argc;
    -
    -
    -  argc = mrb_get_args(mrb, "|oo", &a[0], &a[1]);
    -  switch (argc) {
    -  case 0:
    -    mrb_raise(mrb, E_RUNTIME_ERROR, "");
    -    break;
    -  case 1:
    -    if (mrb_string_p(a[0])) {
    -      a[1] = a[0];
    -      argc = 2;
    -      a[0] = mrb_obj_value(E_RUNTIME_ERROR);
    -    }
    -    /* fall through */
    -  default:
    -    exc = mrb_make_exception(mrb, argc, a);
    -    mrb_exc_raise(mrb, exc);
    -    break;
    -  }
    -  return mrb_nil_value();            /* not reached */
    -}
    -
    -
    - -
    -

    - - .Float(arg) ⇒ Float - - - - - -

    -
    -

    Returns arg converted to a float. Numeric types are converted -directly, the rest are converted using arg.to_f.

    - -

    Float(1) #=> 1.0 - Float(123.456) #=> 123.456 - Float(“123.456”) #=> 123.456 - Float(nil) #=> TypeError

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -128
    -129
    -130
    -131
    -132
    -133
    -134
    -135
    -
    -
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 128
    -
    -static mrb_value
    -mrb_f_float(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value arg;
    -
    -  mrb_get_args(mrb, "o", &arg);
    -  return mrb_Float(mrb, arg);
    -}
    -
    -
    - -
    -

    - - .Hash(arg) ⇒ Hash - - - - - -

    -
    -

    Returns a Hash if arg is a Hash. -Returns an empty Hash when arg is nil -or [].

    - -
    Hash([])          #=> {}
    -Hash(nil)         #=> {}
    -Hash(key: :value) #=> {:key => :value}
    -Hash([1, 2, 3])   #=> TypeError
    -
    - - -
    -
    -
    - -
    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Hash) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -196
    -197
    -198
    -199
    -200
    -201
    -202
    -203
    -204
    -205
    -206
    -
    -
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 196
    -
    -static mrb_value
    -mrb_f_hash(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value arg;
    -
    -  mrb_get_args(mrb, "o", &arg);
    -  if (mrb_nil_p(arg) || (mrb_array_p(arg) && RARRAY_LEN(arg) == 0)) {
    -    return mrb_hash_new(mrb);
    -  }
    -  return mrb_ensure_hash_type(mrb, arg);
    -}
    -
    -
    - -
    -

    - - .Integer(arg, base = 0) ⇒ Integer - - - - - -

    -
    -

    Converts arg to a Fixnum. -Numeric types are converted directly (with floating point numbers -being truncated). base (0, or between 2 and 36) is a base for -integer string representation. If arg is a String, -when base is omitted or equals to zero, radix indicators -(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 treated as integers. -Passing nil raises a TypeError.

    - -

    Integer(123.999) #=> 123 - Integer(“0x1a”) #=> 26 - Integer(Time.new) #=> 1204973019 - Integer(“0930”, 10) #=> 930 - Integer(“111”, 2) #=> 7 - Integer(nil) #=> TypeError

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

    Returns:

    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -105
    -106
    -107
    -108
    -109
    -110
    -111
    -112
    -113
    -
    -
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 105
    -
    -static mrb_value
    -mrb_f_integer(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value arg;
    -  mrb_int base = 0;
    -
    -  mrb_get_args(mrb, "o|i", &arg, &base);
    -  return mrb_convert_to_integer(mrb, arg, base);
    -}
    -
    -
    - -
    -

    - - .String(arg) ⇒ String - - - - - -

    -
    -

    Returns arg as an String. -converted using to_s method.

    - -

    String(self) #=> “main” - String(self.class) #=> “Object” - String(123456) #=> “123456”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -149
    -150
    -151
    -152
    -153
    -154
    -155
    -156
    -157
    -
    -
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 149
    -
    -static mrb_value
    -mrb_f_string(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value arg, tmp;
    -
    -  mrb_get_args(mrb, "o", &arg);
    -  tmp = mrb_convert_type(mrb, arg, MRB_TT_STRING, "String", "to_s");
    -  return tmp;
    -}
    -
    -
    - -
    - -
    -

    Instance Method Details

    - - -
    -

    - - #!~(y) ⇒ Object - - - - - -

    -
    -

    11.4.4 Step c)

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -38
    -39
    -40
    -
    -
    # File 'mrblib/kernel.rb', line 38
    -
    -def !~(y)
    -  !(self =~ y)
    -end
    -
    -
    - -
    -

    - - #===(other) ⇒ Boolean - - - - - -

    -
    -

    Case Equality—For class Object, effectively the same -as calling #==, but typically overridden by descendants -to provide meaningful semantics in case statements.

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -71
    -72
    -73
    -74
    -75
    -76
    -77
    -78
    -
    -
    # File 'src/kernel.c', line 71
    -
    -static mrb_value
    -mrb_equal_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value arg;
    -
    -  mrb_get_args(mrb, "o", &arg);
    -  return mrb_bool_value(mrb_equal(mrb, self, arg));
    -}
    -
    -
    - -
    -

    - - #__case_eqqObject - - - - - -

    -
    -

    internal

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -746
    -747
    -748
    -749
    -750
    -751
    -752
    -753
    -754
    -755
    -756
    -757
    -758
    -759
    -760
    -761
    -
    -
    # File 'src/kernel.c', line 746
    -
    -static mrb_value
    -mrb_obj_ceqq(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value v;
    -  mrb_int i, len;
    -  mrb_sym eqq = mrb_intern_lit(mrb, "===");
    -  mrb_value ary = mrb_ary_splat(mrb, self);
    -
    -  mrb_get_args(mrb, "o", &v);
    -  len = RARRAY_LEN(ary);
    -  for (i=0; i<len; i++) {
    -    mrb_value c = mrb_funcall_argv(mrb, mrb_ary_entry(ary, i), eqq, 1, &v);
    -    if (mrb_test(c)) return mrb_true_value();
    -  }
    -  return mrb_false_value();
    -}
    -
    -
    - -
    -

    - - #__method__Object - - - - - -

    -
    -

    Returns the name at the definition of the current method as a -Symbol. -If called outside of a method, it returns nil.

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -72
    -73
    -74
    -75
    -76
    -77
    -78
    -79
    -80
    -81
    -
    -
    # File 'mrbgems/mruby-kernel-ext/src/kernel.c', line 72
    -
    -static mrb_value
    -mrb_f_method(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_callinfo *ci = mrb->c->ci;
    -  ci--;
    -  if (ci->mid)
    -    return mrb_symbol_value(ci->mid);
    -  else
    -    return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #__printstr__Object - - - - - -

    -
    -

    15.3.1.3.34

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -41
    -42
    -43
    -44
    -45
    -46
    -47
    -48
    -49
    -50
    -
    -
    # File 'mrbgems/mruby-print/src/print.c', line 41
    -
    -mrb_value
    -mrb_printstr(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value argv;
    -
    -  mrb_get_args(mrb, "o", &argv);
    -  printstr(mrb, argv);
    -
    -  return argv;
    -}
    -
    -
    - -
    -

    - - #__to_intObject - - - - - -

    -
    -

    internal

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

    - - #__to_strObject - - - - - -

    -
    -

    internal

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

    - - #_inspect(_recur_list) ⇒ Object - - - - - -

    -
    -

    internal method for inspect

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -43
    -44
    -45
    -
    -
    # File 'mrblib/kernel.rb', line 43
    -
    -def _inspect(_recur_list)
    -  self.inspect
    -end
    -
    -
    - -
    -

    - - #`(cmd) ⇒ Object - - - - - -

    -
    -

    15.3.1.2.1 Kernel. -provided by Kernel# -15.3.1.3.3

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -10
    -11
    -12
    -
    -
    # File 'mrblib/kernel.rb', line 10
    -
    -def `(s)
    -  raise NotImplementedError.new("backquotes not implemented")
    -end
    -
    -
    - -
    -

    - - - #block_given?Boolean - - #iterator?Boolean - - - - - - -

    -
    -

    Returns true if yield would execute a -block in the current context. The iterator? form -is mildly deprecated.

    - -

    def try - if block_given? - yield - else - “no block” - end - end - try #=> “no block” - try { “hello” } #=> “hello” - try do “hello” end #=> “hello”

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #block_given?Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #iterator?Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -153
    -154
    -155
    -156
    -157
    -158
    -159
    -160
    -161
    -162
    -163
    -164
    -165
    -166
    -167
    -168
    -169
    -170
    -171
    -172
    -173
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    -
    -
    # File 'src/kernel.c', line 127
    -
    -static mrb_value
    -mrb_f_block_given_p_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_callinfo *ci = &mrb->c->ci[-1];
    -  mrb_callinfo *cibase = mrb->c->cibase;
    -  mrb_value *bp;
    -  struct RProc *p;
    -
    -  if (ci <= cibase) {
    -    /* toplevel does not have block */
    -    return mrb_false_value();
    -  }
    -  p = ci->proc;
    -  /* search method/class/module proc */
    -  while (p) {
    -    if (MRB_PROC_SCOPE_P(p)) break;
    -    p = p->upper;
    -  }
    -  if (p == NULL) return mrb_false_value();
    -  /* search ci corresponding to proc */
    -  while (cibase < ci) {
    -    if (ci->proc == p) break;
    -    ci--;
    -  }
    -  if (ci == cibase) {
    -    return mrb_false_value();
    -  }
    -  else if (ci->env) {
    -    struct REnv *e = ci->env;
    -    int bidx;
    -
    -    /* top-level does not have block slot (always false) */
    -    if (e->stack == mrb->c->stbase)
    -      return mrb_false_value();
    -    /* use saved block arg position */
    -    bidx = MRB_ENV_BIDX(e);
    -    /* bidx may be useless (e.g. define_method) */
    -    if (bidx >= MRB_ENV_STACK_LEN(e))
    -      return mrb_false_value();
    -    bp = &e->stack[bidx];
    -  }
    -  else {
    -    bp = ci[1].stackent+1;
    -    if (ci->argc >= 0) {
    -      bp += ci->argc;
    -    }
    -    else {
    -      bp++;
    -    }
    -  }
    -  if (mrb_nil_p(*bp))
    -    return mrb_false_value();
    -  return mrb_true_value();
    -}
    -
    -
    - -
    -

    - - #classClass - - - - - -

    -
    -

    Returns the class of obj. This method must always be -called with an explicit receiver, as class is also a -reserved word in Ruby.

    - -

    1.class #=> Fixnum - self.class #=> Object

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

    Returns:

    -
      - -
    • - - - (Class) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -194
    -195
    -196
    -197
    -198
    -
    -
    # File 'src/kernel.c', line 194
    -
    -static mrb_value
    -mrb_obj_class_m(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_obj_value(mrb_obj_class(mrb, self));
    -}
    -
    -
    - -
    -

    - - #cloneObject - - - - - -

    -
    -

    Produces a shallow copy of obj—the instance variables of -obj are copied, but not the objects they reference. Copies -the frozen state of obj. See also the discussion -under Object#dup.

    - -

    class Klass - attr_accessor :str - end - s1 = Klass.new #=> # - s1.str = "Hello" #=> "Hello" - s2 = s1.clone #=> #<Klass:0x401b3998 @str="Hello"> - s2.str[1,4] = "i" #=> "i" - s1.inspect #=> "#<Klass:0x401b3a38 @str=\"Hi\">" - s2.inspect #=> "#<Klass:0x401b3998 @str=\"Hi\">"

    - -

    This method may have class-specific behavior. If so, that -behavior will be documented under the #+initialize_copy+ method of -the class.

    - -

    Some Class(True False Nil Symbol Fixnum Float) Object cannot clone.

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

    Returns:

    -
      - -
    • - - - (Object) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -321
    -322
    -323
    -324
    -325
    -326
    -327
    -328
    -329
    -330
    -331
    -332
    -333
    -334
    -335
    -336
    -337
    -338
    -339
    -340
    -341
    -
    -
    # File 'src/kernel.c', line 321
    -
    -MRB_API mrb_value
    -mrb_obj_clone(mrb_state *mrb, mrb_value self)
    -{
    -  struct RObject *p;
    -  mrb_value clone;
    -
    -  if (mrb_immediate_p(self)) {
    -    mrb_raisef(mrb, E_TYPE_ERROR, "can't clone %v", self);
    -  }
    -  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));
    -  p->c = mrb_singleton_class_clone(mrb, self);
    -  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;
    -}
    -
    -
    - -
    -

    - - #define_singleton_methodObject - - - - - -

    -
    -

    15.3.1.3.45

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -384
    -385
    -386
    -387
    -388
    -389
    -390
    -391
    -392
    -393
    -394
    -395
    -396
    -397
    -398
    -399
    -
    -
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 384
    -
    -static mrb_value
    -mod_define_singleton_method(mrb_state *mrb, mrb_value self)
    -{
    -  struct RProc *p;
    -  mrb_method_t m;
    -  mrb_sym mid;
    -  mrb_value blk = mrb_nil_value();
    -
    -  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;
    -  MRB_METHOD_FROM_PROC(m, p);
    -  mrb_define_method_raw(mrb, mrb_class_ptr(mrb_singleton_class(mrb, self)), mid, m);
    -  return mrb_symbol_value(mid);
    -}
    -
    -
    - -
    -

    - - #dupObject - - - - - -

    -
    -

    Produces a shallow copy of obj—the instance variables of -obj are copied, but not the objects they reference. -dup copies the frozen state of obj. See also -the discussion under Object#clone. In general, -clone and dup may have different semantics -in descendant classes. While clone is used to duplicate -an object, including its internal state, dup typically -uses the class of the descendant object to create the new instance.

    - -

    This method may have class-specific behavior. If so, that -behavior will be documented under the #+initialize_copy+ method of -the class.

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

    Returns:

    -
      - -
    • - - - (Object) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -362
    -363
    -364
    -365
    -366
    -367
    -368
    -369
    -370
    -371
    -372
    -373
    -374
    -375
    -376
    -377
    -378
    -379
    -
    -
    # File 'src/kernel.c', line 362
    -
    -MRB_API mrb_value
    -mrb_obj_dup(mrb_state *mrb, mrb_value obj)
    -{
    -  struct RBasic *p;
    -  mrb_value dup;
    -
    -  if (mrb_immediate_p(obj)) {
    -    mrb_raisef(mrb, E_TYPE_ERROR, "can't dup %v", obj);
    -  }
    -  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));
    -  dup = mrb_obj_value(p);
    -  init_copy(mrb, dup, obj);
    -
    -  return dup;
    -}
    -
    -
    - -
    -

    - - - #==(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) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -1670
    -1671
    -1672
    -1673
    -1674
    -1675
    -1676
    -1677
    -
    -
    # File 'src/class.c', line 1670
    -
    -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 - - - - - -

    -
    -

    Adds to obj the instance methods from each module given as a -parameter.

    - -

    module Mod - def hello - “Hello from Mod.\n” - end - end

    - -

    class Klass - def hello - “Hello from Klass.\n” - end - end

    - -

    k = Klass.new - k.hello #=> “Hello from Klass.\n” - k.extend(Mod) #=> # - k.hello #=> "Hello from Mod.\n"

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

    Returns:

    -
      - -
    • - - - (Object) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -424
    -425
    -426
    -427
    -428
    -429
    -430
    -431
    -432
    -
    -
    # File 'src/kernel.c', line 424
    -
    -static mrb_value
    -mrb_obj_extend_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value *argv;
    -  mrb_int argc;
    -
    -  mrb_get_args(mrb, "*", &argv, &argc);
    -  return mrb_obj_extend(mrb, argc, argv, self);
    -}
    -
    -
    - -
    -

    - - #formatObject - - - - - -

    -
    -

    in sprintf.c

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -9
    -
    -
    # File 'mrbgems/mruby-sprintf/src/kernel.c', line 9
    -
    -mrb_value mrb_f_sprintf(mrb_state *mrb, mrb_value obj);
    -
    -
    - -
    -

    - - #freezeObject - - - - - -

    -
    -

    15.3.1.3.13

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -434
    -435
    -436
    -437
    -438
    -439
    -440
    -441
    -442
    -443
    -444
    -445
    -
    -
    # File 'src/kernel.c', line 434
    -
    -MRB_API mrb_value
    -mrb_obj_freeze(mrb_state *mrb, mrb_value self)
    -{
    -  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;
    -}
    -
    -
    - -
    -

    - - #frozen?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -447
    -448
    -449
    -450
    -451
    -
    -
    # File 'src/kernel.c', line 447
    -
    -static mrb_value
    -mrb_obj_frozen(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_bool_value(mrb_immediate_p(self) || mrb_frozen_p(mrb_basic_ptr(self)));
    -}
    -
    -
    - -
    -

    - - #gets(*args) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -28
    -29
    -30
    -
    -
    # File 'mrbgems/mruby-io/mrblib/kernel.rb', line 28
    -
    -def gets(*args)
    -  $stdin.gets(*args)
    -end
    -
    -
    - -
    -

    - - #global_variablesArray - - - - - -

    -
    -

    Returns an array of the names of global variables.

    - -

    global_variables.grep /std/ #=> [:$stdin, :$stdout, :$stderr]

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -985
    -986
    -987
    -988
    -989
    -990
    -991
    -992
    -993
    -
    -
    # 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);
    -
    -  iv_foreach(mrb, t, gv_i, &ary);
    -  return ary;
    -}
    -
    -
    - -
    -

    - - #hashFixnum - - - - - -

    -
    -

    Generates a Fixnum hash value for this object. This -function must have the property that a.eql?(b) implies -a.hash == b.hash. The hash value is used by class -Hash. Any hash value that exceeds the capacity of a -Fixnum will be truncated before being used.

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

    Returns:

    -
      - -
    • - - - (Fixnum) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -464
    -465
    -466
    -467
    -468
    -
    -
    # File 'src/kernel.c', line 464
    -
    -static mrb_value
    -mrb_obj_hash(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_fixnum_value(mrb_obj_id(self));
    -}
    -
    -
    - -
    -

    - - #initialize_copyObject - - - - - -

    -
    -

    15.3.1.3.16

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -471
    -472
    -473
    -474
    -475
    -476
    -477
    -478
    -479
    -480
    -481
    -482
    -
    -
    # File 'src/kernel.c', line 471
    -
    -static mrb_value
    -mrb_obj_init_copy(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value orig;
    -
    -  mrb_get_args(mrb, "o", &orig);
    -  if (mrb_obj_equal(mrb, self, orig)) return self;
    -  if ((mrb_type(self) != mrb_type(orig)) || (mrb_obj_class(mrb, self) != mrb_obj_class(mrb, orig))) {
    -      mrb_raise(mrb, E_TYPE_ERROR, "initialize_copy should take same class object");
    -  }
    -  return self;
    -}
    -
    -
    - -
    -

    - - #inspectString - - - - - -

    -
    -

    Returns a string containing a human-readable representation of -obj. If not overridden and no instance variables, uses the -to_s method to generate the string. -obj. If not overridden, uses the to_s method to -generate the string.

    - -

    [ 1, 2, 3..4, ‘five’ ].inspect #=> “[1, 2, 3..4, "five"]” - Time.new.inspect #=> “2008-03-08 19:43:39 +0900”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -
    -
    # File 'src/kernel.c', line 53
    -
    -MRB_API mrb_value
    -mrb_obj_inspect(mrb_state *mrb, mrb_value 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);
    -}
    -
    -
    - -
    -

    - - #instance_of?Boolean - - - - - -

    -
    -

    Returns true if obj is an instance of the given -class. See also Object#kind_of?.

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -500
    -501
    -502
    -503
    -504
    -505
    -506
    -507
    -508
    -
    -
    # File 'src/kernel.c', line 500
    -
    -static mrb_value
    -obj_is_instance_of(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value arg;
    -
    -  mrb_get_args(mrb, "C", &arg);
    -
    -  return mrb_bool_value(mrb_obj_is_instance_of(mrb, self, mrb_class_ptr(arg)));
    -}
    -
    -
    - -
    -

    - - #instance_variable_defined?(symbol) ⇒ Boolean - - - - - -

    -
    -

    Returns true if the given instance variable is -defined in obj.

    - -

    class Fred - def initialize(p1, p2) - @a, @b = p1, p2 - end - end - fred = Fred.new(‘cat’, 99) - fred.instance_variable_defined?(:@a) #=> true - fred.instance_variable_defined?(“@b”) #=> true - fred.instance_variable_defined?(“@c”) #=> false

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    -
    -
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 47
    -
    -static mrb_value
    -mrb_obj_ivar_defined(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_sym sym;
    -
    -  mrb_get_args(mrb, "n", &sym);
    -  mrb_iv_name_sym_check(mrb, sym);
    -  return mrb_bool_value(mrb_iv_defined(mrb, self, sym));
    -}
    -
    -
    - -
    -

    - - #instance_variable_get(symbol) ⇒ Object - - - - - -

    -
    -

    Returns the value of the given instance variable, or nil if the -instance variable is not set. The @ part of the -variable name should be included for regular instance -variables. Throws a NameError exception if the -supplied symbol is not valid as an instance variable name.

    - -

    class Fred - def initialize(p1, p2) - @a, @b = p1, p2 - end - end - fred = Fred.new(‘cat’, 99) - fred.instance_variable_get(:@a) #=> “cat” - fred.instance_variable_get(“@b”) #=> 99

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

    Returns:

    -
      - -
    • - - - (Object) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -77
    -78
    -79
    -80
    -81
    -82
    -83
    -84
    -85
    -
    -
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 77
    -
    -static mrb_value
    -mrb_obj_ivar_get(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_sym iv_name;
    -
    -  mrb_get_args(mrb, "n", &iv_name);
    -  mrb_iv_name_sym_check(mrb, iv_name);
    -  return mrb_iv_get(mrb, self, iv_name);
    -}
    -
    -
    - -
    -

    - - #instance_variable_set(symbol, obj) ⇒ Object - - - - - -

    -
    -

    Sets the instance variable names by symbol to -object, thereby frustrating the efforts of the class’s -author to attempt to provide proper encapsulation. The variable -did not have to exist prior to this call.

    - -

    class Fred - def initialize(p1, p2) - @a, @b = p1, p2 - end - end - fred = Fred.new(‘cat’, 99) - fred.instance_variable_set(:@a, ‘dog’) #=> “dog” - fred.instance_variable_set(:@c, ‘cat’) #=> “cat” - fred.inspect #=> “#<Fred:0x401b3da8 @a="dog", @b=99, @c="cat">”

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

    Returns:

    -
      - -
    • - - - (Object) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -107
    -108
    -109
    -110
    -111
    -112
    -113
    -114
    -115
    -116
    -117
    -
    -
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 107
    -
    -static mrb_value
    -mrb_obj_ivar_set(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_sym iv_name;
    -  mrb_value val;
    -
    -  mrb_get_args(mrb, "no", &iv_name, &val);
    -  mrb_iv_name_sym_check(mrb, iv_name);
    -  mrb_iv_set(mrb, self, iv_name, val);
    -  return val;
    -}
    -
    -
    - -
    -

    - - #instance_variablesArray - - - - - -

    -
    -

    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) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -568
    -569
    -570
    -571
    -572
    -573
    -574
    -575
    -576
    -577
    -578
    -
    -
    # File 'src/variable.c', line 568
    -
    -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;
    -}
    -
    -
    - -
    -

    - - - #is_a?Boolean - - #kind_of?Boolean - - - - - - -

    -
    -

    Returns true if class is the class of -obj, or if class is one of the superclasses of -obj or modules included in obj.

    - -

    module M; end - class A - include M - end - class B < A; end - class C < B; end - b = B.new - b.instance_of? A #=> false - b.instance_of? B #=> true - b.instance_of? C #=> false - b.instance_of? M #=> false - b.kind_of? A #=> true - b.kind_of? B #=> true - b.kind_of? C #=> false - b.kind_of? M #=> true

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #is_a?Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #kind_of?Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -537
    -538
    -539
    -540
    -541
    -542
    -543
    -544
    -545
    -
    -
    # File 'src/kernel.c', line 537
    -
    -static mrb_value
    -mrb_obj_is_kind_of_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value arg;
    -
    -  mrb_get_args(mrb, "C", &arg);
    -
    -  return mrb_bool_value(mrb_obj_is_kind_of(mrb, self, mrb_class_ptr(arg)));
    -}
    -
    -
    - -
    -

    - - - #block_given?Boolean - - #iterator?Boolean - - - - - - -

    -
    -

    Returns true if yield would execute a -block in the current context. The iterator? form -is mildly deprecated.

    - -

    def try - if block_given? - yield - else - “no block” - end - end - try #=> “no block” - try { “hello” } #=> “hello” - try do “hello” end #=> “hello”

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #block_given?Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #iterator?Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -153
    -154
    -155
    -156
    -157
    -158
    -159
    -160
    -161
    -162
    -163
    -164
    -165
    -166
    -167
    -168
    -169
    -170
    -171
    -172
    -173
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    -
    -
    # File 'src/kernel.c', line 127
    -
    -static mrb_value
    -mrb_f_block_given_p_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_callinfo *ci = &mrb->c->ci[-1];
    -  mrb_callinfo *cibase = mrb->c->cibase;
    -  mrb_value *bp;
    -  struct RProc *p;
    -
    -  if (ci <= cibase) {
    -    /* toplevel does not have block */
    -    return mrb_false_value();
    -  }
    -  p = ci->proc;
    -  /* search method/class/module proc */
    -  while (p) {
    -    if (MRB_PROC_SCOPE_P(p)) break;
    -    p = p->upper;
    -  }
    -  if (p == NULL) return mrb_false_value();
    -  /* search ci corresponding to proc */
    -  while (cibase < ci) {
    -    if (ci->proc == p) break;
    -    ci--;
    -  }
    -  if (ci == cibase) {
    -    return mrb_false_value();
    -  }
    -  else if (ci->env) {
    -    struct REnv *e = ci->env;
    -    int bidx;
    -
    -    /* top-level does not have block slot (always false) */
    -    if (e->stack == mrb->c->stbase)
    -      return mrb_false_value();
    -    /* use saved block arg position */
    -    bidx = MRB_ENV_BIDX(e);
    -    /* bidx may be useless (e.g. define_method) */
    -    if (bidx >= MRB_ENV_STACK_LEN(e))
    -      return mrb_false_value();
    -    bp = &e->stack[bidx];
    -  }
    -  else {
    -    bp = ci[1].stackent+1;
    -    if (ci->argc >= 0) {
    -      bp += ci->argc;
    -    }
    -    else {
    -      bp++;
    -    }
    -  }
    -  if (mrb_nil_p(*bp))
    -    return mrb_false_value();
    -  return mrb_true_value();
    -}
    -
    -
    - -
    -

    - - - #is_a?Boolean - - #kind_of?Boolean - - - - - - -

    -
    -

    Returns true if class is the class of -obj, or if class is one of the superclasses of -obj or modules included in obj.

    - -

    module M; end - class A - include M - end - class B < A; end - class C < B; end - b = B.new - b.instance_of? A #=> false - b.instance_of? B #=> true - b.instance_of? C #=> false - b.instance_of? M #=> false - b.kind_of? A #=> true - b.kind_of? B #=> true - b.kind_of? C #=> false - b.kind_of? M #=> true

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #is_a?Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #kind_of?Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -537
    -538
    -539
    -540
    -541
    -542
    -543
    -544
    -545
    -
    -
    # File 'src/kernel.c', line 537
    -
    -static mrb_value
    -mrb_obj_is_kind_of_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value arg;
    -
    -  mrb_get_args(mrb, "C", &arg);
    -
    -  return mrb_bool_value(mrb_obj_is_kind_of(mrb, self, mrb_class_ptr(arg)));
    -}
    -
    -
    - -
    -

    - - #local_variablesArray - - - - - -

    -
    -

    Returns the names of local variables in the current scope.

    - -

    [mruby limitation] -If variable symbol information was stripped out from -compiled binary files using mruby-strip -l, this -method always returns an empty array.

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 132
    -
    -static mrb_value
    -mrb_local_variables(mrb_state *mrb, mrb_value self)
    -{
    -  struct RProc *proc;
    -  mrb_irep *irep;
    -  mrb_value vars;
    -  size_t i;
    -
    -  proc = mrb->c->ci[-1].proc;
    -
    -  if (MRB_PROC_CFUNC_P(proc)) {
    -    return mrb_ary_new(mrb);
    -  }
    -  vars = mrb_hash_new(mrb);
    -  while (proc) {
    -    if (MRB_PROC_CFUNC_P(proc)) break;
    -    irep = proc->body.irep;
    -    if (!irep->lv) break;
    -    for (i = 0; i + 1 < irep->nlocals; ++i) {
    -      if (irep->lv[i].name) {
    -        mrb_sym sym = irep->lv[i].name;
    -        const char *name = mrb_sym_name(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;
    -    proc = proc->upper;
    -    //if (MRB_PROC_SCOPE_P(proc)) break;
    -    if (!proc->c) break;
    -  }
    -
    -  return mrb_hash_keys(mrb, vars);
    -}
    -
    -
    - -
    -

    - - #loop(&block) ⇒ Object - - - - - -

    -
    -

    Calls the given block repetitively.

    - -

    ISO 15.3.1.3.29

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -
    -
    # File 'mrblib/kernel.rb', line 27
    -
    -def loop(&block)
    -  return to_enum :loop unless block
    -
    -  while true
    -    yield
    -  end
    -rescue StopIteration => e
    -  e.result
    -end
    -
    -
    - -
    -

    - - #methodsArray - - - - - -

    -
    -

    Returns a list of the names of methods publicly accessible in -obj. This will include all the methods accessible in -obj’s ancestors.

    - -

    class Klass - def kMethod() - end - end - k = Klass.new - k.methods[0..9] #=> [:kMethod, :respond_to?, :nil?, :is_a?, - # :class, :instance_variable_set, - # :methods, :extend, :send, :instance_eval] - k.methods.length #=> 42

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -252
    -253
    -254
    -255
    -256
    -257
    -258
    -
    -
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 252
    -
    -static mrb_value
    -mrb_obj_methods_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_bool recur = TRUE;
    -  mrb_get_args(mrb, "|b", &recur);
    -  return mrb_obj_methods(mrb, recur, self, (mrb_method_flag_t)0); /* everything but private */
    -}
    -
    -
    - -
    -

    - - #nil?Boolean - - - - - -

    -
    -

    call_seq: - nil.nil? -> true

    -.nil? -> false - -Only the object nil responds true to nil?. - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -547
    -548
    -549
    -550
    -551
    -552
    -553
    -554
    -555
    -556
    -557
    -558
    -559
    -560
    -561
    -562
    -
    -
    # 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)
    -
    -/* 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)
    -{
    -  return mrb_false_value();
    -}
    -
    -
    - -
    -

    - - #object_idObject - - - - - -

    -
    -

    call-seq: - obj.id -> fixnum - obj.object_id -> fixnum

    - -

    Returns an integer identifier for obj. The same number will -be returned on all calls to id for a given object, and -no two active objects will share an id. -Object#object_id is a different concept from the -:name notation, which returns the symbol id of -name. Replaces the deprecated Object#id.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -97
    -98
    -99
    -100
    -101
    -
    -
    # File 'src/kernel.c', line 97
    -
    -mrb_value
    -mrb_obj_id_m(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_fixnum_value(mrb_obj_id(self));
    -}
    -
    -
    - -
    -

    - - #open(file, *rest, &block) ⇒ Object - - - - - -

    -
    - - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -6
    -7
    -8
    -9
    -10
    -11
    -12
    -13
    -14
    -
    -
    # File 'mrbgems/mruby-io/mrblib/kernel.rb', line 6
    -
    -def open(file, *rest, &block)
    -  raise ArgumentError unless file.is_a?(String)
    -
    -  if file[0] == "|"
    -    IO.popen(file[1..-1], *rest, &block)
    -  else
    -    File.open(file, *rest, &block)
    -  end
    -end
    -
    -
    - -
    -

    - - #p(*args) ⇒ Object - - - - - -

    -
    -

    Print human readable object description

    - -

    ISO 15.3.1.3.34

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -40
    -41
    -42
    -43
    -44
    -45
    -46
    -47
    -48
    -49
    -
    -
    # File 'mrbgems/mruby-print/mrblib/print.rb', line 40
    -
    -def p(*args)
    -  i = 0
    -  len = args.size
    -  while i < len
    -    __printstr__ args[i].inspect
    -    __printstr__ "\n"
    -    i += 1
    -  end
    -  args.__svalue
    -end
    -
    -
    - -
    -
    -
    -

    Invoke method +print+ on STDOUT and passing +*args+

    - -

    ISO 15.3.1.2.10

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -10
    -11
    -12
    -
    -
    # File 'mrbgems/mruby-print/mrblib/print.rb', line 10
    -
    -def print(*args)
    -  $stdout.print(*args)
    -end
    -
    -
    - -
    -

    - - #printf(*args) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -24
    -25
    -26
    -
    -
    # File 'mrbgems/mruby-io/mrblib/kernel.rb', line 24
    -
    -def printf(*args)
    -  $stdout.printf(*args)
    -end
    -
    -
    - -
    -

    - - #private_methods(all = true) ⇒ Array - - - - - -

    -
    -

    Returns the list of private methods accessible to obj. If -the all parameter is set to false, only those methods -in the receiver will be listed.

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -269
    -270
    -271
    -272
    -273
    -274
    -275
    -
    -
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 269
    -
    -static mrb_value
    -mrb_obj_private_methods(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_bool recur = TRUE;
    -  mrb_get_args(mrb, "|b", &recur);
    -  return mrb_obj_methods(mrb, recur, self, NOEX_PRIVATE); /* private attribute not define */
    -}
    -
    -
    - -
    -

    - - #protected_methods(all = true) ⇒ Array - - - - - -

    -
    -

    Returns the list of protected methods accessible to obj. If -the all parameter is set to false, only those methods -in the receiver will be listed.

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -286
    -287
    -288
    -289
    -290
    -291
    -292
    -
    -
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 286
    -
    -static mrb_value
    -mrb_obj_protected_methods(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_bool recur = TRUE;
    -  mrb_get_args(mrb, "|b", &recur);
    -  return mrb_obj_methods(mrb, recur, self, NOEX_PROTECTED); /* protected attribute not define */
    -}
    -
    -
    - -
    -

    - - #public_methods(all = true) ⇒ Array - - - - - -

    -
    -

    Returns the list of public methods accessible to obj. If -the all parameter is set to false, only those methods -in the receiver will be listed.

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -303
    -304
    -305
    -306
    -307
    -308
    -309
    -
    -
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 303
    -
    -static mrb_value
    -mrb_obj_public_methods(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_bool recur = TRUE;
    -  mrb_get_args(mrb, "|b", &recur);
    -  return mrb_obj_methods(mrb, recur, self, NOEX_PUBLIC); /* public attribute not define */
    -}
    -
    -
    - -
    -

    - - #puts(*args) ⇒ Object - - - - - -

    -
    -

    Invoke method +puts+ on STDOUT and passing +args+

    - -

    ISO 15.3.1.2.11

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -23
    -24
    -25
    -
    -
    # File 'mrbgems/mruby-print/mrblib/print.rb', line 23
    -
    -def puts(*args)
    -  $stdout.puts(*args)
    -end
    -
    -
    - -
    -

    - - - #raiseObject - - #raise(string) ⇒ Object - - #raise(exception[, string]) ⇒ Object - - - - - - -

    -
    -

    With no arguments, raises a RuntimeError -With a single +String+ argument, raises a -+RuntimeError+ with the string as a message. Otherwise, -the first parameter should be the name of an +Exception+ -class (or an object that returns an +Exception+ object when sent -an +exception+ message). The optional second parameter sets the -message associated with the exception, and the third parameter is an -array of callback information. Exceptions are caught by the -+rescue+ clause of begin...end blocks.

    - -

    raise “Failed to create socket” - raise ArgumentError, “No parameters”, caller

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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 585
    -
    -MRB_API mrb_value
    -mrb_f_raise(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value a[2], exc;
    -  mrb_int argc;
    -
    -
    -  argc = mrb_get_args(mrb, "|oo", &a[0], &a[1]);
    -  switch (argc) {
    -  case 0:
    -    mrb_raise(mrb, E_RUNTIME_ERROR, "");
    -    break;
    -  case 1:
    -    if (mrb_string_p(a[0])) {
    -      a[1] = a[0];
    -      argc = 2;
    -      a[0] = mrb_obj_value(E_RUNTIME_ERROR);
    -    }
    -    /* fall through */
    -  default:
    -    exc = mrb_make_exception(mrb, argc, a);
    -    mrb_exc_raise(mrb, exc);
    -    break;
    -  }
    -  return mrb_nil_value();            /* not reached */
    -}
    -
    -
    - -
    -

    - - #Rational(numerator, denominator = 1) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -86
    -87
    -88
    -89
    -90
    -91
    -
    -
    # File 'mrbgems/mruby-rational/mrblib/rational.rb', line 86
    -
    -def Rational(numerator, denominator = 1)
    -  a = numerator
    -  b = denominator
    -  a, b = b, a % b until b == 0
    -  Rational._new(numerator.div(a), denominator.div(a))
    -end
    -
    -
    - -
    -

    - - #remove_instance_variable(symbol) ⇒ Object - - - - - -

    -
    -

    Removes the named instance variable from obj, returning that -variable’s value.

    - -

    class Dummy - attr_reader :var - def initialize - @var = 99 - end - def remove - remove_instance_variable(:@var) - end - end - d = Dummy.new - d.var #=> 99 - d.remove #=> 99 - d.var #=> nil

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

    Returns:

    -
      - -
    • - - - (Object) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -634
    -635
    -636
    -637
    -638
    -639
    -640
    -641
    -642
    -643
    -644
    -645
    -646
    -647
    -
    -
    # File 'src/kernel.c', line 634
    -
    -static mrb_value
    -mrb_obj_remove_instance_variable(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_sym sym;
    -  mrb_value val;
    -
    -  mrb_get_args(mrb, "n", &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 %n not defined", sym);
    -  }
    -  return val;
    -}
    -
    -
    - -
    -

    - - #respond_to?(symbol, include_private = false) ⇒ Boolean - - - - - -

    -
    -

    Returns +true+ if obj responds to the given -method. Private methods are included in the search only if the -optional second parameter evaluates to +true+.

    - -

    If the method is not implemented, -as Process.fork on Windows, File.lchmod on GNU/Linux, etc., -false is returned.

    - -

    If the method is not defined, respond_to_missing? -method is called and the result is returned.

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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)
    -{
    -  mrb_sym id, rtm_id;
    -  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] = 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));
    -    }
    -  }
    -  return mrb_bool_value(respond_to_p);
    -}
    -
    -
    - -
    -

    - - - #send(symbol[, args...]) ⇒ Object - - #__send__(symbol[, args...]) ⇒ Object - - - - - - -

    -
    -

    Invokes the method identified by symbol, passing it any -arguments specified. You can use __send__ if the name -+send+ clashes with an existing method in obj.

    - -

    class Klass - def hello(*args) - “Hello “ + args.join(‘ ‘) - end - end - k = Klass.new - k.send :hello, “gentle”, “readers” #=> “Hello gentle readers”

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #send(symbol[, args...]) ⇒ Object -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #__send__(symbol[, args...]) ⇒ Object -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -592
    -593
    -594
    -595
    -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
    -627
    -628
    -629
    -630
    -631
    -632
    -633
    -634
    -635
    -636
    -
    -
    # File 'src/vm.c', line 592
    -
    -mrb_value
    -mrb_f_send(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_sym name;
    -  mrb_value block, *argv, *regs;
    -  mrb_int argc, i, len;
    -  mrb_method_t m;
    -  struct RClass *c;
    -  mrb_callinfo *ci;
    -
    -  mrb_get_args(mrb, "n*&", &name, &argv, &argc, &block);
    -  ci = mrb->c->ci;
    -  if (ci->acc < 0) {
    -  funcall:
    -    return mrb_funcall_with_block(mrb, self, name, argc, argv, block);
    -  }
    -
    -  c = mrb_class(mrb, self);
    -  m = mrb_method_search_vm(mrb, &c, name);
    -  if (MRB_METHOD_UNDEF_P(m)) {            /* call method_mising */
    -    goto funcall;
    -  }
    -
    -  ci->mid = name;
    -  ci->target_class = c;
    -  regs = mrb->c->stack+1;
    -  /* remove first symbol from arguments */
    -  if (ci->argc >= 0) {
    -    for (i=0,len=ci->argc; i<len; i++) {
    -      regs[i] = regs[i+1];
    -    }
    -    ci->argc--;
    -  }
    -  else {                     /* variable length arguments */
    -    mrb_ary_shift(mrb, regs[0]);
    -  }
    -
    -  if (MRB_METHOD_CFUNC_P(m)) {
    -    if (MRB_METHOD_PROC_P(m)) {
    -      ci->proc = MRB_METHOD_PROC(m);
    -    }
    -    return MRB_METHOD_CFUNC(m)(mrb, self);
    -  }
    -  return mrb_exec_irep(mrb, self, MRB_METHOD_PROC(m));
    -}
    -
    -
    - -
    -

    - - #singleton_classObject - - - - - -

    -
    -

    15.3.1.3.28 (15.3.1.2.7)

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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)
    -{
    -  struct RBasic *obj;
    -
    -  switch (mrb_type(v)) {
    -  case MRB_TT_FALSE:
    -    if (mrb_nil_p(v))
    -      return mrb_obj_value(mrb->nil_class);
    -    return mrb_obj_value(mrb->false_class);
    -  case MRB_TT_TRUE:
    -    return mrb_obj_value(mrb->true_class);
    -  case MRB_TT_CPTR:
    -    return mrb_obj_value(mrb->object_class);
    -  case MRB_TT_SYMBOL:
    -  case MRB_TT_FIXNUM:
    -#ifndef MRB_WITHOUT_FLOAT
    -  case MRB_TT_FLOAT:
    -#endif
    -    mrb_raise(mrb, E_TYPE_ERROR, "can't define singleton");
    -    return mrb_nil_value();    /* not reached */
    -  default:
    -    break;
    -  }
    -  obj = mrb_basic_ptr(v);
    -  prepare_singleton_class(mrb, obj);
    -  return mrb_obj_value(obj->c);
    -}
    -
    -
    - -
    -

    - - #singleton_method(name) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    -
    -
    # File 'mrbgems/mruby-method/mrblib/kernel.rb', line 2
    -
    -def singleton_method(name)
    -  m = method(name)
    -  sc = (class <<self; self; end)
    -  if m.owner != sc
    -    raise NameError, "undefined method '#{name}' for class '#{sc}'"
    -  end
    -  m
    -end
    -
    -
    - -
    -

    - - #singleton_methods(all = true) ⇒ Array - - - - - -

    -
    -

    Returns an array of the names of singleton methods for obj. -If the optional all parameter is true, the list will include -methods in modules included in obj. -Only public and protected singleton methods are returned.

    - -

    module Other - def three() end - end

    - -

    class Single - def Single.four() end - end

    - -

    a = Single.new

    - -

    def a.one() - end

    - -

    class « a - include Other - def two() - end - end

    - -

    Single.singleton_methods #=> [:four] - a.singleton_methods(false) #=> [:two, :one] - a.singleton_methods #=> [:two, :one, :three]

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -376
    -377
    -378
    -379
    -380
    -381
    -382
    -
    -
    # File 'mrbgems/mruby-metaprog/src/metaprog.c', line 376
    -
    -static mrb_value
    -mrb_obj_singleton_methods_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_bool recur = TRUE;
    -  mrb_get_args(mrb, "|b", &recur);
    -  return mrb_obj_singleton_methods(mrb, recur, self);
    -}
    -
    -
    - -
    -

    - - #sprintfObject - - - - - -

    -
    -

    in sprintf.c

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -9
    -
    -
    # File 'mrbgems/mruby-sprintf/src/kernel.c', line 9
    -
    -mrb_value mrb_f_sprintf(mrb_state *mrb, mrb_value obj);
    -
    -
    - -
    -

    - - #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 - - - - Also known as: - enum_for - - - - -

    -
    -

    call-seq: - 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.

    - -

    === Examples

    - -

    str = “xyz”

    - -

    enum = str.enum_for(:each_byte) - enum.each { |b| puts b } - # => 120 - # => 121 - # => 122

    - -

    # protect an array from being modified by some_method - a = [1, 2, 3] - some_method(a.to_enum)

    - -

    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:

    - -
    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) # __method__ is :repeat here
    -    end
    -    each do |*val|
    -      n.times { yield *val }
    -    end
    -  end
    -end
    -
    -%i[hello world].repeat(2) { |w| puts w }
    -  # => Prints 'hello', 'hello', 'world', 'world'
    -enum = (1..14).repeat(3)
    -  # => returns an Enumerator when called without a block
    -enum.first(4) # => [1, 1, 1, 2]
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -647
    -648
    -649
    -
    -
    # File 'mrbgems/mruby-enumerator/mrblib/enumerator.rb', line 647
    -
    -def to_enum(*a)
    -  raise NotImplementedError.new("fiber required for enumerator")
    -end
    -
    -
    - -
    -

    - - #to_sObject - - - - - -

    -
    -

    15.3.1.3.46

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

    - - #yield_self(&block) ⇒ Object - - - - Also known as: - then - - - - -

    -
    -

    call-seq: - obj.yield_self {|_obj|…} -> an_object - obj.then {|_obj|…} -> an_object

    - -

    Yields obj and returns the result.

    - - - - - - - - -
    ‘my string’.yield_self ss.upcase #=> “MY STRING”
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -10
    -11
    -12
    -13
    -
    -
    # File 'mrbgems/mruby-object-ext/mrblib/object.rb', line 10
    -
    -def yield_self(&block)
    -  return to_enum :yield_self unless block
    -  block.call(self)
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/KeyError.html b/docs/api/KeyError.html deleted file mode 100644 index cf9d964..0000000 --- a/docs/api/KeyError.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - Exception: KeyError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: KeyError - - - -

    -
    - -
    -
    Inherits:
    -
    - IndexError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/10error.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/LocalJumpError.html b/docs/api/LocalJumpError.html deleted file mode 100644 index b9f1f44..0000000 --- a/docs/api/LocalJumpError.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - Exception: LocalJumpError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: LocalJumpError - - - -

    -
    - -
    -
    Inherits:
    -
    - ScriptError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/10error.rb
    -
    - -
    - -

    Overview

    -
    -

    ISO 15.2.25 says “LocalJumpError < StandardError”

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

    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/Math.html b/docs/api/Math.html deleted file mode 100644 index e44bfdb..0000000 --- a/docs/api/Math.html +++ /dev/null @@ -1,2868 +0,0 @@ - - - - - - - Module: Math - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Module: Math - - - -

    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-math/src/math.c
    -
    - -
    - - - - - - - - - -

    - Class Method Summary - collapse -

    - -
      - -
    • - - - .acos(x) ⇒ Float - - - - - - - - - - - - - -

      Computes the arc cosine of x.

      -
      - -
    • - - -
    • - - - .acosh(x) ⇒ Float - - - - - - - - - - - - - -

      Computes the inverse hyperbolic cosine of x.

      -
      - -
    • - - -
    • - - - .asin(x) ⇒ Float - - - - - - - - - - - - - -

      Computes the arc sine of x.

      -
      - -
    • - - -
    • - - - .asinh(x) ⇒ Float - - - - - - - - - - - - - -

      Computes the inverse hyperbolic sine of x.

      -
      - -
    • - - -
    • - - - .atan(x) ⇒ Float - - - - - - - - - - - - - -

      Computes the arc tangent of x.

      -
      - -
    • - - -
    • - - - .atan2(y, x) ⇒ Float - - - - - - - - - - - - - -

      Computes the arc tangent given y and x.

      -
      - -
    • - - -
    • - - - .atanh(x) ⇒ Float - - - - - - - - - - - - - -

      Computes the inverse hyperbolic tangent of x.

      -
      - -
    • - - -
    • - - - .cbrt(numeric) ⇒ Float - - - - - - - - - - - - - -

      Returns the cube root of numeric.

      -
      - -
    • - - -
    • - - - .cos(x) ⇒ Float - - - - - - - - - - - - - -

      Computes the cosine of x (expressed in radians).

      -
      - -
    • - - -
    • - - - .cosh(x) ⇒ Float - - - - - - - - - - - - - -

      Computes the hyperbolic cosine of x (expressed in radians).

      -
      - -
    • - - -
    • - - - .erf(x) ⇒ Float - - - - - - - - - - - - - -

      Calculates the error function of x.

      -
      - -
    • - - -
    • - - - .erfc(x) ⇒ Float - - - - - - - - - - - - - -

      Calculates the complementary error function of x.

      -
      - -
    • - - -
    • - - - .exp(x) ⇒ Float - - - - - - - - - - - - - -

      Returns e**x.

      -
      - -
    • - - -
    • - - - .frexp(numeric) ⇒ Array - - - - - - - - - - - - - -

      Returns a two-element array containing the normalized fraction (a Float) and exponent (a Fixnum) of numeric.

      -
      - -
    • - - -
    • - - - .hypot(x, y) ⇒ Float - - - - - - - - - - - - - -

      Returns sqrt(x2 + y2), the hypotenuse of a right-angled triangle with sides x and y.

      -
      - -
    • - - -
    • - - - .ldexp(flt, int) ⇒ Float - - - - - - - - - - - - - -

      Returns the value of flt*(2**int).

      -
      - -
    • - - -
    • - - - .log ⇒ Object - - - - - - - - - - - - - -

      Returns the natural logarithm of numeric.

      -
      - -
    • - - -
    • - - - .log10(numeric) ⇒ Float - - - - - - - - - - - - - -

      Returns the base 10 logarithm of numeric.

      -
      - -
    • - - -
    • - - - .log2(numeric) ⇒ Float - - - - - - - - - - - - - -

      Returns the base 2 logarithm of numeric.

      -
      - -
    • - - -
    • - - - .sin(x) ⇒ Float - - - - - - - - - - - - - -

      Computes the sine of x (expressed in radians).

      -
      - -
    • - - -
    • - - - .sinh(x) ⇒ Float - - - - - - - - - - - - - -

      Computes the hyperbolic sine of x (expressed in radians).

      -
      - -
    • - - -
    • - - - .sqrt(numeric) ⇒ Float - - - - - - - - - - - - - -

      Returns the square root of numeric.

      -
      - -
    • - - -
    • - - - .tan(x) ⇒ Float - - - - - - - - - - - - - -

      Returns the tangent of x (expressed in radians).

      -
      - -
    • - - -
    • - - - .tanh ⇒ Float - - - - - - - - - - - - - -

      Computes the hyperbolic tangent of x (expressed in radians).

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

    Class Method Details

    - - -
    -

    - - .acos(x) ⇒ Float - - - - - -

    -
    -

    Computes the arc cosine of x. Returns 0..PI.

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -268
    -269
    -270
    -271
    -272
    -273
    -274
    -275
    -276
    -277
    -278
    -279
    -280
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 268
    -
    -static mrb_value
    -math_acos(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  if (x < -1.0 || x > 1.0) {
    -    domain_error(mrb, "acos");
    -  }
    -  x = acos(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .acosh(x) ⇒ Float - - - - - -

    -
    -

    Computes the inverse hyperbolic cosine of x.

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -416
    -417
    -418
    -419
    -420
    -421
    -422
    -423
    -424
    -425
    -426
    -427
    -428
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 416
    -
    -static mrb_value
    -math_acosh(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  if (x < 1.0) {
    -    domain_error(mrb, "acosh");
    -  }
    -  x = acosh(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .asin(x) ⇒ Float - - - - - -

    -
    -

    Computes the arc sine of x.

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - -

    Returns:

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

      computed value between -(PI/2) and (PI/2).

      -
      - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -248
    -249
    -250
    -251
    -252
    -253
    -254
    -255
    -256
    -257
    -258
    -259
    -260
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 248
    -
    -static mrb_value
    -math_asin(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  if (x < -1.0 || x > 1.0) {
    -    domain_error(mrb, "asin");
    -  }
    -  x = asin(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .asinh(x) ⇒ Float - - - - - -

    -
    -

    Computes the inverse hyperbolic sine of x.

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -398
    -399
    -400
    -401
    -402
    -403
    -404
    -405
    -406
    -407
    -408
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 398
    -
    -static mrb_value
    -math_asinh(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -
    -  x = asinh(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .atan(x) ⇒ Float - - - - - -

    -
    -

    Computes the arc tangent of x. Returns -(PI/2) .. (PI/2).

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -288
    -289
    -290
    -291
    -292
    -293
    -294
    -295
    -296
    -297
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 288
    -
    -static mrb_value
    -math_atan(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  x = atan(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .atan2(y, x) ⇒ Float - - - - - -

    -
    -

    Computes the arc tangent given y and x. Returns --PI..PI.

    - -

    Math.atan2(-0.0, -1.0) #=> -3.141592653589793 - Math.atan2(-1.0, -1.0) #=> -2.356194490192345 - Math.atan2(-1.0, 0.0) #=> -1.5707963267948966 - Math.atan2(-1.0, 1.0) #=> -0.7853981633974483 - Math.atan2(-0.0, 1.0) #=> -0.0 - Math.atan2(0.0, 1.0) #=> 0.0 - Math.atan2(1.0, 1.0) #=> 0.7853981633974483 - Math.atan2(1.0, 0.0) #=> 1.5707963267948966 - Math.atan2(1.0, -1.0) #=> 2.356194490192345 - Math.atan2(0.0, -1.0) #=> 3.141592653589793

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -318
    -319
    -320
    -321
    -322
    -323
    -324
    -325
    -326
    -327
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 318
    -
    -static mrb_value
    -math_atan2(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x, y;
    -
    -  mrb_get_args(mrb, "ff", &x, &y);
    -  x = atan2(x, y);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .atanh(x) ⇒ Float - - - - - -

    -
    -

    Computes the inverse hyperbolic tangent of x.

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -436
    -437
    -438
    -439
    -440
    -441
    -442
    -443
    -444
    -445
    -446
    -447
    -448
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 436
    -
    -static mrb_value
    -math_atanh(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  if (x < -1.0 || x > 1.0) {
    -    domain_error(mrb, "atanh");
    -  }
    -  x = atanh(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .cbrt(numeric) ⇒ Float - - - - - -

    -
    -

    Returns the cube root of numeric.

    - -

    -9.upto(9) {|x| - p [x, Math.cbrt(x), Math.cbrt(x)**3] - } - #=> - [-9, -2.0800838230519, -9.0] - [-8, -2.0, -8.0] - [-7, -1.91293118277239, -7.0] - [-6, -1.81712059283214, -6.0] - [-5, -1.7099759466767, -5.0] - [-4, -1.5874010519682, -4.0] - [-3, -1.44224957030741, -3.0] - [-2, -1.25992104989487, -2.0] - [-1, -1.0, -1.0] - [0, 0.0, 0.0] - [1, 1.0, 1.0] - [2, 1.25992104989487, 2.0] - [3, 1.44224957030741, 3.0] - [4, 1.5874010519682, 4.0] - [5, 1.7099759466767, 5.0] - [6, 1.81712059283214, 6.0] - [7, 1.91293118277239, 7.0] - [8, 2.0, 8.0] - [9, 2.0800838230519, 9.0]

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -615
    -616
    -617
    -618
    -619
    -620
    -621
    -622
    -623
    -624
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 615
    -
    -static mrb_value
    -math_cbrt(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  x = cbrt(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .cos(x) ⇒ Float - - - - - -

    -
    -

    Computes the cosine of x (expressed in radians). Returns --1..1.

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -209
    -210
    -211
    -212
    -213
    -214
    -215
    -216
    -217
    -218
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 209
    -
    -static mrb_value
    -math_cos(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  x = cos(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .cosh(x) ⇒ Float - - - - - -

    -
    -

    Computes the hyperbolic cosine of x (expressed in radians).

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -358
    -359
    -360
    -361
    -362
    -363
    -364
    -365
    -366
    -367
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 358
    -
    -static mrb_value
    -math_cosh(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  x = cosh(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .erf(x) ⇒ Float - - - - - -

    -
    -

    Calculates the error function of x.

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -697
    -698
    -699
    -700
    -701
    -702
    -703
    -704
    -705
    -706
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 697
    -
    -static mrb_value
    -math_erf(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  x = erf(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .erfc(x) ⇒ Float - - - - - -

    -
    -

    Calculates the complementary error function of x.

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -715
    -716
    -717
    -718
    -719
    -720
    -721
    -722
    -723
    -724
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 715
    -
    -static mrb_value
    -math_erfc(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  x = erfc(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .exp(x) ⇒ Float - - - - - -

    -
    -

    Returns e**x.

    - -

    Math.exp(0) #=> 1.0 - Math.exp(1) #=> 2.718281828459045 - Math.exp(1.5) #=> 4.4816890703380645

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -465
    -466
    -467
    -468
    -469
    -470
    -471
    -472
    -473
    -474
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 465
    -
    -static mrb_value
    -math_exp(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  x = exp(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .frexp(numeric) ⇒ Array - - - - - -

    -
    -

    Returns a two-element array containing the normalized fraction (a -Float) and exponent (a Fixnum) of -numeric.

    - -

    fraction, exponent = Math.frexp(1234) #=> [0.6025390625, 11] - fraction * 2**exponent #=> 1234.0

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -638
    -639
    -640
    -641
    -642
    -643
    -644
    -645
    -646
    -647
    -648
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 638
    -
    -static mrb_value
    -math_frexp(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -  int exp;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  x = frexp(x, &exp);
    -
    -  return mrb_assoc_new(mrb, mrb_float_value(mrb, x), mrb_fixnum_value(exp));
    -}
    -
    -
    - -
    -

    - - .hypot(x, y) ⇒ Float - - - - - -

    -
    -

    Returns sqrt(x2 + y2), the hypotenuse of a right-angled triangle -with sides x and y.

    - -

    Math.hypot(3, 4) #=> 5.0

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -680
    -681
    -682
    -683
    -684
    -685
    -686
    -687
    -688
    -689
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 680
    -
    -static mrb_value
    -math_hypot(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x, y;
    -
    -  mrb_get_args(mrb, "ff", &x, &y);
    -  x = hypot(x, y);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .ldexp(flt, int) ⇒ Float - - - - - -

    -
    -

    Returns the value of flt*(2**int).

    - -

    fraction, exponent = Math.frexp(1234) - Math.ldexp(fraction, exponent) #=> 1234.0

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -659
    -660
    -661
    -662
    -663
    -664
    -665
    -666
    -667
    -668
    -669
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 659
    -
    -static mrb_value
    -math_ldexp(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -  mrb_int   i;
    -
    -  mrb_get_args(mrb, "fi", &x, &i);
    -  x = ldexp(x, (int)i);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - - .log(numeric) ⇒ Float - - .log(num, base) ⇒ Float - - - - - - -

    -
    -

    Returns the natural logarithm of numeric. -If additional second argument is given, it will be the base -of logarithm.

    - -

    Math.log(1) #=> 0.0 - Math.log(Math::E) #=> 1.0 - Math.log(Math::E**3) #=> 3.0 - Math.log(12,3) #=> 2.2618595071429146

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - .log(numeric) ⇒ Float -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Float) - - - -
      • - -
      - -
      - - -
    • - - -
    • - .log(num, base) ⇒ Float -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Float) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -491
    -492
    -493
    -494
    -495
    -496
    -497
    -498
    -499
    -500
    -501
    -502
    -503
    -504
    -505
    -506
    -507
    -508
    -509
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 491
    -
    -static mrb_value
    -math_log(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x, base;
    -  mrb_int argc;
    -
    -  argc = mrb_get_args(mrb, "f|f", &x, &base);
    -  if (x < 0.0) {
    -    domain_error(mrb, "log");
    -  }
    -  x = log(x);
    -  if (argc == 2) {
    -    if (base < 0.0) {
    -      domain_error(mrb, "log");
    -    }
    -    x /= log(base);
    -  }
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .log10(numeric) ⇒ Float - - - - - -

    -
    -

    Returns the base 10 logarithm of numeric.

    - -

    Math.log10(1) #=> 0.0 - Math.log10(10) #=> 1.0 - Math.log10(10**100) #=> 100.0

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -548
    -549
    -550
    -551
    -552
    -553
    -554
    -555
    -556
    -557
    -558
    -559
    -560
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 548
    -
    -static mrb_value
    -math_log10(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  if (x < 0.0) {
    -    domain_error(mrb, "log10");
    -  }
    -  x = log10(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .log2(numeric) ⇒ Float - - - - - -

    -
    -

    Returns the base 2 logarithm of numeric.

    - -

    Math.log2(1) #=> 0.0 - Math.log2(2) #=> 1.0 - Math.log2(32768) #=> 15.0 - Math.log2(65536) #=> 16.0

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -523
    -524
    -525
    -526
    -527
    -528
    -529
    -530
    -531
    -532
    -533
    -534
    -535
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 523
    -
    -static mrb_value
    -math_log2(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  if (x < 0.0) {
    -    domain_error(mrb, "log2");
    -  }
    -  x = log2(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .sin(x) ⇒ Float - - - - - -

    -
    -

    Computes the sine of x (expressed in radians). Returns --1..1.

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -191
    -192
    -193
    -194
    -195
    -196
    -197
    -198
    -199
    -200
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 191
    -
    -static mrb_value
    -math_sin(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  x = sin(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .sinh(x) ⇒ Float - - - - - -

    -
    -

    Computes the hyperbolic sine of x (expressed in -radians).

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -341
    -342
    -343
    -344
    -345
    -346
    -347
    -348
    -349
    -350
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 341
    -
    -static mrb_value
    -math_sinh(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  x = sinh(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .sqrt(numeric) ⇒ Float - - - - - -

    -
    -

    Returns the square root of numeric.

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -569
    -570
    -571
    -572
    -573
    -574
    -575
    -576
    -577
    -578
    -579
    -580
    -581
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 569
    -
    -static mrb_value
    -math_sqrt(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  if (x < 0.0) {
    -    domain_error(mrb, "sqrt");
    -  }
    -  x = sqrt(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .tan(x) ⇒ Float - - - - - -

    -
    -

    Returns the tangent of x (expressed in radians).

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -226
    -227
    -228
    -229
    -230
    -231
    -232
    -233
    -234
    -235
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 226
    -
    -static mrb_value
    -math_tan(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  x = tan(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    -

    - - .tanhFloat - - - - - -

    -
    -

    Computes the hyperbolic tangent of x (expressed in -radians).

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -376
    -377
    -378
    -379
    -380
    -381
    -382
    -383
    -384
    -385
    -
    -
    # File 'mrbgems/mruby-math/src/math.c', line 376
    -
    -static mrb_value
    -math_tanh(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_float x;
    -
    -  mrb_get_args(mrb, "f", &x);
    -  x = tanh(x);
    -
    -  return mrb_float_value(mrb, x);
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Method.html b/docs/api/Method.html deleted file mode 100644 index 916e4e2..0000000 --- a/docs/api/Method.html +++ /dev/null @@ -1,1618 +0,0 @@ - - - - - - - Class: Method - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Method - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-method/src/method.c,
    - mrbgems/mruby-method/mrblib/method.rb
    -
    -
    - -
    - - - - - - - - - -

    - Instance Method Summary - collapse -

    - - - - - - -
    -

    Instance Method Details

    - - -
    -

    - - #<<(other) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -9
    -10
    -11
    -
    -
    # File 'mrbgems/mruby-method/mrblib/method.rb', line 9
    -
    -def <<(other)
    -  ->(*args, &block) { call(other.call(*args, &block)) }
    -end
    -
    -
    - -
    -

    - - #==Object - - - - - -

    - - - - -
    -
    -
    -
    -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();
    -}
    -
    -
    - -
    -

    - - #>>(other) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -13
    -14
    -15
    -
    -
    # File 'mrbgems/mruby-method/mrblib/method.rb', line 13
    -
    -def >>(other)
    -  ->(*args, &block) { other.call(call(*args, &block)) }
    -end
    -
    -
    - -
    -

    - - #[]Object - - - - - -

    - - - - -
    -
    -
    -
    -138
    -139
    -140
    -141
    -142
    -143
    -144
    -145
    -146
    -147
    -148
    -149
    -150
    -
    -
    # 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_int argc;
    -  mrb_value *argv, block;
    -
    -  mrb_get_args(mrb, "*&", &argv, &argc, &block);
    -  return mcall(mrb, recv, proc, name, owner, argc, argv, block);
    -}
    -
    -
    - -
    -

    - - #arityObject - - - - - -

    - - - - -
    -
    -
    -
    -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);
    -}
    -
    -
    - -
    -

    - - #callObject - - - - - -

    - - - - -
    -
    -
    -
    -138
    -139
    -140
    -141
    -142
    -143
    -144
    -145
    -146
    -147
    -148
    -149
    -150
    -
    -
    # 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_int argc;
    -  mrb_value *argv, block;
    -
    -  mrb_get_args(mrb, "*&", &argv, &argc, &block);
    -  return mcall(mrb, recv, proc, name, 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 - - - - - -

    - - - - -
    -
    -
    -
    -287
    -288
    -289
    -290
    -291
    -292
    -293
    -294
    -295
    -296
    -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 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 str = mrb_str_new_lit(mrb, "#<");
    -  struct RClass *rklass;
    -
    -  mrb_str_cat_cstr(mrb, str, mrb_obj_classname(mrb, self));
    -  mrb_str_cat_lit(mrb, str, ": ");
    -  rklass = mrb_class_ptr(klass);
    -  if (mrb_class_ptr(owner) == rklass) {
    -    mrb_str_concat(mrb, str, owner);
    -    mrb_str_cat_lit(mrb, str, "#");
    -    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_concat(mrb, str, owner);
    -    mrb_str_cat_lit(mrb, str, ")#");
    -    mrb_str_concat(mrb, str, name);
    -  }
    -  mrb_str_cat_lit(mrb, str, ">");
    -  return str;
    -}
    -
    -
    - -
    -

    - - #nameObject - - - - - -

    - - - - -
    -
    -
    -
    -401
    -402
    -403
    -404
    -405
    -
    -
    # File 'mrbgems/mruby-method/src/method.c', line 401
    -
    -static mrb_value
    -method_name(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name"));
    -}
    -
    -
    - -
    -

    - - #ownerObject - - - - - -

    - - - - -
    -
    -
    -
    -389
    -390
    -391
    -392
    -393
    -
    -
    # File 'mrbgems/mruby-method/src/method.c', line 389
    -
    -static mrb_value
    -method_owner(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner"));
    -}
    -
    -
    - -
    -

    - - #parametersObject - - - - - -

    - - - - -
    -
    -
    -
    -265
    -266
    -267
    -268
    -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 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"));
    -  struct RProc *rproc;
    -  struct RClass *orig;
    -  mrb_value ret;
    -
    -  if (mrb_nil_p(proc)) {
    -    mrb_value rest = mrb_symbol_value(mrb_intern_lit(mrb, "rest"));
    -    mrb_value arest = mrb_ary_new_from_values(mrb, 1, &rest);
    -    return mrb_ary_new_from_values(mrb, 1, &arest);
    -  }
    -
    -  rproc = mrb_proc_ptr(proc);
    -  orig = rproc->c;
    -  rproc->c = mrb->proc_class;
    -  ret = mrb_funcall(mrb, proc, "parameters", 0);
    -  rproc->c = orig;
    -  return ret;
    -}
    -
    -
    - -
    -

    - - #receiverObject - - - - - -

    - - - - -
    -
    -
    -
    -395
    -396
    -397
    -398
    -399
    -
    -
    # File 'mrbgems/mruby-method/src/method.c', line 395
    -
    -static mrb_value
    -method_receiver(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_recv"));
    -}
    -
    -
    - -
    -

    - - #source_locationObject - - - - - -

    - - - - -
    -
    -
    -
    -246
    -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 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"));
    -  struct RProc *rproc;
    -  struct RClass *orig;
    -  mrb_value ret;
    -
    -  if (mrb_nil_p(proc))
    -    return mrb_nil_value();
    -
    -  rproc = mrb_proc_ptr(proc);
    -  orig = rproc->c;
    -  rproc->c = mrb->proc_class;
    -  ret = mrb_funcall(mrb, proc, "source_location", 0);
    -  rproc->c = orig;
    -  return ret;
    -}
    -
    -
    - -
    -

    - - #super_methodObject - - - - - -

    - - - - -
    -
    -
    -
    -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
    -
    -
    # 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"));
    -  struct RClass *super, *rklass;
    -  struct RProc *proc;
    -  struct RObject *me;
    -
    -  switch (mrb_type(klass)) {
    -    case MRB_TT_SCLASS:
    -      super = mrb_class_ptr(klass)->super->super;
    -      break;
    -    case MRB_TT_ICLASS:
    -      super = mrb_class_ptr(klass)->super;
    -      break;
    -    default:
    -      super = mrb_class_ptr(owner)->super;
    -      break;
    -  }
    -
    -  proc = method_search_vm(mrb, &super, mrb_symbol(name));
    -  if (!proc)
    -    return mrb_nil_value();
    -
    -  rklass = super;
    -  while (super->tt == MRB_TT_ICLASS)
    -    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));
    -
    -  return mrb_obj_value(me);
    -}
    -
    -
    - -
    -

    - - #to_procObject - - - - - -

    - - - - -
    -
    -
    -
    -2
    -3
    -4
    -5
    -6
    -7
    -
    -
    # File 'mrbgems/mruby-method/mrblib/method.rb', line 2
    -
    -def to_proc
    -  m = self
    -  lambda { |*args, &b|
    -    m.call(*args, &b)
    -  }
    -end
    -
    -
    - -
    -

    - - #to_sObject - - - - - -

    - - - - -
    -
    -
    -
    -287
    -288
    -289
    -290
    -291
    -292
    -293
    -294
    -295
    -296
    -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 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 str = mrb_str_new_lit(mrb, "#<");
    -  struct RClass *rklass;
    -
    -  mrb_str_cat_cstr(mrb, str, mrb_obj_classname(mrb, self));
    -  mrb_str_cat_lit(mrb, str, ": ");
    -  rklass = mrb_class_ptr(klass);
    -  if (mrb_class_ptr(owner) == rklass) {
    -    mrb_str_concat(mrb, str, owner);
    -    mrb_str_cat_lit(mrb, str, "#");
    -    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_concat(mrb, str, owner);
    -    mrb_str_cat_lit(mrb, str, ")#");
    -    mrb_str_concat(mrb, str, name);
    -  }
    -  mrb_str_cat_lit(mrb, str, ">");
    -  return str;
    -}
    -
    -
    - -
    -

    - - #unbindObject - - - - - -

    - - - - -
    -
    -
    -
    -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 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"));
    -
    -  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);
    -
    -  return mrb_obj_value(ume);
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Module.html b/docs/api/Module.html deleted file mode 100644 index 914cf08..0000000 --- a/docs/api/Module.html +++ /dev/null @@ -1,768 +0,0 @@ - - - - - - - Class: Module - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Module - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/00class.rb,
    - mrbgems/mruby-class-ext/mrblib/module.rb
    -
    -
    - -
    - - - - - - - - - -

    - Instance Method Summary - collapse -

    - - - - - - -
    -

    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 - - - - - -

    -
    -

    15.2.2.4.12

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -3
    -4
    -5
    -6
    -
    -
    # File 'mrblib/00class.rb', line 3
    -
    -def attr_accessor(*names)
    -  attr_reader(*names)
    -  attr_writer(*names)
    -end
    -
    -
    - -
    -

    - - #include(*args) ⇒ Object - - - - - -

    -
    -

    15.2.2.4.27

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -
    -
    # File 'mrblib/00class.rb', line 14
    -
    -def include(*args)
    -  args.reverse.each do |m|
    -    m.append_features(self)
    -    m.included(self)
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #prepend(*args) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -
    -
    # File 'mrblib/00class.rb', line 22
    -
    -def prepend(*args)
    -  args.reverse.each do |m|
    -    m.prepend_features(self)
    -    m.prepended(self)
    -  end
    -  self
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/NameError.html b/docs/api/NameError.html deleted file mode 100644 index d7ae47f..0000000 --- a/docs/api/NameError.html +++ /dev/null @@ -1,326 +0,0 @@ - - - - - - - Exception: NameError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: NameError - - - -

    -
    - -
    -
    Inherits:
    -
    - StandardError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/10error.rb
    -
    - -
    - -

    Overview

    -
    -

    ISO 15.2.31

    - - -
    -
    -
    - - -
    - -
    -

    Direct Known Subclasses

    -

    NoMethodError

    -
    - - - - -

    Instance Attribute Summary collapse

    -
      - -
    • - - - #name ⇒ Object - - - - - - - - - - - - - - - - -

      Returns the value of attribute name.

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

    - Instance Method Summary - collapse -

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

    Methods inherited from Exception

    -

    #backtrace, #exception, #inspect, #message, #set_backtrace, #to_s

    -
    -

    Constructor Details

    - -
    -

    - - #initialize(message = nil, name = nil) ⇒ NameError - - - - - -

    -
    -

    Returns a new instance of NameError

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -28
    -29
    -30
    -31
    -
    -
    # File 'mrblib/10error.rb', line 28
    -
    -def initialize(message=nil, name=nil)
    -  @name = name
    -  super(message)
    -end
    -
    -
    - -
    - -
    -

    Instance Attribute Details

    - - - -
    -

    - - #nameObject - - - - - -

    -
    -

    Returns the value of attribute name

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -26
    -27
    -28
    -
    -
    # File 'mrblib/10error.rb', line 26
    -
    -def name
    -  @name
    -end
    -
    -
    - -
    - - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/NilClass.html b/docs/api/NilClass.html deleted file mode 100644 index 3e378b4..0000000 --- a/docs/api/NilClass.html +++ /dev/null @@ -1,1163 +0,0 @@ - - - - - - - Class: NilClass - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: NilClass - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    src/object.c
    -
    - -
    - - - - - - - - - -

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #& ⇒ Object - - - - - - - - - - - - - -

      And—Returns false.

      -
      - -
    • - - -
    • - - - #^ ⇒ Object - - - - - - - - - - - - - -

      Exclusive Or—If obj is nil or false, returns false; otherwise, returns true.

      -
      - -
    • - - -
    • - - - #inspect ⇒ Object - - - - - - - - - - - - - -

      15.2.4.3.5.

      -
      - -
    • - - -
    • - - - #nil? ⇒ Boolean - - - - - - - - - - - - - -

      call_seq: nil.nil? -> true.

      -
      - -
    • - - -
    • - - - #to_a ⇒ Array - - - - - - - - - - - - - -

      Always returns an empty array.

      -
      - -
    • - - -
    • - - - #to_f ⇒ 0.0 - - - - - - - - - - - - - -

      Always returns zero.

      -
      - -
    • - - -
    • - - - #to_h ⇒ Object - - - - - - - - - - - - - -

      Always returns an empty hash.

      -
      - -
    • - - -
    • - - - #to_i ⇒ 0 - - - - - - - - - - - - - -

      Always returns zero.

      -
      - -
    • - - -
    • - - - #to_s ⇒ Object - - - - - - - - - - - - - -

      Always returns the empty string.

      -
      - -
    • - - -
    • - - - #| ⇒ Object - - - - - - - - - - - - - -

      Or—Returns false if obj is nil or false; true otherwise.

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

    Instance Method Details

    - - -
    -

    - - - #&(obj) ⇒ false - - #&(obj) ⇒ false - - - - - - -

    -
    -

    And—Returns false. obj is always -evaluated as it is the argument to a method call—there is no -short-circuit evaluation in this case.

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #&(obj) ⇒ false -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (false) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #&(obj) ⇒ false -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (false) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -201
    -202
    -203
    -204
    -205
    -
    -
    # File 'src/object.c', line 201
    -
    -static mrb_value
    -false_and(mrb_state *mrb, mrb_value obj)
    -{
    -  return mrb_false_value();
    -}
    -
    -
    - -
    -

    - - - #^(obj) ⇒ Boolean - - #^(obj) ⇒ Boolean - - - - - - -

    -
    -

    Exclusive Or—If obj is nil or -false, returns false; otherwise, returns -true.

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #^(obj) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #^(obj) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -220
    -221
    -222
    -223
    -224
    -225
    -226
    -227
    -
    -
    # File 'src/object.c', line 220
    -
    -static mrb_value
    -false_xor(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_bool obj2;
    -
    -  mrb_get_args(mrb, "b", &obj2);
    -  return mrb_bool_value(obj2);
    -}
    -
    -
    - -
    -

    - - #inspectObject - - - - - -

    -
    -

    15.2.4.3.5

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -89
    -90
    -91
    -92
    -93
    -
    -
    # File 'src/object.c', line 89
    -
    -static mrb_value
    -nil_inspect(mrb_state *mrb, mrb_value obj)
    -{
    -  return mrb_str_new_lit_frozen(mrb, "nil");
    -}
    -
    -
    - -
    -

    - - #nil?Boolean - - - - - -

    -
    -

    call_seq: - nil.nil? -> true

    - -

    Only the object nil responds true to nil?.

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -69
    -70
    -71
    -72
    -73
    -
    -
    # File 'src/object.c', line 69
    -
    -static mrb_value
    -mrb_true(mrb_state *mrb, mrb_value obj)
    -{
    -  return mrb_true_value();
    -}
    -
    -
    - -
    -

    - - #to_aArray - - - - - -

    -
    -

    Always returns an empty array.

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -14
    -15
    -16
    -17
    -18
    -
    -
    # File 'mrbgems/mruby-object-ext/src/object.c', line 14
    -
    -static mrb_value
    -nil_to_a(mrb_state *mrb, mrb_value obj)
    -{
    -  return mrb_ary_new(mrb);
    -}
    -
    -
    - -
    -

    - - #to_f0.0 - - - - - -

    -
    -

    Always returns zero.

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

    Returns:

    -
      - -
    • - - - (0.0) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -28
    -29
    -30
    -31
    -32
    -
    -
    # File 'mrbgems/mruby-object-ext/src/object.c', line 28
    -
    -static mrb_value
    -nil_to_f(mrb_state *mrb, mrb_value obj)
    -{
    -  return mrb_float_value(mrb, 0.0);
    -}
    -
    -
    - -
    -

    - - #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);
    -}
    -
    -
    - -
    -

    - - #to_i0 - - - - - -

    -
    -

    Always returns zero.

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

    Returns:

    -
      - -
    • - - - (0) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -55
    -56
    -57
    -58
    -59
    -
    -
    # File 'mrbgems/mruby-object-ext/src/object.c', line 55
    -
    -static mrb_value
    -nil_to_i(mrb_state *mrb, mrb_value obj)
    -{
    -  return mrb_fixnum_value(0);
    -}
    -
    -
    - -
    -

    - - #to_sObject - - - - - -

    -
    -

    Always returns the empty string.

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -83
    -84
    -85
    -86
    -87
    -
    -
    # File 'src/object.c', line 83
    -
    -static mrb_value
    -nil_to_s(mrb_state *mrb, mrb_value obj)
    -{
    -  return mrb_str_new_frozen(mrb, 0, 0);
    -}
    -
    -
    - -
    -

    - - - #|(obj) ⇒ Boolean - - #|(obj) ⇒ Boolean - - - - - - -

    -
    -

    Or—Returns false if obj is -nil or false; true otherwise.

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #|(obj) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #|(obj) ⇒ Boolean -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -240
    -241
    -242
    -243
    -244
    -245
    -246
    -247
    -
    -
    # File 'src/object.c', line 240
    -
    -static mrb_value
    -false_or(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_bool obj2;
    -
    -  mrb_get_args(mrb, "b", &obj2);
    -  return mrb_bool_value(obj2);
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/NoMemoryError.html b/docs/api/NoMemoryError.html deleted file mode 100644 index d310684..0000000 --- a/docs/api/NoMemoryError.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - Exception: NoMemoryError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: NoMemoryError - - - -

    -
    - -
    -
    Inherits:
    -
    - Exception - -
      -
    • Object
    • - - - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    src/error.c
    -
    - -
    - - - - - - - - - - - - - - - -

    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/NoMethodError.html b/docs/api/NoMethodError.html deleted file mode 100644 index f23b1e6..0000000 --- a/docs/api/NoMethodError.html +++ /dev/null @@ -1,337 +0,0 @@ - - - - - - - Exception: NoMethodError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: NoMethodError - - - -

    -
    - -
    -
    Inherits:
    -
    - NameError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/10error.rb
    -
    - -
    - -

    Overview

    -
    -

    ISO 15.2.32

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

    Instance Attribute Summary collapse

    -
      - -
    • - - - #args ⇒ Object - - - - - - - - - readonly - - - - - - - - - -

      Returns the value of attribute args.

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

    Attributes inherited from NameError

    -

    #name

    - - - -

    - Instance Method Summary - collapse -

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

    Methods inherited from Exception

    -

    #backtrace, #exception, #inspect, #message, #set_backtrace, #to_s

    -
    -

    Constructor Details

    - -
    -

    - - #initialize(message = nil, name = nil, args = nil) ⇒ NoMethodError - - - - - -

    -
    -

    Returns a new instance of NoMethodError

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -38
    -39
    -40
    -41
    -
    -
    # File 'mrblib/10error.rb', line 38
    -
    -def initialize(message=nil, name=nil, args=nil)
    -  @args = args
    -  super message, name
    -end
    -
    -
    - -
    - -
    -

    Instance Attribute Details

    - - - -
    -

    - - #argsObject (readonly) - - - - - -

    -
    -

    Returns the value of attribute args

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -36
    -37
    -38
    -
    -
    # File 'mrblib/10error.rb', line 36
    -
    -def args
    -  @args
    -end
    -
    -
    - -
    - - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/NotImplementedError.html b/docs/api/NotImplementedError.html deleted file mode 100644 index 9a53b48..0000000 --- a/docs/api/NotImplementedError.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - Exception: NotImplementedError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: NotImplementedError - - - -

    -
    - -
    -
    Inherits:
    -
    - ScriptError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/10error.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/Numeric.html b/docs/api/Numeric.html deleted file mode 100644 index ee37454..0000000 --- a/docs/api/Numeric.html +++ /dev/null @@ -1,924 +0,0 @@ - - - - - - - Class: Numeric - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Numeric - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - -
    -
    Includes:
    -
    Comparable
    -
    - - - - - - -
    -
    Defined in:
    -
    mrblib/numeric.rb,
    - src/numeric.c,
    mrbgems/mruby-rational/mrblib/rational.rb,
    mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb
    -
    -
    - -
    - -

    Overview

    -
    -

    Numeric

    - -

    ISO 15.2.7

    - - -
    -
    -
    - - -
    - -
    -

    Direct Known Subclasses

    -

    Complex, Float, Integer, Rational

    -
    - - - - - - - - -

    - Instance Method Summary - collapse -

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

    Methods included from Comparable

    -

    #<, #<=, #==, #>, #>=, #between?, #clamp

    - - -
    -

    Instance Method Details

    - - -
    -

    - - #+@Object - - - - - -

    -
    -

    Returns the receiver simply.

    - -

    ISO 15.2.7.4.1

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -11
    -12
    -13
    -
    -
    # File 'mrblib/numeric.rb', line 11
    -
    -def +@
    -  self
    -end
    -
    -
    - -
    -

    - - #-@Object - - - - - -

    -
    -

    Returns the receiver’s value, negated.

    - -

    ISO 15.2.7.4.2

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -19
    -20
    -21
    -
    -
    # File 'mrblib/numeric.rb', line 19
    -
    -def -@
    -  0 - self
    -end
    -
    -
    - -
    -

    - - #absObject - - - - - -

    -
    -

    Returns the absolute value of the receiver.

    - -

    ISO 15.2.7.4.3

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -
    -
    # File 'mrblib/numeric.rb', line 27
    -
    -def abs
    -  if self < 0
    -    -self
    -  else
    -    self
    -  end
    -end
    -
    -
    - -
    -

    - - #finite?Boolean - - - - - -

    -
    -

    15.2.7

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -1576
    -1577
    -1578
    -1579
    -1580
    -
    -
    # File 'src/numeric.c', line 1576
    -
    -static mrb_value
    -num_finite_p(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_true_value();
    -}
    -
    -
    - -
    -

    - - #infinite?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -1582
    -1583
    -1584
    -1585
    -1586
    -
    -
    # File 'src/numeric.c', line 1582
    -
    -static mrb_value
    -num_infinite_p(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_false_value();
    -}
    -
    -
    - -
    -

    - - #negative?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -18
    -19
    -20
    -
    -
    # File 'mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb', line 18
    -
    -def negative?
    -  self < 0
    -end
    -
    -
    - -
    -

    - - #nonzero?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -6
    -7
    -8
    -9
    -10
    -11
    -12
    -
    -
    # File 'mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb', line 6
    -
    -def nonzero?
    -  if self == 0
    -    nil
    -  else
    -    self
    -  end
    -end
    -
    -
    - -
    -

    - - #positive?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -14
    -15
    -16
    -
    -
    # File 'mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb', line 14
    -
    -def positive?
    -  self > 0
    -end
    -
    -
    - -
    -

    - - #to_rObject - - - - - -

    - - - - -
    -
    -
    -
    -80
    -81
    -82
    -
    -
    # File 'mrbgems/mruby-rational/mrblib/rational.rb', line 80
    -
    -def to_r
    -  Rational(self, 1)
    -end
    -
    -
    - -
    -

    - - #zero?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -2
    -3
    -4
    -
    -
    # File 'mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb', line 2
    -
    -def zero?
    -  self == 0
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/ObjectSpace.html b/docs/api/ObjectSpace.html deleted file mode 100644 index 53b4903..0000000 --- a/docs/api/ObjectSpace.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - Module: ObjectSpace - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Module: ObjectSpace - - - -

    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-objectspace/src/mruby_objectspace.c
    -
    - -
    - - - - - - - - - - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Proc.html b/docs/api/Proc.html deleted file mode 100644 index ddaefdf..0000000 --- a/docs/api/Proc.html +++ /dev/null @@ -1,520 +0,0 @@ - - - - - - - Class: Proc - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Proc - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    src/class.c,
    - mrbgems/mruby-proc-ext/mrblib/proc.rb
    -
    -
    - -
    - -

    Overview

    -
    -

    15.2.17

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

    - Instance Method Summary - collapse -

    - - - - - - -
    -

    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 - - - - - -

    - - - - -
    -
    -
    -
    -3
    -4
    -5
    -
    -
    # File 'mrbgems/mruby-proc-ext/mrblib/proc.rb', line 3
    -
    -def ===(*args)
    -  call(*args)
    -end
    -
    -
    - -
    -

    - - #>>(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
    -
    -
    - -
    -

    - - #curry(arity = self.arity) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -
    -
    # File 'mrbgems/mruby-proc-ext/mrblib/proc.rb', line 15
    -
    -def curry(arity=self.arity)
    -  type = :proc
    -  abs = lambda {|a| a < 0 ? -a - 1 : a}
    -  arity = abs[arity]
    -  if lambda?
    -    type = :lambda
    -    self_arity = self.arity
    -    if (self_arity >= 0 && arity != self_arity) ||
    -       (self_arity < 0 && abs[self_arity] > arity)
    -      raise ArgumentError, "wrong number of arguments (#{arity} for #{abs[self_arity]})"
    -    end
    -  end
    -
    -  pproc = self
    -  make_curry = proc do |given_args=[]|
    -    __send__(type) do |*args|
    -      new_args = given_args + args
    -      if new_args.size >= arity
    -        pproc[*new_args]
    -      else
    -        make_curry[new_args]
    -      end
    -    end
    -  end
    -  make_curry.call
    -end
    -
    -
    - -
    -

    - - #to_procObject - - - - - -

    - - - - -
    -
    -
    -
    -11
    -12
    -13
    -
    -
    # File 'mrbgems/mruby-proc-ext/mrblib/proc.rb', line 11
    -
    -def to_proc
    -  self
    -end
    -
    -
    - -
    -

    - - #yield(*args) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -7
    -8
    -9
    -
    -
    # File 'mrbgems/mruby-proc-ext/mrblib/proc.rb', line 7
    -
    -def yield(*args)
    -  call(*args)
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Random.html b/docs/api/Random.html deleted file mode 100644 index ff3b93b..0000000 --- a/docs/api/Random.html +++ /dev/null @@ -1,381 +0,0 @@ - - - - - - - Class: Random - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Random - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-random/src/random.c
    -
    - -
    - - - - - - - - - -

    - Instance Method Summary - collapse -

    - - - - -
    -

    Constructor Details

    - -
    -

    - - #initializeObject - - - - - -

    - - - - -
    -
    -
    -
    -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 157
    -
    -static mrb_value
    -random_m_init(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value seed;
    -  rand_state *t;
    -
    -  seed = get_opt(mrb);
    -  /* avoid memory leaks */
    -  t = random_ptr(self);
    -  if (mrb_nil_p(seed)) {
    -    rand_init(t);
    -  }
    -  else {
    -    rand_seed(t, (uint32_t)mrb_fixnum(seed));
    -  }
    -
    -  return self;
    -}
    -
    -
    - -
    - - -
    -

    Instance Method Details

    - - -
    -

    - - #randObject - - - - - -

    - - - - -
    -
    -
    -
    -176
    -177
    -178
    -179
    -180
    -181
    -182
    -183
    -184
    -
    -
    # File 'mrbgems/mruby-random/src/random.c', line 176
    -
    -static mrb_value
    -random_m_rand(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value max;
    -  rand_state *t = random_ptr(self);
    -
    -  max = get_opt(mrb);
    -  return random_rand(mrb, t, max);
    -}
    -
    -
    - -
    -

    - - #srandObject - - - - - -

    - - - - -
    -
    -
    -
    -186
    -187
    -188
    -189
    -190
    -191
    -192
    -193
    -194
    -195
    -196
    -197
    -198
    -199
    -200
    -201
    -202
    -203
    -204
    -
    -
    # File 'mrbgems/mruby-random/src/random.c', line 186
    -
    -static mrb_value
    -random_m_srand(mrb_state *mrb, mrb_value self)
    -{
    -  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 {
    -    seed = (uint32_t)mrb_fixnum(sv);
    -  }
    -  old_seed = rand_seed(t, seed);
    -
    -  return mrb_fixnum_value((mrb_int)old_seed);
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Range.html b/docs/api/Range.html deleted file mode 100644 index cf56ad7..0000000 --- a/docs/api/Range.html +++ /dev/null @@ -1,680 +0,0 @@ - - - - - - - Class: Range - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Range - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - -
    -
    Includes:
    -
    Enumerable
    -
    - - - - - - -
    -
    Defined in:
    -
    mrblib/range.rb,
    - mrblib/range.rb,
    mrbgems/mruby-range-ext/mrblib/range.rb
    -
    -
    - -
    - -

    Overview

    -
    -

    Range is enumerable

    - -

    ISO 15.2.14.3

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

    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, #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

    - - -
    -

    Instance Method Details

    - - -
    -

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

    -
    -

    Calls the given block for each element of +self+ -and pass the respective element.

    - -

    ISO 15.2.14.4.4

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -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
    -
    -
    # File 'mrblib/range.rb', line 12
    -
    -def each(&block)
    -  return to_enum :each unless block
    -
    -  val = self.first
    -  last = self.last
    -
    -  if val.kind_of?(Fixnum) && last.kind_of?(Fixnum) # fixnums are special
    -    lim = last
    -    lim += 1 unless exclude_end?
    -    i = val
    -    while i < lim
    -      block.call(i)
    -      i += 1
    -    end
    -    return self
    -  end
    -
    -  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
    -      str_each = true
    -    end
    -  end
    -
    -  raise TypeError, "can't iterate" unless val.respond_to? :succ
    -
    -  return self if (val <=> last) > 0
    -
    -  while (val <=> last) < 0
    -    block.call(val)
    -    val = val.succ
    -    if str_each
    -      break if val.size > last.size
    -    end
    -  end
    -
    -  block.call(val) if !exclude_end? && (val <=> last) == 0
    -  self
    -end
    -
    -
    - -
    -

    - - #first(*args) ⇒ Object - - - - - -

    -
    -

    call-seq: - rng.first -> obj - rng.first(n) -> an_array

    - -

    Returns the first object in the range, or an array of the first +n+ -elements.

    - -

    (10..20).first #=> 10 - (10..20).first(3) #=> [10, 11, 12]

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -
    -
    # File 'mrbgems/mruby-range-ext/mrblib/range.rb', line 13
    -
    -def first(*args)
    -  return self.begin if args.empty?
    -
    -  raise ArgumentError, "wrong number of arguments (given #{args.length}, expected 1)" unless args.length == 1
    -  nv = args[0]
    -  n = nv.__to_int
    -  raise ArgumentError, "negative array size (or size too big)" unless 0 <= n
    -  ary = []
    -  each do |i|
    -    break if n <= 0
    -    ary.push(i)
    -    n -= 1
    -  end
    -  ary
    -end
    -
    -
    - -
    -

    - - #hashObject - - - - - -

    -
    -

    redefine #hash 15.3.1.3.15

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -54
    -55
    -56
    -57
    -58
    -
    -
    # File 'mrblib/range.rb', line 54
    -
    -def hash
    -  h = first.hash ^ last.hash
    -  h += 1 if self.exclude_end?
    -  h
    -end
    -
    -
    - -
    -

    - - #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
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/RangeError.html b/docs/api/RangeError.html deleted file mode 100644 index ef0a8f8..0000000 --- a/docs/api/RangeError.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - Exception: RangeError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: RangeError - - - -

    -
    - -
    -
    Inherits:
    -
    - StandardError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/10error.rb
    -
    - -
    - -

    Overview

    -
    -

    ISO 15.2.26

    - - -
    -
    -
    - - -
    - -
    -

    Direct Known Subclasses

    -

    FloatDomainError

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

    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/Rational.html b/docs/api/Rational.html deleted file mode 100644 index 680b781..0000000 --- a/docs/api/Rational.html +++ /dev/null @@ -1,678 +0,0 @@ - - - - - - - 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 deleted file mode 100644 index 5623683..0000000 --- a/docs/api/RegexpError.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - Exception: RegexpError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: RegexpError - - - -

    -
    - -
    -
    Inherits:
    -
    - StandardError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/10error.rb
    -
    - -
    - -

    Overview

    -
    -

    ISO 15.2.26

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

    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/ScriptError.html b/docs/api/ScriptError.html deleted file mode 100644 index 231e23f..0000000 --- a/docs/api/ScriptError.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - Exception: ScriptError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: ScriptError - - - -

    -
    - -
    -
    Inherits:
    -
    - Exception - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    src/error.c
    -
    - -
    - -

    Overview

    -
    -

    15.2.37

    - - -
    -
    -
    - - -
    - -
    -

    Direct Known Subclasses

    -

    LocalJumpError, NotImplementedError

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

    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/Socket.html b/docs/api/Socket.html deleted file mode 100644 index f93f74b..0000000 --- a/docs/api/Socket.html +++ /dev/null @@ -1,1170 +0,0 @@ - - - - - - - Class: Socket - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Socket - - - -

    -
    - -
    -
    Inherits:
    -
    - BasicSocket - - - show all - -
    -
    - - - - - - -
    -
    Includes:
    -
    Constants
    -
    - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-socket/src/socket.c,
    - mrbgems/mruby-socket/mrblib/socket.rb,
    mrbgems/mruby-socket/mrblib/socket.rb,
    mrbgems/mruby-socket/mrblib/socket.rb
    -
    -
    - -
    - -

    Overview

    -
    -

    recvfrom_nonblock

    - - -
    -
    -
    - - -
    - -

    Defined Under Namespace

    -

    - - - Modules: Constants - - - - Classes: Option - - -

    - - - -

    Constant Summary

    - -

    Constants inherited - from IO

    -

    IO::BUF_SIZE, IO::SEEK_CUR, IO::SEEK_END, IO::SEEK_SET

    - - - - -

    Instance Attribute Summary

    - -

    Attributes inherited from BasicSocket

    -

    #do_not_reverse_lookup

    - - - -

    - Class Method Summary - collapse -

    - - - -

    - Instance Method Summary - collapse -

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

    Methods inherited from BasicSocket

    -

    #_is_socket=, #_recvfrom, #_setnonblock, #close, do_not_reverse_lookup, do_not_reverse_lookup=, for_fd, #getpeereid, #getpeername, #getsockname, #getsockopt, #local_address, #recv, #recv_nonblock, #remote_address, #send, #setsockopt, #shutdown, #sysread, #sysseek, #syswrite

    - - - - - - - - - -

    Methods inherited from IO

    -

    #<<, #_check_readable, #_read_buf, #close, #close_on_exec=, #close_on_exec?, #close_write, #closed?, #each, #each_byte, #eof?, #fileno, #flush, #getc, #gets, #hash, #initialize_copy, #isatty, #pid, pipe, popen, #pos, #pos=, #print, #printf, #puts, read, #read, #readchar, #readline, #readlines, #rewind, #seek, #sync, #sync=, #sysread, #sysseek, #syswrite, #ungetc, #write

    -
    -

    Constructor Details

    - -
    -

    - - #initialize(domain, type, protocol = 0) ⇒ Socket - - - - - -

    -
    -

    Returns a new instance of Socket

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -354
    -355
    -356
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 354
    -
    -def initialize(domain, type, protocol=0)
    -  super(Socket._socket(domain, type, protocol), "r+")
    -end
    -
    -
    - -
    - - -
    -

    Class Method Details

    - - -
    -

    - - .getaddrinfo(nodename, servname, family = nil, socktype = nil, protocol = nil, flags = 0) ⇒ Object - - - - - -

    -
    -

    def self.accept_loop

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -360
    -361
    -362
    -363
    -364
    -365
    -366
    -367
    -368
    -369
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 360
    -
    -def self.getaddrinfo(nodename, servname, family=nil, socktype=nil, protocol=nil, flags=0)
    -  Addrinfo.getaddrinfo(nodename, servname, family, socktype, protocol, flags).map { |ai|
    -    ary = ai._to_array
    -    ary[2] = nodename
    -    ary[4] = ai.afamily
    -    ary[5] = ai.socktype
    -    ary[6] = ai.protocol
    -    ary
    -  }
    -end
    -
    -
    - -
    -

    - - .open(*args) ⇒ Object - - - - - -

    -
    -

    def self.getnameinfo -def self.ip_address_list

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -374
    -375
    -376
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 374
    -
    -def self.open(*args)
    -  new(args)
    -end
    -
    -
    - -
    -

    - - .sockaddr_in(port, host) ⇒ Object - - - - Also known as: - pack_sockaddr_in - - - - -

    - - - - -
    -
    -
    -
    -378
    -379
    -380
    -381
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 378
    -
    -def self.sockaddr_in(port, host)
    -  ai = Addrinfo.getaddrinfo(host, port, nil, Socket::SOCK_DGRAM)[0]
    -  ai.to_sockaddr
    -end
    -
    -
    - -
    -

    - - .unpack_sockaddr_in(sa) ⇒ Object - - - - - -

    -
    -

    def self.tcp -def self.tcp_server_loop -def self.tcp_server_sockets -def self.udp_server_loop -def self.udp_server_loop_on -def self.udp_server_recv -def self.udp_server_sockets -def self.unix(path) -def self.unix_server_loop -def self.unix_server_socket

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -394
    -395
    -396
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 394
    -
    -def self.unpack_sockaddr_in(sa)
    -  Addrinfo.new(sa).ip_unpack.reverse
    -end
    -
    -
    - -
    -

    - - .unpack_sockaddr_un(sa) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -398
    -399
    -400
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 398
    -
    -def self.unpack_sockaddr_un(sa)
    -  Addrinfo.new(sa).unix_path
    -end
    -
    -
    - -
    - -
    -

    Instance Method Details

    - - -
    -

    - - #acceptObject - - - - - -

    - - - - -
    -
    -
    -
    -408
    -409
    -410
    -411
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 408
    -
    -def accept
    -  fd, addr = self.sysaccept
    -  [ Socket.for_fd(fd), addr ]
    -end
    -
    -
    - -
    -

    - - #accept_nonblockObject - - - - - -

    - - - - -
    -
    -
    -
    -413
    -414
    -415
    -416
    -417
    -418
    -419
    -420
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 413
    -
    -def accept_nonblock
    -  begin
    -    self._setnonblock(true)
    -    self.accept
    -  ensure
    -    self._setnonblock(false)
    -  end
    -end
    -
    -
    - -
    -

    - - #bind(sockaddr) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -422
    -423
    -424
    -425
    -426
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 422
    -
    -def bind(sockaddr)
    -  sockaddr = sockaddr.to_sockaddr if sockaddr.is_a? Addrinfo
    -  Socket._bind(self.fileno, sockaddr)
    -  0
    -end
    -
    -
    - -
    -

    - - #connect(sockaddr) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -428
    -429
    -430
    -431
    -432
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 428
    -
    -def connect(sockaddr)
    -  sockaddr = sockaddr.to_sockaddr if sockaddr.is_a? Addrinfo
    -  Socket._connect(self.fileno, sockaddr)
    -  0
    -end
    -
    -
    - -
    -

    - - #connect_nonblock(sockaddr) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -434
    -435
    -436
    -437
    -438
    -439
    -440
    -441
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 434
    -
    -def connect_nonblock(sockaddr)
    -  begin
    -    self._setnonblock(true)
    -    self.connect(sockaddr)
    -  ensure
    -    self._setnonblock(false)
    -  end
    -end
    -
    -
    - -
    -

    - - #listen(backlog) ⇒ Object - - - - - -

    -
    -

    def ipv6only!

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -445
    -446
    -447
    -448
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 445
    -
    -def listen(backlog)
    -  Socket._listen(self.fileno, backlog)
    -  0
    -end
    -
    -
    - -
    -

    - - #recvfrom(maxlen, flags = 0) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -450
    -451
    -452
    -453
    -454
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 450
    -
    -def recvfrom(maxlen, flags=0)
    -  msg, sa = _recvfrom(maxlen, flags)
    -  socktype = self.getsockopt(Socket::SOL_SOCKET, Socket::SO_TYPE).int
    -  [ msg, Addrinfo.new(sa, Socket::PF_UNSPEC, socktype) ]
    -end
    -
    -
    - -
    -

    - - #recvfrom_nonblock(*args) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -456
    -457
    -458
    -459
    -460
    -461
    -462
    -463
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 456
    -
    -def recvfrom_nonblock(*args)
    -  begin
    -    self._setnonblock(true)
    -    self._recvfrom(*args)
    -  ensure
    -    self._setnonblock(false)
    -  end
    -end
    -
    -
    - -
    -

    - - #sysacceptObject - - - - - -

    - - - - -
    -
    -
    -
    -465
    -466
    -467
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 465
    -
    -def sysaccept
    -  Socket._accept2(self.fileno)
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Socket/Constants.html b/docs/api/Socket/Constants.html deleted file mode 100644 index 891770a..0000000 --- a/docs/api/Socket/Constants.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - Module: Socket::Constants - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Module: Socket::Constants - - - -

    -
    - - - - - - - - - -
    -
    Included in:
    -
    Socket
    -
    - - - -
    -
    Defined in:
    -
    mrbgems/mruby-socket/src/socket.c
    -
    - -
    - - - - - - - - - - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Socket/Option.html b/docs/api/Socket/Option.html deleted file mode 100644 index 107c224..0000000 --- a/docs/api/Socket/Option.html +++ /dev/null @@ -1,957 +0,0 @@ - - - - - - - Class: Socket::Option - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Socket::Option - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-socket/mrblib/socket.rb
    -
    - -
    - - - - - -

    Instance Attribute Summary collapse

    -
      - -
    • - - - #data ⇒ Object - - - - - - - - - readonly - - - - - - - - - -

      def self.linger(family, level, optname, integer) end.

      -
      - -
    • - - -
    • - - - #family ⇒ Object - - - - - - - - - readonly - - - - - - - - - -

      def self.linger(family, level, optname, integer) end.

      -
      - -
    • - - -
    • - - - #level ⇒ Object - - - - - - - - - readonly - - - - - - - - - -

      def self.linger(family, level, optname, integer) end.

      -
      - -
    • - - -
    • - - - #optname ⇒ Object - - - - - - - - - readonly - - - - - - - - - -

      def self.linger(family, level, optname, integer) end.

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

    - Class Method Summary - collapse -

    - - - -

    - Instance Method Summary - collapse -

    - - - - -
    -

    Constructor Details

    - -
    -

    - - #initialize(family, level, optname, data) ⇒ Option - - - - - -

    -
    -

    Returns a new instance of Option

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -579
    -580
    -581
    -582
    -583
    -584
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 579
    -
    -def initialize(family, level, optname, data)
    -  @family  = family
    -  @level   = level
    -  @optname = optname
    -  @data    = data
    -end
    -
    -
    - -
    - -
    -

    Instance Attribute Details

    - - - -
    -

    - - #dataObject (readonly) - - - - - -

    -
    -

    def self.linger(family, level, optname, integer) -end

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -597
    -598
    -599
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 597
    -
    -def data
    -  @data
    -end
    -
    -
    - - - -
    -

    - - #familyObject (readonly) - - - - - -

    -
    -

    def self.linger(family, level, optname, integer) -end

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -597
    -598
    -599
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 597
    -
    -def family
    -  @family
    -end
    -
    -
    - - - -
    -

    - - #levelObject (readonly) - - - - - -

    -
    -

    def self.linger(family, level, optname, integer) -end

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -597
    -598
    -599
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 597
    -
    -def level
    -  @level
    -end
    -
    -
    - - - -
    -

    - - #optnameObject (readonly) - - - - - -

    -
    -

    def self.linger(family, level, optname, integer) -end

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -597
    -598
    -599
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 597
    -
    -def optname
    -  @optname
    -end
    -
    -
    - -
    - - -
    -

    Class Method Details

    - - -
    -

    - - .bool(family, level, optname, bool) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -586
    -587
    -588
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 586
    -
    -def self.bool(family, level, optname, bool)
    -  self.new(family, level, optname, [(bool ? 1 : 0)].pack('i'))
    -end
    -
    -
    - -
    -

    - - .int(family, level, optname, integer) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -590
    -591
    -592
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 590
    -
    -def self.int(family, level, optname, integer)
    -  self.new(family, level, optname, [integer].pack('i'))
    -end
    -
    -
    - -
    - -
    -

    Instance Method Details

    - - -
    -

    - - #boolObject - - - - - -

    - - - - -
    -
    -
    -
    -599
    -600
    -601
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 599
    -
    -def bool
    -  @data.unpack('i')[0] != 0
    -end
    -
    -
    - -
    -

    - - #inspectObject - - - - - -

    - - - - -
    -
    -
    -
    -603
    -604
    -605
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 603
    -
    -def inspect
    -  "#<Socket::Option: family:#{@family} level:#{@level} optname:#{@optname} #{@data.inspect}>"
    -end
    -
    -
    - -
    -

    - - #intObject - - - - - -

    - - - - -
    -
    -
    -
    -607
    -608
    -609
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 607
    -
    -def int
    -  @data.unpack('i')[0]
    -end
    -
    -
    - -
    -

    - - #lingerObject - - - - - -

    -
    - - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -611
    -612
    -613
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 611
    -
    -def linger
    -  raise NotImplementedError.new
    -end
    -
    -
    - -
    -

    - - #unpack(template) ⇒ Object - - - - - -

    -
    - - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -615
    -616
    -617
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 615
    -
    -def unpack(template)
    -  raise NotImplementedError.new
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/SocketError.html b/docs/api/SocketError.html deleted file mode 100644 index bc3ccc3..0000000 --- a/docs/api/SocketError.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - Exception: SocketError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: SocketError - - - -

    -
    - -
    -
    Inherits:
    -
    - StandardError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-socket/mrblib/socket.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/StandardError.html b/docs/api/StandardError.html deleted file mode 100644 index 2fadf13..0000000 --- a/docs/api/StandardError.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - Exception: StandardError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: StandardError - - - -

    -
    - -
    -
    Inherits:
    -
    - Exception - -
      -
    • Object
    • - - - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    src/error.c
    -
    - -
    - -

    Overview

    -
    -

    15.2.23

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

    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/StopIteration.html b/docs/api/StopIteration.html deleted file mode 100644 index 16bdec3..0000000 --- a/docs/api/StopIteration.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - Exception: StopIteration - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: StopIteration - - - -

    -
    - -
    -
    Inherits:
    -
    - IndexError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/10error.rb
    -
    - -
    - - - - - -

    Instance Attribute Summary collapse

    -
      - -
    • - - - #result ⇒ Object - - - - - - - - - - - - - - - - -

      Returns the value of attribute result.

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

    Method Summary

    - -

    Methods inherited from Exception

    -

    #backtrace, #exception, #initialize, #inspect, #message, #set_backtrace, #to_s

    -
    -

    Constructor Details

    - -

    This class inherits a constructor from Exception

    - -
    - -
    -

    Instance Attribute Details

    - - - -
    -

    - - #resultObject - - - - - -

    -
    -

    Returns the value of attribute result

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -58
    -59
    -60
    -
    -
    # File 'mrblib/10error.rb', line 58
    -
    -def result
    -  @result
    -end
    -
    -
    - -
    - - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/String.html b/docs/api/String.html deleted file mode 100644 index a47a1e4..0000000 --- a/docs/api/String.html +++ /dev/null @@ -1,12784 +0,0 @@ - - - - - - - Class: String - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: String - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - -
    -
    Includes:
    -
    Comparable
    -
    - - - - - - -
    -
    Defined in:
    -
    mrblib/string.rb,
    - src/string.c,
    mrbgems/mruby-sprintf/mrblib/string.rb,
    mrbgems/mruby-string-ext/mrblib/string.rb
    -
    -
    - -
    - -

    Overview

    -
    -

    String

    - -

    ISO 15.2.10

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

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #%(args) ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #*(integer) ⇒ String - - - - - - - - - - - - - -

      Copy—Returns a new String containing integer copies of the receiver.

      -
      - -
    • - - -
    • - - - #+(other_str) ⇒ String - - - - - - - - - - - - - -

      Concatenation—Returns a new String containing other_str concatenated to str.

      -
      - -
    • - - -
    • - - - #<< ⇒ Object - - - - - - - - - - - - - -

      Append—Concatenates the given object to str.

      -
      - -
    • - - -
    • - - - #<=>(other_str) ⇒ -1, ... - - - - - - - - - - - - - -

      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.

      -
      - -
    • - - -
    • - - - #==(obj) ⇒ Boolean - - - - - - - - - - - - - -

      Equality— If obj is not a String, returns false.

      -
      - -
    • - - -
    • - - - #[] ⇒ Object - - - - - - - - - - - - - -

      Element Reference—If passed a single Fixnum, returns the code of the character at that position.

      -
      - -
    • - - -
    • - - - #[]= ⇒ Object - - - - - - - - - - - - - -

      Modify +self+ by replacing the content of +self+.

      -
      - -
    • - - -
    • - - - #__lines ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #__sub_replace(pre, m, post) ⇒ Object - - - - - - - - - - - - - -

      private method for gsub/sub.

      -
      - -
    • - - -
    • - - - #bytes ⇒ Object - - - - - - - - - - - - - -

      Returns an array of bytes in str.

      -
      - -
    • - - -
    • - - - #bytesize ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #byteslice ⇒ Object - - - - - - - - - - - - - -

      Byte Reference—If passed a single Integer, returns a substring of one byte at that position.

      -
      - -
    • - - -
    • - - - #capitalize ⇒ String - - - - - - - - - - - - - -

      Returns a copy of str with the first character converted to uppercase and the remainder to lowercase.

      -
      - -
    • - - -
    • - - - #capitalize! ⇒ String? - - - - - - - - - - - - - -

      Modifies str by converting the first character to uppercase and the remainder to lowercase.

      -
      - -
    • - - -
    • - - - #casecmp(str) ⇒ Object - - - - - - - - - - - - - -

      call-seq: str.casecmp(other_str) -> -1, 0, +1 or nil.

      -
      - -
    • - - -
    • - - - #casecmp?(str) ⇒ Boolean - - - - - - - - - - - - - -

      call-seq: str.casecmp?(other) -> true, false, or nil.

      -
      - -
    • - - -
    • - - - #chars(&block) ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #chomp(separator = "\n") ⇒ String - - - - - - - - - - - - - -

      Returns a new String with the given record separator removed from the end of str (if present).

      -
      - -
    • - - -
    • - - - #chomp!(separator = "\n") ⇒ String? - - - - - - - - - - - - - -

      Modifies str in place as described for String#chomp, returning str, or nil if no modifications were made.

      -
      - -
    • - - -
    • - - - #chop ⇒ String - - - - - - - - - - - - - -

      Returns a new String with the last character removed.

      -
      - -
    • - - -
    • - - - #chop! ⇒ String? - - - - - - - - - - - - - -

      Processes str as for String#chop, returning str, or nil if str is the empty string.

      -
      - -
    • - - -
    • - - - #chr ⇒ String - - - - - - - - - - - - - -

      Returns a one-character string at the beginning of the string.

      -
      - -
    • - - -
    • - - - #clear ⇒ Object - - - - - - - - - - - - - -

      call-seq: string.clear -> string.

      -
      - -
    • - - -
    • - - - #codepoints(&block) ⇒ Object - - - - (also: #each_codepoint) - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #concat ⇒ Object - - - - - - - - - - - - - -

      Append—Concatenates the given object to str.

      -
      - -
    • - - -
    • - - - #count ⇒ Object - - - - - - - - - - - - - -

      call_seq: str.count([other_str]) -> integer.

      -
      - -
    • - - -
    • - - - #cover?(obj) ⇒ Boolean - - - - - - - - - - - - - -

      Returns true if +obj+ is between the begin and end of the range.

      -
      - -
    • - - -
    • - - - #delete ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #delete! ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #delete_prefix(prefix) ⇒ String - - - - - - - - - - - - - -

      Returns a copy of str with leading prefix deleted.

      -
      - -
    • - - -
    • - - - #delete_prefix!(prefix) ⇒ self? - - - - - - - - - - - - - -

      Deletes leading prefix from str, returning nil if no change was made.

      -
      - -
    • - - -
    • - - - #delete_suffix(suffix) ⇒ String - - - - - - - - - - - - - -

      Returns a copy of str with leading suffix deleted.

      -
      - -
    • - - -
    • - - - #delete_suffix!(suffix) ⇒ self? - - - - - - - - - - - - - -

      Deletes trailing suffix from str, returning nil if no change was made.

      -
      - -
    • - - -
    • - - - #downcase ⇒ String - - - - - - - - - - - - - -

      Returns a copy of str with all uppercase letters replaced with their lowercase counterparts.

      -
      - -
    • - - -
    • - - - #downcase! ⇒ String? - - - - - - - - - - - - - -

      Downcases the contents of str, returning nil if no changes were made.

      -
      - -
    • - - -
    • - - - #dump ⇒ String - - - - - - - - - - - - - -

      Produces a version of str with all nonprinting characters replaced by \nnn notation and all special characters escaped.

      -
      - -
    • - - -
    • - - - #each_byte(&block) ⇒ Object - - - - - - - - - - - - - -

      Call the given block for each byte of +self+.

      -
      - -
    • - - -
    • - - - #each_char(&block) ⇒ Object - - - - - - - - - - - - - -

      Call the given block for each character of +self+.

      -
      - -
    • - - -
    • - - - #each_line(separator = "\n", &block) ⇒ Object - - - - - - - - - - - - - -

      Calls the given block for each line and pass the respective line.

      -
      - -
    • - - -
    • - - - #empty? ⇒ Boolean - - - - - - - - - - - - - -

      Returns true if str has a length of zero.

      -
      - -
    • - - -
    • - - - #end_with?([suffixes]) ⇒ Boolean - - - - - - - - - - - - - -

      Returns true if +str+ ends with one of the +suffixes+ given.

      -
      - -
    • - - -
    • - - - #eql?(other) ⇒ Boolean - - - - - - - - - - - - - -

      Two strings are equal if the have the same length and content.

      -
      - -
    • - - -
    • - - - #getbyte(index) ⇒ 0 .. 255 - - - - - - - - - - - - - -

      returns the indexth byte as an integer.

      -
      - -
    • - - -
    • - - - #gsub(*args, &block) ⇒ Object - - - - - - - - - - - - - -

      Replace all matches of +pattern+ with +replacement+.

      -
      - -
    • - - -
    • - - - #gsub!(*args, &block) ⇒ Object - - - - - - - - - - - - - -

      Replace all matches of +pattern+ with +replacement+.

      -
      - -
    • - - -
    • - - - #hash ⇒ Fixnum - - - - - - - - - - - - - -

      Return a hash based on the string’s length and content.

      -
      - -
    • - - -
    • - - - #hex ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #include? ⇒ Object - - - - - - - - - - - - - -

      Returns true if str contains the given string or character.

      -
      - -
    • - - -
    • - - - #index(substring[, offset]) ⇒ Fixnum? - - - - - - - - - - - - - -

      Returns the index of the first occurrence of the given substring.

      -
      - -
    • - - -
    • - - - #new(str = "") ⇒ String - - - - - - - constructor - - - - - - - - -

      Returns a new string object containing a copy of str.

      -
      - -
    • - - -
    • - - - #replace(other_str) ⇒ String - - - - - - - - - - - - - -

      s = “hello” #=> “hello” s.replace “world” #=> “world”.

      -
      - -
    • - - -
    • - - - #insert(idx, str) ⇒ Object - - - - - - - - - - - - - -

      call-seq: str.insert(index, other_str) -> str.

      -
      - -
    • - - -
    • - - - #inspect ⇒ String - - - - - - - - - - - - - -

      Returns a printable version of str, surrounded by quote marks, with special characters escaped.

      -
      - -
    • - - -
    • - - - #intern ⇒ Object - - - - - - - - - - - - - -

      Returns the Symbol corresponding to str, creating the symbol if it did not previously exist.

      -
      - -
    • - - -
    • - - - #last ⇒ Object - - - - - - - - - - - - - -

      Returns the last object in the range, or an array of the last +n+ elements.

      -
      - -
    • - - -
    • - - - #length ⇒ Integer - - - - - - - - - - - - - -

      Same as sym.to_s.length.

      -
      - -
    • - - -
    • - - - #lines(&blk) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - -
      call-seq: string.lines -> array of string string.lines sblock -> array of string.
      -
      - -
    • - - -
    • - - - #ljust(idx, padstr = ' ') ⇒ Object - - - - - - - - - - - - - -

      call-seq: str.ljust(integer, padstr=’ ‘) -> new_str.

      -
      - -
    • - - -
    • - - - #lstrip ⇒ Object - - - - - - - - - - - - - -

      call-seq: str.lstrip -> new_str.

      -
      - -
    • - - -
    • - - - #lstrip! ⇒ Object - - - - - - - - - - - - - -

      call-seq: str.lstrip! -> self or nil.

      -
      - -
    • - - -
    • - - - #next ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #succ ⇒ String - - - - - - - - - - - - - -

      Returns next sequence of the string;.

      -
      - -
    • - - -
    • - - - #oct ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #ord ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #partition(sep) ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #prepend(arg) ⇒ Object - - - - - - - - - - - - - -

      call-seq: str.prepend(other_str) -> str.

      -
      - -
    • - - -
    • - - - #replace(other_str) ⇒ String - - - - - - - - - - - - - -

      s = “hello” #=> “hello” s.replace “world” #=> “world”.

      -
      - -
    • - - -
    • - - - #reverse ⇒ String - - - - - - - - - - - - - -

      Returns a new string with the characters from str in reverse order.

      -
      - -
    • - - -
    • - - - #reverse! ⇒ String - - - - - - - - - - - - - -

      Reverses str in place.

      -
      - -
    • - - -
    • - - - #rindex(substring[, offset]) ⇒ Fixnum? - - - - - - - - - - - - - -

      Returns the index of the last occurrence of the given substring.

      -
      - -
    • - - -
    • - - - #rjust(idx, padstr = ' ') ⇒ Object - - - - - - - - - - - - - -

      call-seq: str.rjust(integer, padstr=’ ‘) -> new_str.

      -
      - -
    • - - -
    • - - - #rpartition(sep) ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #rstrip ⇒ Object - - - - - - - - - - - - - -

      call-seq: str.rstrip -> new_str.

      -
      - -
    • - - -
    • - - - #rstrip! ⇒ Object - - - - - - - - - - - - - -

      call-seq: str.rstrip! -> self or nil.

      -
      - -
    • - - -
    • - - - #setbyte(index, integer) ⇒ Integer - - - - - - - - - - - - - -

      modifies the indexth byte as integer.

      -
      - -
    • - - -
    • - - - #length ⇒ Integer - - - - - - - - - - - - - -

      Same as sym.to_s.length.

      -
      - -
    • - - -
    • - - - #slice ⇒ Object - - - - - - - - - - - - - -

      Element Reference—If passed a single Fixnum, returns the code of the character at that position.

      -
      - -
    • - - -
    • - - - #slice!(arg1, arg2 = nil) ⇒ Object - - - - - - - - - - - - - -

      call-seq: str.slice!(fixnum) -> new_str or nil str.slice!(fixnum, fixnum) -> new_str or nil str.slice!(range) -> new_str or nil str.slice!(other_str) -> new_str or nil.

      -
      - -
    • - - -
    • - - - #split(pattern = "\n", [limit]) ⇒ Array - - - - - - - - - - - - - -

      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.

      -
      - -
    • - - -
    • - - - #start_with?([prefixes]) ⇒ Boolean - - - - - - - - - - - - - -

      Returns true if +str+ starts with one of the +prefixes+ given.

      -
      - -
    • - - -
    • - - - #strip ⇒ Object - - - - - - - - - - - - - -

      call-seq: str.strip -> new_str.

      -
      - -
    • - - -
    • - - - #strip! ⇒ Object - - - - - - - - - - - - - -

      call-seq: str.strip! -> str or nil.

      -
      - -
    • - - -
    • - - - #sub(*args, &block) ⇒ Object - - - - - - - - - - - - - -

      Replace only the first match of +pattern+ with +replacement+.

      -
      - -
    • - - -
    • - - - #sub!(*args, &block) ⇒ Object - - - - - - - - - - - - - -

      Replace only the first match of +pattern+ with +replacement+.

      -
      - -
    • - - -
    • - - - #succ ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #succ ⇒ String - - - - - - - - - - - - - -

      Returns next sequence of the string;.

      -
      - -
    • - - -
    • - - - #swapcase ⇒ String - - - - - - - - - - - - - -

      Returns a copy of str with uppercase alphabetic characters converted to lowercase and lowercase characters converted to uppercase.

      -
      - -
    • - - -
    • - - - #swapcase! ⇒ String? - - - - - - - - - - - - - -

      Equivalent to String#swapcase, but modifies the receiver in place, returning str, or nil if no changes were made.

      -
      - -
    • - - -
    • - - - #to_f ⇒ Float - - - - - - - - - - - - - -

      Returns the result of interpreting leading characters in str as a floating point number.

      -
      - -
    • - - -
    • - - - #to_i(base = 10) ⇒ Integer - - - - - - - - - - - - - -

      Returns the result of interpreting leading characters in str as an integer base base (between 2 and 36).

      -
      - -
    • - - -
    • - - - #to_s ⇒ String - - - - - - - - - - - - - -

      Returns the receiver.

      -
      - -
    • - - -
    • - - - #to_s ⇒ String - - - - - - - - - - - - - -

      Returns the receiver.

      -
      - -
    • - - -
    • - - - #to_sym ⇒ Object - - - - - - - - - - - - - -

      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.

      -
      - -
    • - - -
    • - - - #upcase ⇒ String - - - - - - - - - - - - - -

      Returns a copy of str with all lowercase letters replaced with their uppercase counterparts.

      -
      - -
    • - - -
    • - - - #upcase! ⇒ String? - - - - - - - - - - - - - -

      Upcases the contents of str, returning nil if no changes were made.

      -
      - -
    • - - -
    • - - - #upto(max, exclusive = false, &block) ⇒ Object - - - - - - - - - - - - - -
      - - - - - - - -
      call-seq: str.upto(other_str, exclusive=false) {sblock } -> str str.upto(other_str, exclusive=false) -> an_enumerator.
      -
      - -
    • - - -
    - - - - - - - - - - - -

    Methods included from Comparable

    -

    #<, #<=, #>, #>=, #between?, #clamp

    -
    -

    Constructor Details

    - -
    -

    - - #new(str = "") ⇒ String - - - - - -

    -
    -

    Returns a new string object containing a copy of str.

    - - -
    -
    -
    - -
    -
    - - - -
    -
    -
    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1901
    -1902
    -1903
    -1904
    -1905
    -1906
    -1907
    -1908
    -1909
    -1910
    -1911
    -1912
    -
    -
    # File 'src/string.c', line 1901
    -
    -static mrb_value
    -mrb_str_init(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value str2;
    -
    -  if (mrb_get_args(mrb, "|S", &str2) == 0) {
    -    struct RString *s = str_new(mrb, 0, 0);
    -    str2 = mrb_obj_value(s);
    -  }
    -  str_replace(mrb, mrb_str_ptr(self), mrb_str_ptr(str2));
    -  return self;
    -}
    -
    -
    - -
    - - -
    -

    Instance Method Details

    - - -
    -

    - - #%(args) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -
    -
    # File 'mrbgems/mruby-sprintf/mrblib/string.rb', line 2
    -
    -def %(args)
    -  if args.is_a? Array
    -    sprintf(self, *args)
    -  else
    -    sprintf(self, args)
    -  end
    -end
    -
    -
    - -
    -

    - - #*(integer) ⇒ String - - - - - -

    -
    -

    Copy—Returns a new String containing integer copies of -the receiver.

    - -

    “Ho! “ * 3 #=> “Ho! Ho! Ho! “

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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 941
    -
    -static mrb_value
    -mrb_str_times(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int n,len,times;
    -  struct RString *str2;
    -  char *p;
    -
    -  mrb_get_args(mrb, "i", &times);
    -  if (times < 0) {
    -    mrb_raise(mrb, E_ARGUMENT_ERROR, "negative argument");
    -  }
    -  if (times && MRB_INT_MAX / times < RSTRING_LEN(self)) {
    -    mrb_raise(mrb, E_ARGUMENT_ERROR, "argument too big");
    -  }
    -
    -  len = RSTRING_LEN(self)*times;
    -  str2 = str_new(mrb, 0, len);
    -  str_with_class(str2, self);
    -  p = RSTR_PTR(str2);
    -  if (len > 0) {
    -    n = RSTRING_LEN(self);
    -    memcpy(p, RSTRING_PTR(self), n);
    -    while (n <= len/2) {
    -      memcpy(p + n, p, n);
    -      n *= 2;
    -    }
    -    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);
    -}
    -
    -
    - -
    -

    - - #+(other_str) ⇒ String - - - - - -

    -
    -

    Concatenation—Returns a new String containing -other_str concatenated to str.

    - -

    “Hello from “ + self.to_s #=> “Hello from main”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -900
    -901
    -902
    -903
    -904
    -905
    -906
    -907
    -
    -
    # File 'src/string.c', line 900
    -
    -static mrb_value
    -mrb_str_plus_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value str;
    -
    -  mrb_get_args(mrb, "S", &str);
    -  return mrb_str_plus(mrb, self, str);
    -}
    -
    -
    - -
    -

    - - - #<<(integer) ⇒ String - - #concat(integer) ⇒ String - - #<<(obj) ⇒ String - - #concat(obj) ⇒ String - - - - - - -

    -
    -

    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 -(equivalent to str.concat(integer.chr(__ENCODING__))).

    - -

    a = “hello “ - a « “world” #=> “hello world” - a.concat(33) #=> “hello world!”

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #<<(integer) ⇒ String -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #concat(integer) ⇒ String -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #<<(obj) ⇒ String -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #concat(obj) ⇒ String -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -164
    -165
    -166
    -167
    -168
    -169
    -170
    -171
    -172
    -173
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 164
    -
    -static mrb_value
    -mrb_str_concat_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value str;
    -
    -  mrb_get_args(mrb, "o", &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
    -    mrb_ensure_string_type(mrb, str);
    -  mrb_str_cat_str(mrb, self, str);
    -  return self;
    -}
    -
    -
    - -
    -

    - - #<=>(other_str) ⇒ -1, ... - - - - - -

    -
    -

    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. If the strings are of different lengths, and the strings are -equal when compared up to the shortest length, then the longer string is -considered greater than the shorter one. If the variable $= is -false, the comparison is based on comparing the binary values -of each character in the string. In older versions of Ruby, setting -$= allowed case-insensitive comparisons; this is now deprecated -in favor of using String#casecmp.

    - -

    <=> is the basis for the methods <, -<=, >, >=, and between?, -included from module Comparable. The method -String#== does not use Comparable#==.

    - -

    “abcdef” <=> “abcde” #=> 1 - “abcdef” <=> “abcdef” #=> 0 - “abcdef” <=> “abcdefg” #=> -1 - “abcdef” <=> “ABCDEF” #=> 1

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

    Returns:

    -
      - -
    • - - - (-1, 0, +1) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1031
    -1032
    -1033
    -1034
    -1035
    -1036
    -1037
    -1038
    -1039
    -1040
    -1041
    -1042
    -1043
    -1044
    -1045
    -
    -
    # File 'src/string.c', line 1031
    -
    -static mrb_value
    -mrb_str_cmp_m(mrb_state *mrb, mrb_value str1)
    -{
    -  mrb_value str2;
    -  mrb_int result;
    -
    -  mrb_get_args(mrb, "o", &str2);
    -  if (!mrb_string_p(str2)) {
    -    return mrb_nil_value();
    -  }
    -  else {
    -    result = mrb_str_cmp(mrb, str1, str2);
    -  }
    -  return mrb_fixnum_value(result);
    -}
    -
    -
    - -
    -

    - - #==(obj) ⇒ Boolean - - - - - -

    -
    -

    Equality— -If obj is not a String, returns false. -Otherwise, returns false or true

    - -

    caution:if str <=> obj returns zero.

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1076
    -1077
    -1078
    -1079
    -1080
    -1081
    -1082
    -1083
    -1084
    -
    -
    # File 'src/string.c', line 1076
    -
    -static mrb_value
    -mrb_str_equal_m(mrb_state *mrb, mrb_value str1)
    -{
    -  mrb_value str2;
    -
    -  mrb_get_args(mrb, "o", &str2);
    -
    -  return mrb_bool_value(mrb_str_equal(mrb, str1, str2));
    -}
    -
    -
    - -
    -

    - - - #[](fixnum) ⇒ Fixnum? - - #[](fixnum, fixnum) ⇒ String? - - #[](range) ⇒ String? - - #[](regexp) ⇒ String? - - #[](regexp, fixnum) ⇒ String? - - #[](other_str) ⇒ String? - - #slice(fixnum) ⇒ Fixnum? - - #slice(fixnum, fixnum) ⇒ String? - - #slice(range) ⇒ String? - - #slice(other_str) ⇒ String? - - - - - - -

    -
    -

    Element Reference—If passed a single Fixnum, returns the code -of the character at that position. If passed two Fixnum -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 -characters 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.

    - -

    If a String is given, that string is returned if it occurs in -str. In both cases, nil is returned if there is no -match.

    - -

    a = “hello there” - a[1] #=> 101(1.8.7) “e”(1.9.2) - a[1.1] #=> “e”(1.9.2) - a[1,3] #=> “ell” - a[1..3] #=> “ell” - a[-3,2] #=> “er” - a[-4..-2] #=> “her” - a[12..-1] #=> nil - a[-2..-4] #=> “” - a[“lo”] #=> “lo” - a[“bye”] #=> nil

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #[](fixnum) ⇒ Fixnum? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Fixnum, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](fixnum, fixnum) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](range) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](regexp) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](regexp, fixnum) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](other_str) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice(fixnum) ⇒ Fixnum? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Fixnum, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice(fixnum, fixnum) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice(range) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice(other_str) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -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;
    -
    -  if (mrb_get_args(mrb, "o|o", &a1, &a2) == 1) {
    -    a2 = mrb_undef_value();
    -  }
    -
    -  return mrb_str_aref(mrb, str, a1, a2);
    -}
    -
    -
    - -
    -

    - - - #[]=(fixnum) ⇒ Object - - #[]=(fixnum, fixnum) ⇒ Object - - #[]=(range) ⇒ Object - - #[]=(regexp) ⇒ Object - - #[]=(regexp, fixnum) ⇒ Object - - #[]=(other_str) ⇒ Object - - - - - - -

    -
    -

    Modify +self+ by replacing the content of +self+. -The portion of the string affected is determined using the same criteria as +String#[]+.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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;
    -}
    -
    -
    - -
    -

    - - #__linesObject - - - - - -

    - - - - -
    -
    -
    -
    -1174
    -1175
    -1176
    -1177
    -1178
    -1179
    -1180
    -1181
    -1182
    -1183
    -1184
    -1185
    -1186
    -1187
    -1188
    -1189
    -1190
    -1191
    -1192
    -1193
    -1194
    -1195
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 1174
    -
    -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);
    -
    -  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;
    -}
    -
    -
    - -
    -

    - - #__sub_replace(pre, m, post) ⇒ Object - - - - - -

    -
    -

    private method for gsub/sub

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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 55
    -
    -def __sub_replace(pre, m, post)
    -  s = ""
    -  i = 0
    -  while j = index("\\", i)
    -    break if j == length-1
    -    t = case self[j+1]
    -        when "\\"
    -          "\\"
    -        when "`"
    -          pre
    -        when "&", "0"
    -          m
    -        when "'"
    -          post
    -        when "1", "2", "3", "4", "5", "6", "7", "8", "9"
    -          ""
    -        else
    -          self[j, 2]
    -        end
    -    s += self[i, j-i] + t
    -    i = j + 2
    -  end
    -  s + self[i, length-i]
    -end
    -
    -
    - -
    -

    - - #bytesObject - - - - - -

    -
    -

    Returns an array of bytes in str.

    - -

    str = “hello” - str.bytes #=> [104, 101, 108, 108, 111]

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -2765
    -2766
    -2767
    -2768
    -2769
    -2770
    -2771
    -2772
    -2773
    -2774
    -2775
    -2776
    -2777
    -
    -
    # File 'src/string.c', line 2765
    -
    -static mrb_value
    -mrb_str_bytes(mrb_state *mrb, mrb_value str)
    -{
    -  struct RString *s = mrb_str_ptr(str);
    -  mrb_value a = mrb_ary_new_capa(mrb, RSTR_LEN(s));
    -  unsigned char *p = (unsigned char *)(RSTR_PTR(s)), *pend = p + RSTR_LEN(s);
    -
    -  while (p < pend) {
    -    mrb_ary_push(mrb, a, mrb_fixnum_value(p[0]));
    -    p++;
    -  }
    -  return a;
    -}
    -
    -
    - -
    -

    - - #bytesizeObject - - - - - -

    - - - - -
    -
    -
    -
    -924
    -925
    -926
    -927
    -928
    -929
    -
    -
    # File 'src/string.c', line 924
    -
    -static mrb_value
    -mrb_str_bytesize(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int len = RSTRING_LEN(self);
    -  return mrb_fixnum_value(len);
    -}
    -
    -
    - -
    -

    - - - #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) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -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, a2;
    -  mrb_int str_len = RSTRING_LEN(str), beg, len;
    -  mrb_bool empty = TRUE;
    -
    -  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));
    -  }
    -  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();
    -    }
    -  }
    -  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();
    -  }
    -}
    -
    -
    - -
    -

    - - #capitalizeString - - - - - -

    -
    -

    Returns a copy of str with the first character converted to uppercase -and the remainder to lowercase.

    - -

    “hello”.capitalize #=> “Hello” - “HELLO”.capitalize #=> “Hello” - “123ABC”.capitalize #=> “123abc”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1508
    -1509
    -1510
    -1511
    -1512
    -1513
    -1514
    -1515
    -1516
    -
    -
    # File 'src/string.c', line 1508
    -
    -static mrb_value
    -mrb_str_capitalize(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value str;
    -
    -  str = mrb_str_dup(mrb, self);
    -  mrb_str_capitalize_bang(mrb, str);
    -  return str;
    -}
    -
    -
    - -
    -

    - - #capitalize!String? - - - - - -

    -
    -

    Modifies str by converting the first character to uppercase and the -remainder to lowercase. Returns nil if no changes are made.

    - -

    a = “hello” - a.capitalize! #=> “Hello” - a #=> “Hello” - a.capitalize! #=> nil

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

    Returns:

    -
      - -
    • - - - (String, nil) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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 1472
    -
    -static mrb_value
    -mrb_str_capitalize_bang(mrb_state *mrb, mrb_value str)
    -{
    -  char *p, *pend;
    -  mrb_bool modify = FALSE;
    -  struct RString *s = mrb_str_ptr(str);
    -
    -  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)) {
    -    *p = TOUPPER(*p);
    -    modify = TRUE;
    -  }
    -  while (++p < pend) {
    -    if (ISUPPER(*p)) {
    -      *p = TOLOWER(*p);
    -      modify = TRUE;
    -    }
    -  }
    -  if (modify) return str;
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #casecmp(str) ⇒ Object - - - - - -

    -
    -

    call-seq: - str.casecmp(other_str) -> -1, 0, +1 or nil

    - -

    Case-insensitive version of String#<=>.

    - -

    “abcdef”.casecmp(“abcde”) #=> 1 - “aBcDeF”.casecmp(“abcdef”) #=> 0 - “abcdef”.casecmp(“abcdefg”) #=> -1 - “abcdef”.casecmp(“ABCDEF”) #=> 0

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -125
    -126
    -127
    -128
    -129
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 125
    -
    -def casecmp(str)
    -  self.downcase <=> str.__to_str.downcase
    -rescue NoMethodError
    -  nil
    -end
    -
    -
    - -
    -

    - - #casecmp?(str) ⇒ Boolean - - - - - -

    -
    -

    call-seq: - str.casecmp?(other) -> true, false, or nil

    - -

    Returns true if str and other_str are equal after case folding, -false if they are not equal, and nil if other_str is not a string.

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -138
    -139
    -140
    -141
    -142
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 138
    -
    -def casecmp?(str)
    -  c = self.casecmp(str)
    -  return nil if c.nil?
    -  return c == 0
    -end
    -
    -
    - -
    -

    - - #chars(&block) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -302
    -303
    -304
    -305
    -306
    -307
    -308
    -309
    -310
    -311
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 302
    -
    -def chars(&block)
    -  if block_given?
    -    self.split('').each do |i|
    -      block.call(i)
    -    end
    -    self
    -  else
    -    self.split('')
    -  end
    -end
    -
    -
    - -
    -

    - - #chomp(separator = "\n") ⇒ String - - - - - -

    -
    -

    Returns a new String with the given record separator removed -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” - “hello\n”.chomp #=> “hello” - “hello\r\n”.chomp #=> “hello” - “hello\n\r”.chomp #=> “hello\n” - “hello\r”.chomp #=> “hello” - “hello \n there”.chomp #=> “hello \n there” - “hello”.chomp(“llo”) #=> “he”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1612
    -1613
    -1614
    -1615
    -1616
    -1617
    -1618
    -1619
    -1620
    -
    -
    # File 'src/string.c', line 1612
    -
    -static mrb_value
    -mrb_str_chomp(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value str;
    -
    -  str = mrb_str_dup(mrb, self);
    -  mrb_str_chomp_bang(mrb, str);
    -  return str;
    -}
    -
    -
    - -
    -

    - - #chomp!(separator = "\n") ⇒ String? - - - - - -

    -
    -

    Modifies str in place as described for String#chomp, -returning str, or nil if no modifications were made.

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

    Returns:

    -
      - -
    • - - - (String, nil) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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 1526
    -
    -static mrb_value
    -mrb_str_chomp_bang(mrb_state *mrb, mrb_value str)
    -{
    -  mrb_value rs;
    -  mrb_int newline;
    -  char *p, *pp;
    -  mrb_int rslen;
    -  mrb_int len;
    -  mrb_int argc;
    -  struct RString *s = mrb_str_ptr(str);
    -
    -  argc = mrb_get_args(mrb, "|S", &rs);
    -  mrb_str_modify_keep_ascii(mrb, s);
    -  len = RSTR_LEN(s);
    -  if (argc == 0) {
    -    if (len == 0) return mrb_nil_value();
    -  smart_chomp:
    -    if (RSTR_PTR(s)[len-1] == '\n') {
    -      RSTR_SET_LEN(s, RSTR_LEN(s) - 1);
    -      if (RSTR_LEN(s) > 0 &&
    -          RSTR_PTR(s)[RSTR_LEN(s)-1] == '\r') {
    -        RSTR_SET_LEN(s, RSTR_LEN(s) - 1);
    -      }
    -    }
    -    else if (RSTR_PTR(s)[len-1] == '\r') {
    -      RSTR_SET_LEN(s, RSTR_LEN(s) - 1);
    -    }
    -    else {
    -      return mrb_nil_value();
    -    }
    -    RSTR_PTR(s)[RSTR_LEN(s)] = '\0';
    -    return str;
    -  }
    -
    -  if (len == 0 || mrb_nil_p(rs)) return mrb_nil_value();
    -  p = RSTR_PTR(s);
    -  rslen = RSTRING_LEN(rs);
    -  if (rslen == 0) {
    -    while (len>0 && p[len-1] == '\n') {
    -      len--;
    -      if (len>0 && p[len-1] == '\r')
    -        len--;
    -    }
    -    if (len < RSTR_LEN(s)) {
    -      RSTR_SET_LEN(s, len);
    -      p[len] = '\0';
    -      return str;
    -    }
    -    return mrb_nil_value();
    -  }
    -  if (rslen > len) return mrb_nil_value();
    -  newline = RSTRING_PTR(rs)[rslen-1];
    -  if (rslen == 1 && newline == '\n')
    -    newline = RSTRING_PTR(rs)[rslen-1];
    -  if (rslen == 1 && newline == '\n')
    -    goto smart_chomp;
    -
    -  pp = p + len - rslen;
    -  if (p[len-1] == newline &&
    -     (rslen <= 1 ||
    -     memcmp(RSTRING_PTR(rs), pp, rslen) == 0)) {
    -    RSTR_SET_LEN(s, len - rslen);
    -    p[RSTR_LEN(s)] = '\0';
    -    return str;
    -  }
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #chopString - - - - - -

    -
    -

    Returns a new String with the last character removed. If the -string ends with \r\n, both characters are removed. Applying -chop to an empty string returns an empty -string. String#chomp is often a safer alternative, as it leaves -the string unchanged if it doesn’t end in a record separator.

    - -

    “string\r\n”.chop #=> “string” - “string\n\r”.chop #=> “string\n” - “string\n”.chop #=> “string” - “string”.chop #=> “strin” - “x”.chop #=> “”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1681
    -1682
    -1683
    -1684
    -1685
    -1686
    -1687
    -1688
    -
    -
    # File 'src/string.c', line 1681
    -
    -static mrb_value
    -mrb_str_chop(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value str;
    -  str = mrb_str_dup(mrb, self);
    -  mrb_str_chop_bang(mrb, str);
    -  return str;
    -}
    -
    -
    - -
    -

    - - #chop!String? - - - - - -

    -
    -

    Processes str as for String#chop, returning str, -or nil if str is the empty string. See also -String#chomp!.

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

    Returns:

    -
      - -
    • - - - (String, nil) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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_keep_ascii(mrb, s);
    -  if (RSTR_LEN(s) > 0) {
    -    mrb_int len;
    -#ifdef MRB_UTF8_STRING
    -    const char* t = RSTR_PTR(s), *p = t;
    -    const char* e = p + RSTR_LEN(s);
    -    while (p<e) {
    -      mrb_int clen = utf8len(p, e);
    -      if (p + clen>=e) break;
    -      p += clen;
    -    }
    -    len = p - t;
    -#else
    -    len = RSTR_LEN(s) - 1;
    -#endif
    -    if (RSTR_PTR(s)[len] == '\n') {
    -      if (len > 0 &&
    -          RSTR_PTR(s)[len-1] == '\r') {
    -        len--;
    -      }
    -    }
    -    RSTR_SET_LEN(s, len);
    -    RSTR_PTR(s)[len] = '\0';
    -    return str;
    -  }
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #chrString - - - - - -

    -
    -

    Returns a one-character string at the beginning of the string.

    - -

    a = “abcde” - a.chr #=> “a”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -855
    -856
    -857
    -858
    -859
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 855
    -
    -static mrb_value
    -mrb_str_chr(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_str_substr(mrb, self, 0, 1);
    -}
    -
    -
    - -
    -

    - - #clearObject - - - - - -

    -
    -

    call-seq: - string.clear -> string

    - -

    Makes string empty.

    - -

    a = “abcde” - a.clear #=> “”

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -12
    -13
    -14
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 12
    -
    -def clear
    -  self.replace("")
    -end
    -
    -
    - -
    -

    - - #codepoints(&block) ⇒ Object - - - - Also known as: - each_codepoint - - - - -

    - - - - -
    -
    -
    -
    -326
    -327
    -328
    -329
    -330
    -331
    -332
    -333
    -334
    -335
    -336
    -337
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 326
    -
    -def codepoints(&block)
    -  len = self.size
    -
    -  if block_given?
    -    self.split('').each do|x|
    -      block.call(x.ord)
    -    end
    -    self
    -  else
    -    self.split('').map{|x| x.ord}
    -  end
    -end
    -
    -
    - -
    -

    - - - #<<(integer) ⇒ String - - #concat(integer) ⇒ String - - #<<(obj) ⇒ String - - #concat(obj) ⇒ String - - - - - - -

    -
    -

    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 -(equivalent to str.concat(integer.chr(__ENCODING__))).

    - -

    a = “hello “ - a « “world” #=> “hello world” - a.concat(33) #=> “hello world!”

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #<<(integer) ⇒ String -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #concat(integer) ⇒ String -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #<<(obj) ⇒ String -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #concat(obj) ⇒ String -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -164
    -165
    -166
    -167
    -168
    -169
    -170
    -171
    -172
    -173
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 164
    -
    -static mrb_value
    -mrb_str_concat_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value str;
    -
    -  mrb_get_args(mrb, "o", &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
    -    mrb_ensure_string_type(mrb, str);
    -  mrb_str_cat_str(mrb, self, str);
    -  return self;
    -}
    -
    -
    - -
    -

    - - #countObject - - - - - -

    -
    -

    call_seq: - str.count([other_str]) -> integer

    - -

    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.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -810
    -811
    -812
    -813
    -814
    -815
    -816
    -817
    -818
    -819
    -820
    -821
    -822
    -823
    -824
    -825
    -826
    -827
    -828
    -829
    -830
    -831
    -832
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 810
    -
    -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

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    -42
    -43
    -44
    -45
    -46
    -47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    -56
    -57
    -58
    -
    -
    # File 'mrbgems/mruby-range-ext/src/range.c', line 34
    -
    -static mrb_value
    -range_cover(mrb_state *mrb, mrb_value range)
    -{
    -  mrb_value val;
    -  struct RRange *r = mrb_range_ptr(mrb, range);
    -  mrb_value beg, end;
    -
    -  mrb_get_args(mrb, "o", &val);
    -
    -  beg = RANGE_BEG(r);
    -  end = RANGE_END(r);
    -
    -  if (r_le(mrb, beg, val)) {
    -    if (RANGE_EXCL(r)) {
    -      if (r_lt(mrb, val, end))
    -        return mrb_true_value();
    -    }
    -    else {
    -      if (r_le(mrb, val, end))
    -        return mrb_true_value();
    -    }
    -  }
    -
    -  return mrb_false_value();
    -}
    -
    -
    - -
    -

    - - #deleteObject - - - - - -

    - - - - -
    -
    -
    -
    -775
    -776
    -777
    -778
    -779
    -780
    -781
    -782
    -783
    -784
    -785
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 775
    -
    -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 - - - - - -

    - - - - -
    -
    -
    -
    -787
    -788
    -789
    -790
    -791
    -792
    -793
    -794
    -795
    -796
    -797
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 787
    -
    -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();
    -}
    -
    -
    - -
    -

    - - #delete_prefix(prefix) ⇒ String - - - - - -

    -
    -

    Returns a copy of str with leading prefix deleted.

    - -

    “hello”.delete_prefix(“hel”) #=> “lo” - “hello”.delete_prefix(“llo”) #=> “hello”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1105
    -1106
    -1107
    -1108
    -1109
    -1110
    -1111
    -1112
    -1113
    -1114
    -1115
    -1116
    -1117
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 1105
    -
    -static mrb_value
    -mrb_str_del_prefix(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int plen, slen;
    -  char *ptr;
    -
    -  mrb_get_args(mrb, "s", &ptr, &plen);
    -  slen = RSTRING_LEN(self);
    -  if (plen > slen) return mrb_str_dup(mrb, self);
    -  if (memcmp(RSTRING_PTR(self), ptr, plen) != 0)
    -    return mrb_str_dup(mrb, self);
    -  return mrb_str_substr(mrb, self, plen, slen-plen);
    -}
    -
    -
    - -
    -

    - - #delete_prefix!(prefix) ⇒ self? - - - - - -

    -
    -

    Deletes leading prefix from str, returning -nil if no change was made.

    - -

    “hello”.delete_prefix!(“hel”) #=> “lo” - “hello”.delete_prefix!(“llo”) #=> nil

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

    Returns:

    -
      - -
    • - - - (self, nil) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1072
    -1073
    -1074
    -1075
    -1076
    -1077
    -1078
    -1079
    -1080
    -1081
    -1082
    -1083
    -1084
    -1085
    -1086
    -1087
    -1088
    -1089
    -1090
    -1091
    -1092
    -1093
    -1094
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 1072
    -
    -static mrb_value
    -mrb_str_del_prefix_bang(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int plen, slen;
    -  char *ptr, *s;
    -  struct RString *str = RSTRING(self);
    -
    -  mrb_get_args(mrb, "s", &ptr, &plen);
    -  slen = RSTR_LEN(str);
    -  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))) {
    -    str->as.heap.ptr += plen;
    -  }
    -  else {
    -    mrb_str_modify(mrb, str);
    -    s = RSTR_PTR(str);
    -    memmove(s, s+plen, slen-plen);
    -  }
    -  RSTR_SET_LEN(str, slen-plen);
    -  return self;
    -}
    -
    -
    - -
    -

    - - #delete_suffix(suffix) ⇒ String - - - - - -

    -
    -

    Returns a copy of str with leading suffix deleted.

    - -

    “hello”.delete_suffix(“hel”) #=> “lo” - “hello”.delete_suffix(“llo”) #=> “hello”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1160
    -1161
    -1162
    -1163
    -1164
    -1165
    -1166
    -1167
    -1168
    -1169
    -1170
    -1171
    -1172
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 1160
    -
    -static mrb_value
    -mrb_str_del_suffix(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int plen, slen;
    -  char *ptr;
    -
    -  mrb_get_args(mrb, "s", &ptr, &plen);
    -  slen = RSTRING_LEN(self);
    -  if (plen > slen) return mrb_str_dup(mrb, self);
    -  if (memcmp(RSTRING_PTR(self)+slen-plen, ptr, plen) != 0)
    -    return mrb_str_dup(mrb, self);
    -  return mrb_str_substr(mrb, self, 0, slen-plen);
    -}
    -
    -
    - -
    -

    - - #delete_suffix!(suffix) ⇒ self? - - - - - -

    -
    -

    Deletes trailing suffix from str, returning -nil if no change was made.

    - -

    “hello”.delete_suffix!(“llo”) #=> “he” - “hello”.delete_suffix!(“hel”) #=> nil

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

    Returns:

    -
      - -
    • - - - (self, nil) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1129
    -1130
    -1131
    -1132
    -1133
    -1134
    -1135
    -1136
    -1137
    -1138
    -1139
    -1140
    -1141
    -1142
    -1143
    -1144
    -1145
    -1146
    -1147
    -1148
    -1149
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 1129
    -
    -static mrb_value
    -mrb_str_del_suffix_bang(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int plen, slen;
    -  char *ptr, *s;
    -  struct RString *str = RSTRING(self);
    -
    -  mrb_get_args(mrb, "s", &ptr, &plen);
    -  slen = RSTR_LEN(str);
    -  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))) {
    -    /* no need to modify string */
    -  }
    -  else {
    -    mrb_str_modify(mrb, str);
    -  }
    -  RSTR_SET_LEN(str, slen-plen);
    -  return self;
    -}
    -
    -
    - -
    -

    - - #downcaseString - - - - - -

    -
    -

    Returns a copy of str with all uppercase letters replaced with their -lowercase counterparts. The operation is locale insensitive—only -characters ‘A’ to ‘Z’ are affected.

    - -

    “hEllO”.downcase #=> “hello”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1731
    -1732
    -1733
    -1734
    -1735
    -1736
    -1737
    -1738
    -1739
    -
    -
    # File 'src/string.c', line 1731
    -
    -static mrb_value
    -mrb_str_downcase(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value str;
    -
    -  str = mrb_str_dup(mrb, self);
    -  mrb_str_downcase_bang(mrb, str);
    -  return str;
    -}
    -
    -
    - -
    -

    - - #downcase!String? - - - - - -

    -
    -

    Downcases the contents of str, returning nil if no -changes were made.

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

    Returns:

    -
      - -
    • - - - (String, nil) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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)
    -{
    -  char *p, *pend;
    -  mrb_bool modify = FALSE;
    -  struct RString *s = mrb_str_ptr(str);
    -
    -  mrb_str_modify_keep_ascii(mrb, s);
    -  p = RSTR_PTR(s);
    -  pend = RSTR_PTR(s) + RSTR_LEN(s);
    -  while (p < pend) {
    -    if (ISUPPER(*p)) {
    -      *p = TOLOWER(*p);
    -      modify = TRUE;
    -    }
    -    p++;
    -  }
    -
    -  if (modify) return str;
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #dumpString - - - - - -

    -
    -

    Produces a version of str with all nonprinting characters replaced by -\nnn notation and all special characters escaped.

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -2666
    -2667
    -2668
    -2669
    -2670
    -
    -
    # File 'src/string.c', line 2666
    -
    -mrb_value
    -mrb_str_dump(mrb_state *mrb, mrb_value str)
    -{
    -  return str_escape(mrb, str, FALSE);
    -}
    -
    -
    - -
    -

    - - #each_byte(&block) ⇒ Object - - - - - -

    -
    -

    Call the given block for each byte of +self+.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -194
    -195
    -196
    -197
    -198
    -199
    -200
    -201
    -202
    -203
    -
    -
    # 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
    -    block.call(bytes[pos])
    -    pos += 1
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #each_char(&block) ⇒ Object - - - - - -

    -
    -

    Call the given block for each character of -+self+.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -316
    -317
    -318
    -319
    -320
    -321
    -322
    -323
    -324
    -
    -
    # 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])
    -    pos += 1
    -  end
    -  self
    -end
    -
    -
    - -
    -

    - - #each_line(separator = "\n", &block) ⇒ Object - - - - - -

    -
    -

    Calls the given block for each line -and pass the respective line.

    - -

    ISO 15.2.10.5.15

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -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 14
    -
    -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
    -  self
    -end
    -
    -
    - -
    -

    - - #empty?Boolean - - - - - -

    -
    -

    Returns true if str has a length of zero.

    - -

    “hello”.empty? #=> false - ““.empty? #=> true

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1751
    -1752
    -1753
    -1754
    -1755
    -1756
    -1757
    -
    -
    # File 'src/string.c', line 1751
    -
    -static mrb_value
    -mrb_str_empty_p(mrb_state *mrb, mrb_value self)
    -{
    -  struct RString *s = mrb_str_ptr(self);
    -
    -  return mrb_bool_value(RSTR_LEN(s) == 0);
    -}
    -
    -
    - -
    -

    - - #end_with?([suffixes]) ⇒ Boolean - - - - - -

    -
    -

    Returns true if +str+ ends with one of the +suffixes+ given.

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -224
    -225
    -226
    -227
    -228
    -229
    -230
    -231
    -232
    -233
    -234
    -235
    -236
    -237
    -238
    -239
    -240
    -241
    -242
    -243
    -244
    -245
    -246
    -247
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 224
    -
    -static mrb_value
    -mrb_str_end_with(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value *argv, sub;
    -  mrb_int argc, i;
    -  mrb_get_args(mrb, "*", &argv, &argc);
    -
    -  for (i = 0; i < argc; i++) {
    -    size_t len_l, len_r;
    -    int ai = mrb_gc_arena_save(mrb);
    -    sub = mrb_ensure_string_type(mrb, argv[i]);
    -    mrb_gc_arena_restore(mrb, ai);
    -    len_l = RSTRING_LEN(self);
    -    len_r = RSTRING_LEN(sub);
    -    if (len_l >= len_r) {
    -      if (memcmp(RSTRING_PTR(self) + (len_l - len_r),
    -                 RSTRING_PTR(sub),
    -                 len_r) == 0) {
    -        return mrb_true_value();
    -      }
    -    }
    -  }
    -  return mrb_false_value();
    -}
    -
    -
    - -
    -

    - - #eql?(other) ⇒ Boolean - - - - - -

    -
    -

    Two strings are equal if the have the same length and content.

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1766
    -1767
    -1768
    -1769
    -1770
    -1771
    -1772
    -1773
    -1774
    -1775
    -1776
    -
    -
    # File 'src/string.c', line 1766
    -
    -static mrb_value
    -mrb_str_eql(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value str2;
    -  mrb_bool eql_p;
    -
    -  mrb_get_args(mrb, "o", &str2);
    -  eql_p = (mrb_string_p(str2)) && str_eql(mrb, self, str2);
    -
    -  return mrb_bool_value(eql_p);
    -}
    -
    -
    - -
    -

    - - #getbyte(index) ⇒ 0 .. 255 - - - - - -

    -
    -

    returns the indexth byte as an integer.

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

    Returns:

    -
      - -
    • - - - (0 .. 255) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -2785
    -2786
    -2787
    -2788
    -2789
    -2790
    -2791
    -2792
    -2793
    -2794
    -2795
    -2796
    -2797
    -
    -
    # File 'src/string.c', line 2785
    -
    -static mrb_value
    -mrb_str_getbyte(mrb_state *mrb, mrb_value str)
    -{
    -  mrb_int pos;
    -  mrb_get_args(mrb, "i", &pos);
    -
    -  if (pos < 0)
    -    pos += RSTRING_LEN(str);
    -  if (pos < 0 ||  RSTRING_LEN(str) <= pos)
    -    return mrb_nil_value();
    -
    -  return mrb_fixnum_value((unsigned char)RSTRING_PTR(str)[pos]);
    -}
    -
    -
    - -
    -

    - - #gsub(*args, &block) ⇒ Object - - - - - -

    -
    -

    Replace all matches of +pattern+ with +replacement+. -Call block (if given) for each match and replace -+pattern+ with the value of the block. Return the -final value.

    - -

    ISO 15.2.10.5.18

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -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
    -114
    -115
    -116
    -
    -
    # File 'mrblib/string.rb', line 87
    -
    -def gsub(*args, &block)
    -  return to_enum(:gsub, *args) if args.length == 1 && !block
    -  raise ArgumentError, "wrong number of arguments" unless (1..2).include?(args.length)
    -
    -  pattern, replace = *args
    -  plen = pattern.length
    -  if args.length == 2 && block
    -    block = nil
    -  end
    -  if !replace.nil? || !block
    -    replace.__to_str
    -  end
    -  offset = 0
    -  result = []
    -  while found = index(pattern, offset)
    -    result << self[offset, found - offset]
    -    offset = found + plen
    -    result << if block
    -      block.call(pattern).to_s
    -    else
    -      replace.__sub_replace(self[0, found], pattern, self[offset..-1] || "")
    -    end
    -    if plen == 0
    -      result << self[offset, 1]
    -      offset += 1
    -    end
    -  end
    -  result << self[offset..-1] if offset < length
    -  result.join
    -end
    -
    -
    - -
    -

    - - #gsub!(*args, &block) ⇒ Object - - - - - -

    -
    -

    Replace all matches of +pattern+ with +replacement+. -Call block (if given) for each match and replace -+pattern+ with the value of the block. Modify -+self+ with the final value.

    - -

    ISO 15.2.10.5.19

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -125
    -126
    -127
    -128
    -129
    -130
    -131
    -
    -
    # File 'mrblib/string.rb', line 125
    -
    -def gsub!(*args, &block)
    -  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 unless self.index(args[0])
    -  self.replace(str)
    -end
    -
    -
    - -
    -

    - - #hashFixnum - - - - - -

    -
    -

    Return a hash based on the string’s length and content.

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

    Returns:

    -
      - -
    • - - - (Fixnum) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1807
    -1808
    -1809
    -1810
    -1811
    -1812
    -
    -
    # File 'src/string.c', line 1807
    -
    -static mrb_value
    -mrb_str_hash_m(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int key = mrb_str_hash(mrb, self);
    -  return mrb_fixnum_value(key);
    -}
    -
    -
    - -
    -

    - - #hexObject - - - - - -

    - - - - -
    -
    -
    -
    -834
    -835
    -836
    -837
    -838
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 834
    -
    -static mrb_value
    -mrb_str_hex(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_str_to_inum(mrb, self, 16, FALSE);
    -}
    -
    -
    - -
    -

    - - - #include?(other_str) ⇒ Boolean - - #include?(fixnum) ⇒ Boolean - - - - - - -

    -
    -

    Returns true if str contains the given string or -character.

    - -

    “hello”.include? “lo” #=> true - “hello”.include? “ol” #=> false - “hello”.include? ?h #=> true

    - - -
    -
    -
    - -

    Overloads:

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

      Returns:

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

      Returns:

      -
        - -
      • - - - (Boolean) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -1827
    -1828
    -1829
    -1830
    -1831
    -1832
    -1833
    -1834
    -1835
    -1836
    -
    -
    # File 'src/string.c', line 1827
    -
    -static mrb_value
    -mrb_str_include(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value str2;
    -
    -  mrb_get_args(mrb, "S", &str2);
    -  if (str_index_str(mrb, self, str2, 0) < 0)
    -    return mrb_bool_value(FALSE);
    -  return mrb_bool_value(TRUE);
    -}
    -
    -
    - -
    -

    - - #index(substring[, offset]) ⇒ Fixnum? - - - - - -

    -
    -

    Returns the index of the first occurrence of the given -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(‘l’) #=> 2 - “hello”.index(‘lo’) #=> 3 - “hello”.index(‘a’) #=> nil - “hello”.index(‘l’, -2) #=> 3

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

    Returns:

    -
      - -
    • - - - (Fixnum, nil) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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 sub;
    -  mrb_int pos;
    -
    -  if (mrb_get_args(mrb, "S|i", &sub, &pos) == 1) {
    -    pos = 0;
    -  }
    -  else if (pos < 0) {
    -    mrb_int clen = RSTRING_CHAR_LEN(str);
    -    pos += clen;
    -    if (pos < 0) {
    -      return mrb_nil_value();
    -    }
    -  }
    -  pos = str_index_str_by_char(mrb, str, sub, pos);
    -
    -  if (pos == -1) return mrb_nil_value();
    -  BYTES_ALIGN_CHECK(pos);
    -  return mrb_fixnum_value(pos);
    -}
    -
    -
    - -
    -

    - - #replace(other_str) ⇒ String - - - - - -

    -
    -

    s = “hello” #=> “hello” - s.replace “world” #=> “world”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1885
    -1886
    -1887
    -1888
    -1889
    -1890
    -1891
    -1892
    -
    -
    # File 'src/string.c', line 1885
    -
    -static mrb_value
    -mrb_str_replace(mrb_state *mrb, mrb_value str)
    -{
    -  mrb_value str2;
    -
    -  mrb_get_args(mrb, "S", &str2);
    -  return str_replace(mrb, mrb_str_ptr(str), mrb_str_ptr(str2));
    -}
    -
    -
    - -
    -

    - - #insert(idx, str) ⇒ Object - - - - - -

    -
    -

    call-seq: - str.insert(index, other_str) -> str

    - -

    Inserts other_str before the character at the given - index, modifying str. Negative indices count from the - end of the string, and insert after the given character. - The intent is insert aString so that it starts at the given - index.

    - -
    "abcd".insert(0, 'X')    #=> "Xabcd"
    -"abcd".insert(3, 'X')    #=> "abcXd"
    -"abcd".insert(4, 'X')    #=> "abcdX"
    -"abcd".insert(-3, 'X')   #=> "abXcd"
    -"abcd".insert(-1, 'X')   #=> "abcdX"
    -
    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -254
    -255
    -256
    -257
    -258
    -259
    -260
    -261
    -262
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 254
    -
    -def insert(idx, str)
    -  if idx == -1
    -    return self << str
    -  elsif idx < 0
    -    idx += 1
    -  end
    -  self[idx, 0] = str
    -  self
    -end
    -
    -
    - -
    -

    - - #inspectString - - - - - -

    -
    -

    Returns a printable version of str, surrounded by quote marks, -with special characters escaped.

    - -

    str = “hello” - str[3] = “\b” - str.inspect #=> “"hel\bo"”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -2750
    -2751
    -2752
    -2753
    -2754
    -
    -
    # File 'src/string.c', line 2750
    -
    -mrb_value
    -mrb_str_inspect(mrb_state *mrb, mrb_value str)
    -{
    -  return str_escape(mrb, str, TRUE);
    -}
    -
    -
    - -
    -

    - - - #internObject - - #to_symObject - - - - - - -

    -
    -

    Returns the Symbol corresponding to str, creating the -symbol if it did not previously exist. See Symbol#id2name.

    - -

    “Koala”.intern #=> :Koala - s = ‘cat’.to_sym #=> :cat - s == :cat #=> true - s = ‘@cat’.to_sym #=> :@cat - s == :@cat #=> true

    - -

    This can also be used to create symbols that cannot be represented using the -:xxx notation.

    - -

    ‘cat and dog’.to_sym #=> :”cat and dog”

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1935
    -1936
    -1937
    -1938
    -1939
    -
    -
    # File 'src/string.c', line 1935
    -
    -MRB_API mrb_value
    -mrb_str_intern(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_symbol_value(mrb_intern_str(mrb, self));
    -}
    -
    -
    - -
    -

    - - - #lastObject - - #last(n) ⇒ Array - - - - - - -

    -
    -

    Returns the last object in the range, -or an array of the last +n+ elements.

    - -

    Note that with no arguments +last+ will return the object that defines -the end of the range even if #exclude_end? is +true+.

    - -

    (10..20).last #=> 20 - (10…20).last #=> 20 - (10..20).last(3) #=> [18, 19, 20] - (10…20).last(3) #=> [17, 18, 19]

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #lastObject -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #last(n) ⇒ Array -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -76
    -77
    -78
    -79
    -80
    -81
    -82
    -83
    -84
    -85
    -86
    -87
    -88
    -
    -
    # File 'mrbgems/mruby-range-ext/src/range.c', line 76
    -
    -static mrb_value
    -range_last(mrb_state *mrb, mrb_value range)
    -{
    -  mrb_value num;
    -  mrb_value array;
    -
    -  if (mrb_get_args(mrb, "|o", &num) == 0) {
    -    return mrb_range_end(mrb, range);
    -  }
    -
    -  array = mrb_funcall(mrb, range, "to_a", 0);
    -  return mrb_funcall(mrb, array, "last", 1, mrb_to_int(mrb, num));
    -}
    -
    -
    - -
    -

    - - #lengthInteger - - - - - -

    -
    -

    Same as sym.to_s.length.

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

    Returns:

    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -917
    -918
    -919
    -920
    -921
    -922
    -
    -
    # File 'src/string.c', line 917
    -
    -static mrb_value
    -mrb_str_size(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int len = RSTRING_CHAR_LEN(self);
    -  return mrb_fixnum_value(len);
    -}
    -
    -
    - -
    -

    - - #lines(&blk) ⇒ Object - - - - - -

    -
    -

    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.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -365
    -366
    -367
    -368
    -369
    -370
    -371
    -372
    -373
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 365
    -
    -def lines(&blk)
    -  lines = self.__lines
    -  if blk
    -    lines.each do |line|
    -      blk.call(line)
    -    end
    -  end
    -  lines
    -end
    -
    -
    - -
    -

    - - #ljust(idx, padstr = ' ') ⇒ Object - - - - - -

    -
    -

    call-seq: - str.ljust(integer, padstr=’ ‘) -> new_str

    - -

    If integer is greater than the length of str, returns a new - String of length integer with str left justified - and padded with padstr; otherwise, returns str.

    - -
    "hello".ljust(4)            #=> "hello"
    -"hello".ljust(20)           #=> "hello               "
    -"hello".ljust(20, '1234')   #=> "hello123412341234123"
    -
    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -275
    -276
    -277
    -278
    -279
    -280
    -281
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 275
    -
    -def ljust(idx, padstr = ' ')
    -  raise ArgumentError, 'zero width padding' if padstr == ''
    -  return self if idx <= self.size
    -  pad_repetitions = (idx / padstr.length).ceil
    -  padding = (padstr * pad_repetitions)[0...(idx - self.length)]
    -  self + padding
    -end
    -
    -
    - -
    -

    - - #lstripObject - - - - - -

    -
    -

    call-seq: - str.lstrip -> new_str

    - -

    Returns a copy of str with leading whitespace removed. See also -String#rstrip and String#strip.

    - -

    ” hello “.lstrip #=> “hello “ - “hello”.lstrip #=> “hello”

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -26
    -27
    -28
    -29
    -30
    -31
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 26
    -
    -def lstrip
    -  a = 0
    -  z = self.size - 1
    -  a += 1 while a <= z and " \f\n\r\t\v".include?(self[a])
    -  (z >= 0) ? self[a..z] : ""
    -end
    -
    -
    - -
    -

    - - #lstrip!Object - - - - - -

    -
    -

    call-seq: - str.lstrip! -> self or nil

    - -

    Removes leading whitespace from str, returning nil if no -change was made. See also String#rstrip! and -String#strip!.

    - -

    ” hello “.lstrip #=> “hello “ - “hello”.lstrip! #=> nil

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -78
    -79
    -80
    -81
    -82
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 78
    -
    -def lstrip!
    -  raise FrozenError, "can't modify frozen String" if frozen?
    -  s = self.lstrip
    -  (s == self) ? nil : self.replace(s)
    -end
    -
    -
    - -
    -

    - - #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;
    -}
    -
    -
    - -
    -

    - - #succString - - - - - -

    -
    -

    Returns next sequence of the string;

    - -

    a = “abc” - a.succ #=> “abd”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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 '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);
    -  }
    -
    -  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;
    -}
    -
    -
    - -
    -

    - - #octObject - - - - - -

    - - - - -
    -
    -
    -
    -840
    -841
    -842
    -843
    -844
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 840
    -
    -static mrb_value
    -mrb_str_oct(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_str_to_inum(mrb, self, 8, FALSE);
    -}
    -
    -
    - -
    -

    - - #ordObject - - - - - -

    - - - - -
    -
    -
    -
    -1053
    -1054
    -1055
    -1056
    -1057
    -1058
    -1059
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 1053
    -
    -static mrb_value
    -mrb_str_ord(mrb_state* mrb, mrb_value str)
    -{
    -  if (RSTRING_LEN(str) == 0)
    -    mrb_raise(mrb, E_ARGUMENT_ERROR, "empty string");
    -  return mrb_fixnum_value((unsigned char)RSTRING_PTR(str)[0]);
    -}
    -
    -
    - -
    -

    - - #partition(sep) ⇒ Object - - - - - -

    -
    - - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -144
    -145
    -146
    -147
    -148
    -149
    -150
    -151
    -152
    -153
    -
    -
    # 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
    -  n = index(sep)
    -  unless n.nil?
    -    m = n + sep.size
    -    [ slice(0, n), sep, slice(m, size - m) ]
    -  else
    -    [ self, "", "" ]
    -  end
    -end
    -
    -
    - -
    -

    - - #prepend(arg) ⇒ Object - - - - - -

    -
    -

    call-seq: - str.prepend(other_str) -> str

    - -

    Prepend—Prepend the given string to str.

    - -

    a = “world” - a.prepend(“hello “) #=> “hello world” - a #=> “hello world”

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -349
    -350
    -351
    -352
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 349
    -
    -def prepend(arg)
    -  self[0, 0] = arg
    -  self
    -end
    -
    -
    - -
    -

    - - #replace(other_str) ⇒ String - - - - - -

    -
    -

    s = “hello” #=> “hello” - s.replace “world” #=> “world”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -1885
    -1886
    -1887
    -1888
    -1889
    -1890
    -1891
    -1892
    -
    -
    # File 'src/string.c', line 1885
    -
    -static mrb_value
    -mrb_str_replace(mrb_state *mrb, mrb_value str)
    -{
    -  mrb_value str2;
    -
    -  mrb_get_args(mrb, "S", &str2);
    -  return str_replace(mrb, mrb_str_ptr(str), mrb_str_ptr(str2));
    -}
    -
    -
    - -
    -

    - - #reverseString - - - - - -

    -
    -

    Returns a new string with the characters from str in reverse order.

    - -

    “stressed”.reverse #=> “desserts”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -2051
    -2052
    -2053
    -2054
    -2055
    -2056
    -2057
    -
    -
    # File 'src/string.c', line 2051
    -
    -static mrb_value
    -mrb_str_reverse(mrb_state *mrb, mrb_value str)
    -{
    -  mrb_value str2 = mrb_str_dup(mrb, str);
    -  mrb_str_reverse_bang(mrb, str2);
    -  return str2;
    -}
    -
    -
    - -
    -

    - - #reverse!String - - - - - -

    -
    -

    Reverses str in place.

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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 = 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);
    -      str_reverse(p, p + clen - 1);
    -      p += clen;
    -    }
    -    goto bytes;
    -  }
    -#endif
    -
    -  if (RSTR_LEN(s) > 1) {
    -    mrb_str_modify(mrb, s);
    -    goto bytes;
    -  }
    -  return str;
    -
    - bytes:
    -  p = RSTR_PTR(s);
    -  e = p + RSTR_LEN(s) - 1;
    -  str_reverse(p, e);
    -  return str;
    -}
    -
    -
    - -
    -

    - - #rindex(substring[, offset]) ⇒ Fixnum? - - - - - -

    -
    -

    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(‘l’, 2) #=> 2

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

    Returns:

    -
      - -
    • - - - (Fixnum, nil) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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 sub;
    -  mrb_int pos, len = RSTRING_CHAR_LEN(str);
    -
    -  if (mrb_get_args(mrb, "S|i", &sub, &pos) == 1) {
    -    pos = len;
    -  }
    -  else {
    -    if (pos < 0) {
    -      pos += len;
    -      if (pos < 0) {
    -        return mrb_nil_value();
    -      }
    -    }
    -    if (pos > len) pos = len;
    -  }
    -  pos = chars2bytes(str, 0, pos);
    -  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();
    -}
    -
    -
    - -
    -

    - - #rjust(idx, padstr = ' ') ⇒ Object - - - - - -

    -
    -

    call-seq: - str.rjust(integer, padstr=’ ‘) -> new_str

    - -

    If integer is greater than the length of str, returns a new - String of length integer with str right justified - and padded with padstr; otherwise, returns str.

    - -
    "hello".rjust(4)            #=> "hello"
    -"hello".rjust(20)           #=> "               hello"
    -"hello".rjust(20, '1234')   #=> "123412341234123hello"
    -
    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -294
    -295
    -296
    -297
    -298
    -299
    -300
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 294
    -
    -def rjust(idx, padstr = ' ')
    -  raise ArgumentError, 'zero width padding' if padstr == ''
    -  return self if idx <= self.size
    -  pad_repetitions = (idx / padstr.length).ceil
    -  padding = (padstr * pad_repetitions)[0...(idx - self.length)]
    -  padding + self
    -end
    -
    -
    - -
    -

    - - #rpartition(sep) ⇒ Object - - - - - -

    -
    - - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -155
    -156
    -157
    -158
    -159
    -160
    -161
    -162
    -163
    -164
    -
    -
    # 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
    -  n = rindex(sep)
    -  unless n.nil?
    -    m = n + sep.size
    -    [ slice(0, n), sep, slice(m, size - m) ]
    -  else
    -    [ "", "", self ]
    -  end
    -end
    -
    -
    - -
    -

    - - #rstripObject - - - - - -

    -
    -

    call-seq: - str.rstrip -> new_str

    - -

    Returns a copy of str with trailing whitespace removed. See also -String#lstrip and String#strip.

    - -

    ” hello “.rstrip #=> “ hello” - “hello”.rstrip #=> “hello”

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -43
    -44
    -45
    -46
    -47
    -48
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 43
    -
    -def rstrip
    -  a = 0
    -  z = self.size - 1
    -  z -= 1 while a <= z and " \f\n\r\t\v\0".include?(self[z])
    -  (z >= 0) ? self[a..z] : ""
    -end
    -
    -
    - -
    -

    - - #rstrip!Object - - - - - -

    -
    -

    call-seq: - str.rstrip! -> self or nil

    - -

    Removes trailing whitespace from str, returning nil if -no change was made. See also String#lstrip! and -String#strip!.

    - -

    ” hello “.rstrip #=> “ hello” - “hello”.rstrip! #=> nil

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -95
    -96
    -97
    -98
    -99
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 95
    -
    -def rstrip!
    -  raise FrozenError, "can't modify frozen String" if frozen?
    -  s = self.rstrip
    -  (s == self) ? nil : self.replace(s)
    -end
    -
    -
    - -
    -

    - - #setbyte(index, integer) ⇒ Integer - - - - - -

    -
    -

    modifies the indexth byte as integer.

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

    Returns:

    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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)
    -{
    -  mrb_int pos, byte;
    -  mrb_int len;
    -
    -  mrb_get_args(mrb, "ii", &pos, &byte);
    -
    -  len = RSTRING_LEN(str);
    -  if (pos < -len || len <= pos)
    -    mrb_raisef(mrb, E_INDEX_ERROR, "index %i out of string", pos);
    -  if (pos < 0)
    -    pos += len;
    -
    -  mrb_str_modify(mrb, mrb_str_ptr(str));
    -  byte &= 0xff;
    -  RSTRING_PTR(str)[pos] = (unsigned char)byte;
    -  return mrb_fixnum_value((unsigned char)byte);
    -}
    -
    -
    - -
    -

    - - #lengthInteger - - - - - -

    -
    -

    Same as sym.to_s.length.

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

    Returns:

    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -917
    -918
    -919
    -920
    -921
    -922
    -
    -
    # File 'src/string.c', line 917
    -
    -static mrb_value
    -mrb_str_size(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int len = RSTRING_CHAR_LEN(self);
    -  return mrb_fixnum_value(len);
    -}
    -
    -
    - -
    -

    - - - #[](fixnum) ⇒ Fixnum? - - #[](fixnum, fixnum) ⇒ String? - - #[](range) ⇒ String? - - #[](regexp) ⇒ String? - - #[](regexp, fixnum) ⇒ String? - - #[](other_str) ⇒ String? - - #slice(fixnum) ⇒ Fixnum? - - #slice(fixnum, fixnum) ⇒ String? - - #slice(range) ⇒ String? - - #slice(other_str) ⇒ String? - - - - - - -

    -
    -

    Element Reference—If passed a single Fixnum, returns the code -of the character at that position. If passed two Fixnum -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 -characters 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.

    - -

    If a String is given, that string is returned if it occurs in -str. In both cases, nil is returned if there is no -match.

    - -

    a = “hello there” - a[1] #=> 101(1.8.7) “e”(1.9.2) - a[1.1] #=> “e”(1.9.2) - a[1,3] #=> “ell” - a[1..3] #=> “ell” - a[-3,2] #=> “er” - a[-4..-2] #=> “her” - a[12..-1] #=> nil - a[-2..-4] #=> “” - a[“lo”] #=> “lo” - a[“bye”] #=> nil

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #[](fixnum) ⇒ Fixnum? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Fixnum, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](fixnum, fixnum) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](range) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](regexp) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](regexp, fixnum) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](other_str) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice(fixnum) ⇒ Fixnum? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Fixnum, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice(fixnum, fixnum) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice(range) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #slice(other_str) ⇒ String? -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String, nil) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -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;
    -
    -  if (mrb_get_args(mrb, "o|o", &a1, &a2) == 1) {
    -    a2 = mrb_undef_value();
    -  }
    -
    -  return mrb_str_aref(mrb, str, a1, a2);
    -}
    -
    -
    - -
    -

    - - #slice!(arg1, arg2 = nil) ⇒ Object - - - - - -

    -
    -

    call-seq: - str.slice!(fixnum) -> new_str or nil - str.slice!(fixnum, fixnum) -> new_str or nil - str.slice!(range) -> new_str or nil - str.slice!(other_str) -> new_str or nil

    - -

    Deletes the specified portion from str, and returns the portion -deleted.

    - -

    string = “this is a string” - string.slice!(2) #=> “i” - string.slice!(3..6) #=> “ is “ - string.slice!(“r”) #=> “r” - string #=> “thsa sting”

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -182
    -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
    -229
    -230
    -231
    -232
    -233
    -234
    -235
    -236
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 182
    -
    -def slice!(arg1, arg2=nil)
    -  raise FrozenError, "can't modify frozen String" if frozen?
    -  raise "wrong number of arguments (for 1..2)" if arg1.nil? && arg2.nil?
    -
    -  if !arg1.nil? && !arg2.nil?
    -    idx = arg1
    -    idx += self.size if arg1 < 0
    -    if idx >= 0 && idx <= self.size && arg2 > 0
    -      str = self[idx, arg2]
    -    else
    -      return nil
    -    end
    -  else
    -    validated = false
    -    if arg1.kind_of?(Range)
    -      beg = arg1.begin
    -      ed = arg1.end
    -      beg += self.size if beg < 0
    -      ed += self.size if ed < 0
    -      ed -= 1 if arg1.exclude_end?
    -      validated = true
    -    elsif arg1.kind_of?(String)
    -      validated = true
    -    else
    -      idx = arg1
    -      idx += self.size if arg1 < 0
    -      validated = true if idx >=0 && arg1 < self.size
    -    end
    -    if validated
    -      str = self[arg1]
    -    else
    -      return nil
    -    end
    -  end
    -  unless str.nil? || str == ""
    -    if !arg1.nil? && !arg2.nil?
    -      idx = arg1 >= 0 ? arg1 : self.size+arg1
    -      str2 = self[0...idx] + self[idx+arg2..-1].to_s
    -    else
    -      if arg1.kind_of?(Range)
    -        idx = beg >= 0 ? beg : self.size+beg
    -        idx2 = ed>= 0 ? ed : self.size+ed
    -        str2 = self[0...idx] + self[idx2+1..-1].to_s
    -      elsif arg1.kind_of?(String)
    -        idx = self.index(arg1)
    -        str2 = self[0...idx] + self[idx+arg1.size..-1] unless idx.nil?
    -      else
    -        idx = arg1 >= 0 ? arg1 : self.size+arg1
    -        str2 = self[0...idx] + self[idx+1..-1].to_s
    -      end
    -    end
    -    self.replace(str2) unless str2.nil?
    -  end
    -  str
    -end
    -
    -
    - -
    -

    - - #split(pattern = "\n", [limit]) ⇒ Array - - - - - -

    -
    -

    Divides str into substrings based on a delimiter, returning an array -of these substrings.

    - -

    If pattern is a String, then its contents are used as -the delimiter when splitting str. If pattern is a single -space, str is split on whitespace, with leading whitespace and runs -of contiguous whitespace characters ignored.

    - -

    If pattern is a Regexp, str is divided where the -pattern matches. Whenever the pattern matches a zero-length string, -str is split into individual characters.

    - -

    If pattern is omitted, the value of $; is used. If -$; is nil (which is the default), str is -split on whitespace as if ‘ ‘ were specified.

    - -

    If the limit parameter is omitted, trailing null fields are -suppressed. If limit is a positive number, at most that number of -fields will be returned (if limit is 1, the entire -string is returned as the only entry in an array). If negative, there is no -limit to the number of fields returned, and trailing null fields are not -suppressed.

    - -

    ” now’s the time”.split #=> [“now’s”, “the”, “time”] - “ now’s the time”.split(‘ ‘) #=> [“now’s”, “the”, “time”] - “ now’s the time”.split(/ /) #=> [””, “now’s”, “”, “the”, “time”] - “hello”.split(//) #=> [“h”, “e”, “l”, “l”, “o”] - “hello”.split(//, 3) #=> [“h”, “e”, “llo”]

    - -

    “mellow yellow”.split(“ello”) #=> [“m”, “w y”, “w”] - “1,2,,3,4,,”.split(‘,’) #=> [“1”, “2”, “”, “3”, “4”] - “1,2,,3,4,,”.split(‘,’, 4) #=> [“1”, “2”, “”, “3,4,,”] - “1,2,,3,4,,”.split(‘,’, -4) #=> [“1”, “2”, “”, “3”, “4”, “”, “”]

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'src/string.c', line 2143
    -
    -static mrb_value
    -mrb_str_split_m(mrb_state *mrb, mrb_value str)
    -{
    -  mrb_int argc;
    -  mrb_value spat = mrb_nil_value();
    -  enum {awk, string, regexp} split_type = string;
    -  mrb_int i = 0;
    -  mrb_int beg;
    -  mrb_int end;
    -  mrb_int lim = 0;
    -  mrb_bool lim_p;
    -  mrb_value result, tmp;
    -
    -  argc = mrb_get_args(mrb, "|oi", &spat, &lim);
    -  lim_p = (lim > 0 && argc == 2);
    -  if (argc == 2) {
    -    if (lim == 1) {
    -      if (RSTRING_LEN(str) == 0)
    -        return mrb_ary_new_capa(mrb, 0);
    -      return mrb_ary_new_from_values(mrb, 1, &str);
    -    }
    -    i = 1;
    -  }
    -
    -  if (argc == 0 || mrb_nil_p(spat)) {
    -    split_type = awk;
    -  }
    -  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);
    -  beg = 0;
    -  if (split_type == awk) {
    -    mrb_bool skip = TRUE;
    -    mrb_int idx = 0;
    -    mrb_int str_len = RSTRING_LEN(str);
    -    unsigned int c;
    -    int ai = mrb_gc_arena_save(mrb);
    -
    -    idx = end = beg;
    -    while (idx < str_len) {
    -      c = (unsigned char)RSTRING_PTR(str)[idx++];
    -      if (skip) {
    -        if (ISSPACE(c)) {
    -          beg = idx;
    -        }
    -        else {
    -          end = idx;
    -          skip = FALSE;
    -          if (lim_p && lim <= i) break;
    -        }
    -      }
    -      else if (ISSPACE(c)) {
    -        mrb_ary_push(mrb, result, mrb_str_byte_subseq(mrb, str, beg, end-beg));
    -        mrb_gc_arena_restore(mrb, ai);
    -        skip = TRUE;
    -        beg = idx;
    -        if (lim_p) ++i;
    -      }
    -      else {
    -        end = idx;
    -      }
    -    }
    -  }
    -  else {                        /* split_type == string */
    -    mrb_int str_len = RSTRING_LEN(str);
    -    mrb_int pat_len = RSTRING_LEN(spat);
    -    mrb_int idx = 0;
    -    int ai = mrb_gc_arena_save(mrb);
    -
    -    while (idx < str_len) {
    -      if (pat_len > 0) {
    -        end = mrb_memsearch(RSTRING_PTR(spat), pat_len, RSTRING_PTR(str)+idx, str_len - idx);
    -        if (end < 0) break;
    -      }
    -      else {
    -        end = chars2bytes(str, idx, 1);
    -      }
    -      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;
    -  }
    -  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 = mrb_str_byte_subseq(mrb, str, beg, RSTRING_LEN(str)-beg);
    -    }
    -    mrb_ary_push(mrb, result, tmp);
    -  }
    -  if (!lim_p && lim == 0) {
    -    mrb_int len;
    -    while ((len = RARRAY_LEN(result)) > 0 &&
    -           (tmp = RARRAY_PTR(result)[len-1], RSTRING_LEN(tmp) == 0))
    -      mrb_ary_pop(mrb, result);
    -  }
    -
    -  return result;
    -}
    -
    -
    - -
    -

    - - #squeeze([other_str]) ⇒ String - - - - - -

    -
    -

    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.

    - -

    “yellow moon”.squeeze #=> “yelow mon” - “ now is the”.squeeze(“ “) #=> “ now is the” - “putters shoot balls”.squeeze(“m-z”) #=> “puters shot balls”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -712
    -713
    -714
    -715
    -716
    -717
    -718
    -719
    -720
    -721
    -722
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 712
    -
    -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) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -731
    -732
    -733
    -734
    -735
    -736
    -737
    -738
    -739
    -740
    -741
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 731
    -
    -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:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -195
    -196
    -197
    -198
    -199
    -200
    -201
    -202
    -203
    -204
    -205
    -206
    -207
    -208
    -209
    -210
    -211
    -212
    -213
    -214
    -215
    -216
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 195
    -
    -static mrb_value
    -mrb_str_start_with(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value *argv, sub;
    -  mrb_int argc, i;
    -  mrb_get_args(mrb, "*", &argv, &argc);
    -
    -  for (i = 0; i < argc; i++) {
    -    size_t len_l, len_r;
    -    int ai = mrb_gc_arena_save(mrb);
    -    sub = mrb_ensure_string_type(mrb, argv[i]);
    -    mrb_gc_arena_restore(mrb, ai);
    -    len_l = RSTRING_LEN(self);
    -    len_r = RSTRING_LEN(sub);
    -    if (len_l >= len_r) {
    -      if (memcmp(RSTRING_PTR(self), RSTRING_PTR(sub), len_r) == 0) {
    -        return mrb_true_value();
    -      }
    -    }
    -  }
    -  return mrb_false_value();
    -}
    -
    -
    - -
    -

    - - #stripObject - - - - - -

    -
    -

    call-seq: - str.strip -> new_str

    - -

    Returns a copy of str with leading and trailing whitespace removed.

    - -

    ” hello “.strip #=> “hello” - “\tgoodbye\r\n”.strip #=> “goodbye”

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -59
    -60
    -61
    -62
    -63
    -64
    -65
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 59
    -
    -def strip
    -  a = 0
    -  z = self.size - 1
    -  a += 1 while a <= z and " \f\n\r\t\v".include?(self[a])
    -  z -= 1 while a <= z and " \f\n\r\t\v\0".include?(self[z])
    -  (z >= 0) ? self[a..z] : ""
    -end
    -
    -
    - -
    -

    - - #strip!Object - - - - - -

    -
    -

    call-seq: - str.strip! -> str or nil

    - -

    Removes leading and trailing whitespace from str. Returns - nil if str was not altered.

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -108
    -109
    -110
    -111
    -112
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 108
    -
    -def strip!
    -  raise FrozenError, "can't modify frozen String" if frozen?
    -  s = self.strip
    -  (s == self) ? nil : self.replace(s)
    -end
    -
    -
    - -
    -

    - - #sub(*args, &block) ⇒ Object - - - - - -

    -
    -

    Replace only the first match of +pattern+ with -+replacement+. Call block (if given) for each -match and replace +pattern+ with the value of the -block. Return the final value.

    - -

    ISO 15.2.10.5.36

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'mrblib/string.rb', line 150
    -
    -def sub(*args, &block)
    -  unless (1..2).include?(args.length)
    -    raise ArgumentError, "wrong number of arguments (given #{args.length}, expected 2)"
    -  end
    -
    -  pattern, replace = *args
    -  pattern.__to_str
    -  if args.length == 2 && block
    -    block = nil
    -  end
    -  unless block
    -    replace.__to_str
    -  end
    -  result = []
    -  this = dup
    -  found = index(pattern)
    -  return this unless found
    -  result << this[0, found]
    -  offset = found + pattern.length
    -  result << if block
    -    block.call(pattern).to_s
    -  else
    -    replace.__sub_replace(this[0, found], pattern, this[offset..-1] || "")
    -  end
    -  result << this[offset..-1] if offset < length
    -  result.join
    -end
    -
    -
    - -
    -

    - - #sub!(*args, &block) ⇒ Object - - - - - -

    -
    -

    Replace only the first match of +pattern+ with -+replacement+. Call block (if given) for each -match and replace +pattern+ with the value of the -block. Modify +self+ with the final value.

    - -

    ISO 15.2.10.5.37

    - - -
    -
    -
    - -

    Raises:

    - - -
    - - - - - - -
    -
    -
    -
    -185
    -186
    -187
    -188
    -189
    -190
    -
    -
    # File 'mrblib/string.rb', line 185
    -
    -def sub!(*args, &block)
    -  raise FrozenError, "can't modify frozen String" if frozen?
    -  str = self.sub(*args, &block)
    -  return nil unless self.index(args[0])
    -  self.replace(str)
    -end
    -
    -
    - -
    -

    - - #succObject - - - - - -

    - - - - -
    -
    -
    -
    -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;
    -}
    -
    -
    - -
    -

    - - #succString - - - - - -

    -
    -

    Returns next sequence of the string;

    - -

    a = “abc” - a.succ #=> “abd”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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 '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);
    -  }
    -
    -  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;
    -}
    -
    -
    - -
    -

    - - #swapcaseString - - - - - -

    -
    -

    Returns a copy of str with uppercase alphabetic characters converted -to lowercase and lowercase characters converted to uppercase. -Note: case conversion is effective only in ASCII region.

    - -

    “Hello”.swapcase #=> “hELLO” - “cYbEr_PuNk11”.swapcase #=> “CyBeR_pUnK11”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -138
    -139
    -140
    -141
    -142
    -143
    -144
    -145
    -146
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 138
    -
    -static mrb_value
    -mrb_str_swapcase(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value str;
    -
    -  str = mrb_str_dup(mrb, self);
    -  mrb_str_swapcase_bang(mrb, str);
    -  return str;
    -}
    -
    -
    - -
    -

    - - #swapcase!String? - - - - - -

    -
    -

    Equivalent to String#swapcase, but modifies the receiver in -place, returning str, or nil if no changes were made. -Note: case conversion is effective only in ASCII region.

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

    Returns:

    -
      - -
    • - - - (String, nil) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -101
    -102
    -103
    -104
    -105
    -106
    -107
    -108
    -109
    -110
    -111
    -112
    -113
    -114
    -115
    -116
    -117
    -118
    -119
    -120
    -121
    -122
    -123
    -124
    -125
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 101
    -
    -static mrb_value
    -mrb_str_swapcase_bang(mrb_state *mrb, mrb_value str)
    -{
    -  char *p, *pend;
    -  int modify = 0;
    -  struct RString *s = mrb_str_ptr(str);
    -
    -  mrb_str_modify(mrb, s);
    -  p = RSTRING_PTR(str);
    -  pend = p + RSTRING_LEN(str);
    -  while (p < pend) {
    -    if (ISUPPER(*p)) {
    -      *p = TOLOWER(*p);
    -      modify = 1;
    -    }
    -    else if (ISLOWER(*p)) {
    -      *p = TOUPPER(*p);
    -      modify = 1;
    -    }
    -    p++;
    -  }
    -
    -  if (modify) return str;
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #to_fFloat - - - - - -

    -
    -

    Returns the result of interpreting leading characters in str as a -floating point number. Extraneous characters past the end of a valid number -are ignored. If there is not a valid number at the start of str, -0.0 is returned. This method never raises an exception.

    - -

    “123.45e1”.to_f #=> 1234.5 - “45.67 degrees”.to_f #=> 45.67 - “thx1138”.to_f #=> 0.0

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

    Returns:

    -
      - -
    • - - - (Float) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -2585
    -2586
    -2587
    -2588
    -2589
    -
    -
    # File 'src/string.c', line 2585
    -
    -static mrb_value
    -mrb_str_to_f(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_float_value(mrb, mrb_str_to_dbl(mrb, self, FALSE));
    -}
    -
    -
    - -
    -

    - - #to_i(base = 10) ⇒ Integer - - - - - -

    -
    -

    Returns the result of interpreting leading characters in str as an -integer base base (between 2 and 36). Extraneous characters past the -end of a valid number are ignored. If there is not a valid number at the -start of str, 0 is returned. This method never raises an -exception.

    - -

    “12345”.to_i #=> 12345 - “99 red balloons”.to_i #=> 99 - “0a”.to_i #=> 0 - “0a”.to_i(16) #=> 10 - “hello”.to_i #=> 0 - “1100101”.to_i(2) #=> 101 - “1100101”.to_i(8) #=> 294977 - “1100101”.to_i(10) #=> 1100101 - “1100101”.to_i(16) #=> 17826049

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

    Returns:

    - - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -2489
    -2490
    -2491
    -2492
    -2493
    -2494
    -2495
    -2496
    -2497
    -2498
    -2499
    -
    -
    # File 'src/string.c', line 2489
    -
    -static mrb_value
    -mrb_str_to_i(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int base = 10;
    -
    -  mrb_get_args(mrb, "|i", &base);
    -  if (base < 0) {
    -    mrb_raisef(mrb, E_ARGUMENT_ERROR, "illegal radix %i", base);
    -  }
    -  return mrb_str_to_inum(mrb, self, base, FALSE);
    -}
    -
    -
    - -
    -

    - - #to_sString - - - - - -

    -
    -

    Returns the receiver.

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -2599
    -2600
    -2601
    -2602
    -2603
    -2604
    -2605
    -2606
    -
    -
    # File 'src/string.c', line 2599
    -
    -static mrb_value
    -mrb_str_to_s(mrb_state *mrb, mrb_value self)
    -{
    -  if (mrb_obj_class(mrb, self) != mrb->string_class) {
    -    return mrb_str_dup(mrb, self);
    -  }
    -  return self;
    -}
    -
    -
    - -
    -

    - - #to_sString - - - - - -

    -
    -

    Returns the receiver.

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -2599
    -2600
    -2601
    -2602
    -2603
    -2604
    -2605
    -2606
    -
    -
    # File 'src/string.c', line 2599
    -
    -static mrb_value
    -mrb_str_to_s(mrb_state *mrb, mrb_value self)
    -{
    -  if (mrb_obj_class(mrb, self) != mrb->string_class) {
    -    return mrb_str_dup(mrb, self);
    -  }
    -  return self;
    -}
    -
    -
    - -
    -

    - - - #internObject - - #to_symObject - - - - - - -

    -
    -

    Returns the Symbol corresponding to str, creating the -symbol if it did not previously exist. See Symbol#id2name.

    - -

    “Koala”.intern #=> :Koala - s = ‘cat’.to_sym #=> :cat - s == :cat #=> true - s = ‘@cat’.to_sym #=> :@cat - s == :@cat #=> true

    - -

    This can also be used to create symbols that cannot be represented using the -:xxx notation.

    - -

    ‘cat and dog’.to_sym #=> :”cat and dog”

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -1935
    -1936
    -1937
    -1938
    -1939
    -
    -
    # File 'src/string.c', line 1935
    -
    -MRB_API mrb_value
    -mrb_str_intern(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_symbol_value(mrb_intern_str(mrb, self));
    -}
    -
    -
    - -
    -

    - - #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. If to_str is shorter than from_str, -it is padded with its last character in order to maintain the -correspondence.

    - -

    “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.

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -576
    -577
    -578
    -579
    -580
    -581
    -582
    -583
    -584
    -585
    -586
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 576
    -
    -static mrb_value
    -mrb_str_tr(mrb_state *mrb, mrb_value str)
    -{
    -  mrb_value dup;
    -  mrb_value p1, p2;
    -
    -  mrb_get_args(mrb, "SS", &p1, &p2);
    -  dup = mrb_str_dup(mrb, str);
    -  str_tr(mrb, dup, p1, p2, FALSE);
    -  return dup;
    -}
    -
    -
    - -
    -

    - - #tr!(from_str, to_str) ⇒ String? - - - - - -

    -
    -

    Translates str in place, using the same rules as String#tr. -Returns str, or nil if no changes were made.

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

    Returns:

    -
      - -
    • - - - (String, nil) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -595
    -596
    -597
    -598
    -599
    -600
    -601
    -602
    -603
    -604
    -605
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 595
    -
    -static mrb_value
    -mrb_str_tr_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, FALSE)) {
    -    return str;
    -  }
    -  return mrb_nil_value();
    -}
    -
    -
    - -
    -

    - - #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.

    - -

    “hello”.tr_s(‘l’, ‘r’) #=> “hero” - “hello”.tr_s(‘el’, ‘’) #=> “ho” - “hello”.tr_s(‘el’, ‘hx’) #=> “hhxo”

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

    Returns:

    -
      - -
    • - - - (String) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -618
    -619
    -620
    -621
    -622
    -623
    -624
    -625
    -626
    -627
    -628
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 618
    -
    -static mrb_value
    -mrb_str_tr_s(mrb_state *mrb, mrb_value str)
    -{
    -  mrb_value dup;
    -  mrb_value p1, p2;
    -
    -  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? - - - - - -

    -
    -

    Performs String#tr_s processing on str in place, returning -str, or nil if no changes were made.

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

    Returns:

    -
      - -
    • - - - (String, nil) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -637
    -638
    -639
    -640
    -641
    -642
    -643
    -644
    -645
    -646
    -647
    -
    -
    # File 'mrbgems/mruby-string-ext/src/string.c', line 637
    -
    -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) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -2649
    -2650
    -2651
    -2652
    -2653
    -2654
    -2655
    -2656
    -2657
    -
    -
    # File 'src/string.c', line 2649
    -
    -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) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -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)
    -{
    -  struct RString *s = mrb_str_ptr(str);
    -  char *p, *pend;
    -  mrb_bool modify = FALSE;
    -
    -  mrb_str_modify_keep_ascii(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:

    - - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'mrbgems/mruby-string-ext/mrblib/string.rb', line 405
    -
    -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(__ENCODING__)
    -      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
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Struct.html b/docs/api/Struct.html deleted file mode 100644 index 9ed2f52..0000000 --- a/docs/api/Struct.html +++ /dev/null @@ -1,2300 +0,0 @@ - - - - - - - Class: Struct - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Struct - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-struct/src/struct.c,
    - mrbgems/mruby-struct/mrblib/struct.rb
    -
    -
    - -
    - - - - - - - - - -

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #==(other_struct) ⇒ Boolean - - - - - - - - - - - - - -

      Equality—Returns true if other_struct is equal to this one: they must be of the same class as generated by Struct::new, and the values of all instance variables must be equal (according to Object#==).

      -
      - -
    • - - -
    • - - - #[] ⇒ Object - - - - - - - - - - - - - -

      Attribute Reference—Returns the value of the instance variable named by symbol, or indexed (0..length-1) by fixnum.

      -
      - -
    • - - -
    • - - - #[]= ⇒ Object - - - - - - - - - - - - - -

      Attribute Assignment—Assigns to the instance variable named by symbol or fixnum the value obj and returns it.

      -
      - -
    • - - -
    • - - - #_inspect(recur_list) ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #dig(idx, *args) ⇒ Object - - - - - - - - - - - - - -

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

      -
      - -
    • - - -
    • - - - #each(&block) ⇒ Object - - - - - - - - - - - - - -

      Calls the given block for each element of +self+ and pass the respective element.

      -
      - -
    • - - -
    • - - - #each_pair(&block) ⇒ Object - - - - - - - - - - - - - -

      Calls the given block for each element of +self+ and pass the name and value of the respectiev element.

      -
      - -
    • - - -
    • - - - #eql? ⇒ Boolean - - - - - - - - - - - - - -

      code-seq: struct.eql?(other) -> true or false.

      -
      - -
    • - - -
    • - - - #initialize ⇒ Object - - - - - - - constructor - - - - - - - - -

      15.2.18.4.8.

      -
      - -
    • - - -
    • - - - #initialize_copy ⇒ Object - - - - - - - - - - - - - -

      :nodoc:.

      -
      - -
    • - - -
    • - - - #inspect ⇒ Object - - - - (also: #to_s) - - - - - - - - - - - -

      call-seq: struct.to_s -> string struct.inspect -> string.

      -
      - -
    • - - -
    • - - - #length ⇒ Object - - - - - - - - - - - - - -

      Returns number of struct members.

      -
      - -
    • - - -
    • - - - #members ⇒ Array - - - - - - - - - - - - - -

      Returns an array of strings representing the names of the instance variables.

      -
      - -
    • - - -
    • - - - #select(&block) ⇒ Object - - - - - - - - - - - - - -

      Calls the given block for each element of +self+ and returns an array with all elements of which block is not false.

      -
      - -
    • - - -
    • - - - #size ⇒ Object - - - - - - - - - - - - - -

      Returns number of struct members.

      -
      - -
    • - - -
    • - - - #to_a ⇒ Object - - - - - - - - - - - - - -

      Create an array from struct values.

      -
      - -
    • - - -
    • - - - #to_h ⇒ Hash - - - - - - - - - - - - - -

      Create a hash from member names and struct values.

      -
      - -
    • - - -
    • - - - #values ⇒ Object - - - - - - - - - - - - - -

      Create an array from struct values.

      -
      - -
    • - - -
    • - - - #values_at ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    - - -
    -

    Constructor Details

    - -
    -

    - - #initializeObject - - - - - -

    -
    -

    15.2.18.4.8

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -344
    -345
    -346
    -347
    -348
    -349
    -350
    -351
    -352
    -
    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 344
    -
    -static mrb_value
    -mrb_struct_initialize(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value *argv;
    -  mrb_int argc;
    -
    -  mrb_get_args(mrb, "*!", &argv, &argc);
    -  return mrb_struct_initialize_withArg(mrb, argc, argv, self);
    -}
    -
    -
    - -
    - - -
    -

    Instance Method Details

    - - -
    -

    - - #==(other_struct) ⇒ Boolean - - - - - -

    -
    -

    Equality—Returns true if other_struct is -equal to this one: they must be of the same class as generated by -Struct::new, and the values of all instance variables -must be equal (according to Object#==).

    - -

    Customer = Struct.new(:name, :address, :zip) - joe = Customer.new(“Joe Smith”, “123 Maple, Anytown NC”, 12345) - joejr = Customer.new(“Joe Smith”, “123 Maple, Anytown NC”, 12345) - jane = Customer.new(“Jane Doe”, “456 Elm, Anytown NC”, 12345) - joe == joejr #=> true - joe == jane #=> false

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -545
    -546
    -547
    -548
    -549
    -550
    -551
    -552
    -553
    -554
    -555
    -556
    -557
    -558
    -559
    -560
    -561
    -562
    -563
    -564
    -565
    -566
    -567
    -568
    -569
    -570
    -571
    -572
    -
    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 545
    -
    -static mrb_value
    -mrb_struct_equal(mrb_state *mrb, mrb_value s)
    -{
    -  mrb_value s2;
    -  mrb_value *ptr, *ptr2;
    -  mrb_int i, len;
    -
    -  mrb_get_args(mrb, "o", &s2);
    -  if (mrb_obj_equal(mrb, s, s2)) {
    -    return mrb_true_value();
    -  }
    -  if (mrb_obj_class(mrb, s) != mrb_obj_class(mrb, s2)) {
    -    return mrb_false_value();
    -  }
    -  if (RSTRUCT_LEN(s) != RSTRUCT_LEN(s2)) {
    -    mrb_bug(mrb, "inconsistent struct"); /* should never happen */
    -  }
    -  ptr = RSTRUCT_PTR(s);
    -  ptr2 = RSTRUCT_PTR(s2);
    -  len = RSTRUCT_LEN(s);
    -  for (i=0; i<len; i++) {
    -    if (!mrb_equal(mrb, ptr[i], ptr2[i])) {
    -      return mrb_false_value();
    -    }
    -  }
    -
    -  return mrb_true_value();
    -}
    -
    -
    - -
    -

    - - - #[](symbol) ⇒ Object - - #[](fixnum) ⇒ Object - - - - - - -

    -
    -

    Attribute Reference—Returns the value of the instance variable -named by symbol, or indexed (0..length-1) by -fixnum. Will raise NameError if the named -variable does not exist, or IndexError if the index is -out of range.

    - -

    Customer = Struct.new(:name, :address, :zip) - joe = Customer.new(“Joe Smith”, “123 Maple, Anytown NC”, 12345)

    - -

    joe[“name”] #=> “Joe Smith” - joe[:name] #=> “Joe Smith” - joe[0] #=> “Joe Smith”

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #[](symbol) ⇒ Object -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[](fixnum) ⇒ Object -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -428
    -429
    -430
    -431
    -432
    -433
    -434
    -435
    -436
    -437
    -438
    -439
    -440
    -441
    -442
    -443
    -444
    -445
    -446
    -
    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 428
    -
    -static mrb_value
    -mrb_struct_aref(mrb_state *mrb, mrb_value s)
    -{
    -  mrb_value idx;
    -
    -  mrb_get_args(mrb, "o", &idx);
    -  if (mrb_string_p(idx)) {
    -    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 '%v' in struct", idx);
    -    }
    -    idx = sym;
    -  }
    -  if (mrb_symbol_p(idx)) {
    -    return struct_aref_sym(mrb, s, mrb_symbol(idx));
    -  }
    -  return struct_aref_int(mrb, s, mrb_int(mrb, idx));
    -}
    -
    -
    - -
    -

    - - - #[]=(symbol) ⇒ Object - - #[]=(fixnum) ⇒ Object - - - - - - -

    -
    -

    Attribute Assignment—Assigns to the instance variable named by -symbol or fixnum the value obj and -returns it. Will raise a NameError if the named -variable does not exist, or an IndexError if the index -is out of range.

    - -

    Customer = Struct.new(:name, :address, :zip) - joe = Customer.new(“Joe Smith”, “123 Maple, Anytown NC”, 12345)

    - -

    joe[“name”] = “Luke” - joe[:zip] = “90210”

    - -

    joe.name #=> “Luke” - joe.zip #=> “90210”

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #[]=(symbol) ⇒ Object -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #[]=(fixnum) ⇒ Object -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Object) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -492
    -493
    -494
    -495
    -496
    -497
    -498
    -499
    -500
    -501
    -502
    -503
    -504
    -505
    -506
    -507
    -508
    -509
    -510
    -511
    -512
    -513
    -514
    -515
    -516
    -517
    -518
    -519
    -520
    -521
    -522
    -523
    -524
    -525
    -
    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 492
    -
    -static mrb_value
    -mrb_struct_aset(mrb_state *mrb, mrb_value s)
    -{
    -  mrb_int i;
    -  mrb_value idx;
    -  mrb_value val;
    -
    -  mrb_get_args(mrb, "oo", &idx, &val);
    -
    -  if (mrb_string_p(idx)) {
    -    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 '%v' in struct", idx);
    -    }
    -    idx = sym;
    -  }
    -  if (mrb_symbol_p(idx)) {
    -    return mrb_struct_aset_sym(mrb, s, mrb_symbol(idx), val);
    -  }
    -
    -  i = mrb_int(mrb, idx);
    -  if (i < 0) i = RSTRUCT_LEN(s) + i;
    -  if (i < 0) {
    -    mrb_raisef(mrb, E_INDEX_ERROR,
    -               "offset %i too small for struct(size:%i)", i, RSTRUCT_LEN(s));
    -  }
    -  if (RSTRUCT_LEN(s) <= i) {
    -    mrb_raisef(mrb, E_INDEX_ERROR,
    -               "offset %i too large for struct(size:%i)", i, RSTRUCT_LEN(s));
    -  }
    -  mrb_struct_modify(mrb, s);
    -  return RSTRUCT_PTR(s)[i] = val;
    -}
    -
    -
    - -
    -

    - - #_inspect(recur_list) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -61
    -62
    -63
    -
    -
    # File 'mrbgems/mruby-struct/mrblib/struct.rb', line 49
    -
    -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 "
    -  else
    -    str = "#<struct #{name} "
    -  end
    -  buf = []
    -  self.each_pair do |k,v|
    -    buf.push [k.to_s + "=" + v._inspect(recur_list)]
    -  end
    -  str + buf.join(", ") + ">"
    -end
    -
    -
    - -
    -

    - - #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+.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -91
    -92
    -93
    -94
    -95
    -96
    -97
    -98
    -
    -
    # File 'mrbgems/mruby-struct/mrblib/struct.rb', line 91
    -
    -def dig(idx,*args)
    -  n = self[idx]
    -  if args.size > 0
    -    n&.dig(*args)
    -  else
    -    n
    -  end
    -end
    -
    -
    - -
    -

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

    -
    -

    Calls the given block for each element of +self+ -and pass the respective element.

    - -

    ISO 15.2.18.4.4

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -14
    -15
    -16
    -17
    -18
    -19
    -
    -
    # File 'mrbgems/mruby-struct/mrblib/struct.rb', line 14
    -
    -def each(&block)
    -  self.class.members.each{|field|
    -    block.call(self[field])
    -  }
    -  self
    -end
    -
    -
    - -
    -

    - - #each_pair(&block) ⇒ Object - - - - - -

    -
    -

    Calls the given block for each element of +self+ -and pass the name and value of the respectiev -element.

    - -

    ISO 15.2.18.4.5

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -27
    -28
    -29
    -30
    -31
    -32
    -
    -
    # File 'mrbgems/mruby-struct/mrblib/struct.rb', line 27
    -
    -def each_pair(&block)
    -  self.class.members.each{|field|
    -    block.call(field.to_sym, self[field])
    -  }
    -  self
    -end
    -
    -
    - -
    -

    - - #eql?Boolean - - - - - -

    -
    -

    code-seq: - struct.eql?(other) -> true or false

    - -

    Two structures are equal if they are the same object, or if all their -fields are equal (using eql?).

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 582
    -
    -static mrb_value
    -mrb_struct_eql(mrb_state *mrb, mrb_value s)
    -{
    -  mrb_value s2;
    -  mrb_value *ptr, *ptr2;
    -  mrb_int i, len;
    -
    -  mrb_get_args(mrb, "o", &s2);
    -  if (mrb_obj_equal(mrb, s, s2)) {
    -    return mrb_true_value();
    -  }
    -  if (mrb_obj_class(mrb, s) != mrb_obj_class(mrb, s2)) {
    -    return mrb_false_value();
    -  }
    -  if (RSTRUCT_LEN(s) != RSTRUCT_LEN(s2)) {
    -    mrb_bug(mrb, "inconsistent struct"); /* should never happen */
    -  }
    -  ptr = RSTRUCT_PTR(s);
    -  ptr2 = RSTRUCT_PTR(s2);
    -  len = RSTRUCT_LEN(s);
    -  for (i=0; i<len; i++) {
    -    if (!mrb_eql(mrb, ptr[i], ptr2[i])) {
    -      return mrb_false_value();
    -    }
    -  }
    -
    -  return mrb_true_value();
    -}
    -
    -
    - -
    -

    - - #initialize_copyObject - - - - - -

    -
    -

    :nodoc:

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -356
    -357
    -358
    -359
    -360
    -361
    -362
    -363
    -364
    -365
    -366
    -367
    -368
    -369
    -370
    -371
    -372
    -
    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 356
    -
    -static mrb_value
    -mrb_struct_init_copy(mrb_state *mrb, mrb_value copy)
    -{
    -  mrb_value s;
    -
    -  mrb_get_args(mrb, "o", &s);
    -
    -  if (mrb_obj_equal(mrb, copy, s)) return copy;
    -  if (!mrb_obj_is_instance_of(mrb, s, mrb_obj_class(mrb, copy))) {
    -    mrb_raise(mrb, E_TYPE_ERROR, "wrong argument class");
    -  }
    -  if (!mrb_array_p(s)) {
    -    mrb_raise(mrb, E_TYPE_ERROR, "corrupted struct");
    -  }
    -  mrb_ary_replace(mrb, copy, s);
    -  return copy;
    -}
    -
    -
    - -
    -

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

    -
    -

    call-seq: - struct.to_s -> string - struct.inspect -> string

    - -

    Describe the contents of this struct in a string.

    - -

    15.2.18.4.10(x)

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -74
    -75
    -76
    -
    -
    # File 'mrbgems/mruby-struct/mrblib/struct.rb', line 74
    -
    -def inspect
    -  self._inspect({})
    -end
    -
    -
    - -
    -

    - - - #lengthFixnum - - #sizeFixnum - - - - - - -

    -
    -

    Returns number of struct members.

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #lengthFixnum -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Fixnum) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #sizeFixnum -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Fixnum) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -618
    -619
    -620
    -621
    -622
    -
    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 618
    -
    -static mrb_value
    -mrb_struct_len(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_fixnum_value(RSTRUCT_LEN(self));
    -}
    -
    -
    - -
    -

    - - #membersArray - - - - - -

    -
    -

    Returns an array of strings representing the names of the instance -variables.

    - -

    Customer = Struct.new(:name, :address, :zip) - joe = Customer.new(“Joe Smith”, “123 Maple, Anytown NC”, 12345) - joe.members #=> [:name, :address, :zip]

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

    Returns:

    -
      - -
    • - - - (Array) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -107
    -108
    -109
    -110
    -111
    -
    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 107
    -
    -static mrb_value
    -mrb_struct_members(mrb_state *mrb, mrb_value obj)
    -{
    -  return mrb_struct_s_members_m(mrb, mrb_obj_value(mrb_obj_class(mrb, obj)));
    -}
    -
    -
    - -
    -

    - - #select(&block) ⇒ Object - - - - - -

    -
    -

    Calls the given block for each element of +self+ -and returns an array with all elements of which -block is not false.

    - -

    ISO 15.2.18.4.7

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -40
    -41
    -42
    -43
    -44
    -45
    -46
    -47
    -
    -
    # File 'mrbgems/mruby-struct/mrblib/struct.rb', line 40
    -
    -def select(&block)
    -  ary = []
    -  self.class.members.each{|field|
    -    val = self[field]
    -    ary.push(val) if block.call(val)
    -  }
    -  ary
    -end
    -
    -
    - -
    -

    - - - #lengthFixnum - - #sizeFixnum - - - - - - -

    -
    -

    Returns number of struct members.

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #lengthFixnum -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Fixnum) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #sizeFixnum -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Fixnum) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -618
    -619
    -620
    -621
    -622
    -
    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 618
    -
    -static mrb_value
    -mrb_struct_len(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_fixnum_value(RSTRUCT_LEN(self));
    -}
    -
    -
    - -
    -

    - - - #to_aArray - - #valuesArray - - - - - - -

    -
    -

    Create an array from struct values.

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #to_aArray -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #valuesArray -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -631
    -632
    -633
    -634
    -635
    -
    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 631
    -
    -static mrb_value
    -mrb_struct_to_a(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_ary_new_from_values(mrb, RSTRUCT_LEN(self), RSTRUCT_PTR(self));
    -}
    -
    -
    - -
    -

    - - #to_hHash - - - - - -

    -
    -

    Create a hash from member names and struct values.

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

    Returns:

    -
      - -
    • - - - (Hash) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -643
    -644
    -645
    -646
    -647
    -648
    -649
    -650
    -651
    -652
    -653
    -654
    -655
    -656
    -657
    -
    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 643
    -
    -static mrb_value
    -mrb_struct_to_h(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value members, ret;
    -  mrb_int i;
    -
    -  members = struct_members(mrb, self);
    -  ret = mrb_hash_new_capa(mrb, RARRAY_LEN(members));
    -
    -  for (i = 0; i < RARRAY_LEN(members); ++i) {
    -    mrb_hash_set(mrb, ret, RARRAY_PTR(members)[i], RSTRUCT_PTR(self)[i]);
    -  }
    -
    -  return ret;
    -}
    -
    -
    - -
    -

    - - - #to_aArray - - #valuesArray - - - - - - -

    -
    -

    Create an array from struct values.

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #to_aArray -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #valuesArray -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (Array) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -631
    -632
    -633
    -634
    -635
    -
    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 631
    -
    -static mrb_value
    -mrb_struct_to_a(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_ary_new_from_values(mrb, RSTRUCT_LEN(self), RSTRUCT_PTR(self));
    -}
    -
    -
    - -
    -

    - - #values_atObject - - - - - -

    - - - - -
    -
    -
    -
    -659
    -660
    -661
    -662
    -663
    -664
    -665
    -666
    -667
    -668
    -
    -
    # File 'mrbgems/mruby-struct/src/struct.c', line 659
    -
    -static mrb_value
    -mrb_struct_values_at(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int argc;
    -  mrb_value *argv;
    -
    -  mrb_get_args(mrb, "*", &argv, &argc);
    -
    -  return mrb_get_values_at(mrb, self, RSTRUCT_LEN(self), argc, argv, struct_aref_int);
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Symbol.html b/docs/api/Symbol.html deleted file mode 100644 index 106641d..0000000 --- a/docs/api/Symbol.html +++ /dev/null @@ -1,1269 +0,0 @@ - - - - - - - Class: Symbol - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Symbol - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - -
    -
    Includes:
    -
    Comparable
    -
    - - - - - - -
    -
    Defined in:
    -
    src/symbol.c,
    - mrblib/symbol.rb,
    mrbgems/mruby-symbol-ext/mrblib/symbol.rb
    -
    -
    - -
    - -

    Overview

    -
    -

    15.2.11

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

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #<=> ⇒ Object - - - - - - - - - - - - - -

      15.2.11.3.5(x).

      -
      - -
    • - - -
    • - - - #capitalize ⇒ Object - - - - - - - - - - - - - -

      call-seq: sym.capitalize -> symbol.

      -
      - -
    • - - -
    • - - - #casecmp(other) ⇒ Object - - - - - - - - - - - - - -

      call-seq: sym.casecmp(other) -> -1, 0, +1 or nil.

      -
      - -
    • - - -
    • - - - #casecmp?(sym) ⇒ Boolean - - - - - - - - - - - - - -

      call-seq: sym.casecmp?(other) -> true, false, or nil.

      -
      - -
    • - - -
    • - - - #downcase ⇒ Object - - - - - - - - - - - - - -

      call-seq: sym.downcase -> symbol.

      -
      - -
    • - - -
    • - - - #empty? ⇒ Boolean - - - - - - - - - - - - - -

      call-seq: sym.empty? -> true or false.

      -
      - -
    • - - -
    • - - - #id2name ⇒ Object - - - - - - - - - - - - - -

      Returns the name or string corresponding to sym.

      -
      - -
    • - - -
    • - - - #inspect ⇒ Object - - - - - - - - - - - - - -

      15.2.11.3.5(x).

      -
      - -
    • - - -
    • - - - #to_proc ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #to_s ⇒ Object - - - - - - - - - - - - - -

      Returns the name or string corresponding to sym.

      -
      - -
    • - - -
    • - - - #to_sym ⇒ Object - - - - (also: #intern) - - - - - - - - - - - -

      In general, to_sym returns the Symbol corresponding to an object.

      -
      - -
    • - - -
    • - - - #upcase ⇒ Object - - - - - - - - - - - - - -

      call-seq: sym.upcase -> symbol.

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

    Methods included from Comparable

    -

    #<, #<=, #==, #>, #>=, #between?, #clamp

    - - -
    -

    Instance Method Details

    - - -
    -

    - - #<=>Object - - - - - -

    -
    -

    15.2.11.3.5(x)

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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 566
    -
    -static mrb_value
    -sym_cmp(mrb_state *mrb, mrb_value s1)
    -{
    -  mrb_value s2;
    -  mrb_sym sym1, sym2;
    -
    -  mrb_get_args(mrb, "o", &s2);
    -  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);
    -  else {
    -    const char *p1, *p2;
    -    int retval;
    -    mrb_int len, len1, len2;
    -    char buf1[8], buf2[8];
    -
    -    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) {
    -      if (len1 == len2) return mrb_fixnum_value(0);
    -      if (len1 > len2)  return mrb_fixnum_value(1);
    -      return mrb_fixnum_value(-1);
    -    }
    -    if (retval > 0) return mrb_fixnum_value(1);
    -    return mrb_fixnum_value(-1);
    -  }
    -}
    -
    -
    - -
    -

    - - #capitalizeObject - - - - - -

    -
    -

    call-seq: - sym.capitalize -> symbol

    - -

    Same as sym.to_s.capitalize.intern.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -12
    -13
    -14
    -
    -
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 12
    -
    -def capitalize
    -  self.to_s.capitalize.to_sym
    -end
    -
    -
    - -
    -

    - - #casecmp(other) ⇒ Object - - - - - -

    -
    -

    call-seq: - sym.casecmp(other) -> -1, 0, +1 or nil

    - -

    Case-insensitive version of Symbol#<=>.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -42
    -43
    -44
    -45
    -46
    -47
    -
    -
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 42
    -
    -def casecmp(other)
    -  return nil unless other.kind_of?(Symbol)
    -  lhs =  self.to_s.upcase
    -  rhs = other.to_s.upcase
    -  lhs <=> rhs
    -end
    -
    -
    - -
    -

    - - #casecmp?(sym) ⇒ Boolean - - - - - -

    -
    -

    call-seq: - sym.casecmp?(other) -> true, false, or nil

    - -

    Returns true if sym and other_sym are equal after case folding, -false if they are not equal, and nil if other_sym is not a string.

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -56
    -57
    -58
    -59
    -60
    -
    -
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 56
    -
    -def casecmp?(sym)
    -  c = self.casecmp(sym)
    -  return nil if c.nil?
    -  return c == 0
    -end
    -
    -
    - -
    -

    - - #downcaseObject - - - - - -

    -
    -

    call-seq: - sym.downcase -> symbol

    - -

    Same as sym.to_s.downcase.intern.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -22
    -23
    -24
    -
    -
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 22
    -
    -def downcase
    -  self.to_s.downcase.to_sym
    -end
    -
    -
    - -
    -

    - - #empty?Boolean - - - - - -

    -
    -

    call-seq: - sym.empty? -> true or false

    - -

    Returns that sym is :”” or not.

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -68
    -69
    -70
    -
    -
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 68
    -
    -def empty?
    -  self.length == 0
    -end
    -
    -
    - -
    -

    - - - #id2nameString - - #to_sString - - - - - - -

    -
    -

    Returns the name or string corresponding to sym.

    - -

    :fred.id2name #=> “fred”

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #id2nameString -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #to_sString -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -339
    -340
    -341
    -342
    -343
    -
    -
    # File 'src/symbol.c', line 339
    -
    -static mrb_value
    -sym_to_s(mrb_state *mrb, mrb_value sym)
    -{
    -  return mrb_sym_str(mrb, mrb_symbol(sym));
    -}
    -
    -
    - -
    -

    - - #inspectObject - - - - - -

    -
    -

    15.2.11.3.5(x)

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -488
    -489
    -490
    -491
    -492
    -493
    -494
    -495
    -496
    -497
    -498
    -499
    -500
    -501
    -502
    -503
    -504
    -505
    -506
    -507
    -508
    -509
    -510
    -511
    -512
    -513
    -
    -
    # File 'src/symbol.c', line 488
    -
    -static mrb_value
    -sym_inspect(mrb_state *mrb, mrb_value sym)
    -{
    -  mrb_value str;
    -  const char *name;
    -  mrb_int len;
    -  mrb_sym id = mrb_symbol(sym);
    -  char *sp;
    -
    -  name = mrb_sym_name_len(mrb, id, &len);
    -  str = mrb_str_new(mrb, 0, len+1);
    -  sp = RSTRING_PTR(str);
    -  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_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;
    -}
    -
    -
    - -
    -

    - - #to_procObject - - - - - -

    - - - - -
    -
    -
    -
    -2
    -3
    -4
    -5
    -6
    -
    -
    # File 'mrblib/symbol.rb', line 2
    -
    -def to_proc
    -  ->(obj,*args,&block) do
    -    obj.__send__(self, *args, &block)
    -  end
    -end
    -
    -
    - -
    -

    - - - #id2nameString - - #to_sString - - - - - - -

    -
    -

    Returns the name or string corresponding to sym.

    - -

    :fred.id2name #=> “fred”

    - - -
    -
    -
    - -

    Overloads:

    -
      - - -
    • - #id2nameString -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String) - - - -
      • - -
      - -
      - - -
    • - - -
    • - #to_sString -
      -
      - - - -
      -
      -
      - -

      Returns:

      -
        - -
      • - - - (String) - - - -
      • - -
      - -
      - - -
    • - -
    - - -
    - - - - - - -
    -
    -
    -
    -339
    -340
    -341
    -342
    -343
    -
    -
    # File 'src/symbol.c', line 339
    -
    -static mrb_value
    -sym_to_s(mrb_state *mrb, mrb_value sym)
    -{
    -  return mrb_sym_str(mrb, mrb_symbol(sym));
    -}
    -
    -
    - -
    -

    - - - #to_symObject - - #internObject - - - - - Also known as: - intern - - - - -

    -
    -

    In general, to_sym returns the Symbol corresponding -to an object. As sym is already a symbol, self is returned -in this case.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -356
    -357
    -358
    -359
    -360
    -
    -
    # File 'src/symbol.c', line 356
    -
    -static mrb_value
    -sym_to_sym(mrb_state *mrb, mrb_value sym)
    -{
    -  return sym;
    -}
    -
    -
    - -
    -

    - - #upcaseObject - - - - - -

    -
    -

    call-seq: - sym.upcase -> symbol

    - -

    Same as sym.to_s.upcase.intern.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -32
    -33
    -34
    -
    -
    # File 'mrbgems/mruby-symbol-ext/mrblib/symbol.rb', line 32
    -
    -def upcase
    -  self.to_s.upcase.to_sym
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/SystemStackError.html b/docs/api/SystemStackError.html deleted file mode 100644 index 3ec8b42..0000000 --- a/docs/api/SystemStackError.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - Exception: SystemStackError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: SystemStackError - - - -

    -
    - -
    -
    Inherits:
    -
    - Exception - -
      -
    • Object
    • - - - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    src/error.c
    -
    - -
    - -

    Overview

    -
    -

    15.2.38

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

    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/TCPServer.html b/docs/api/TCPServer.html deleted file mode 100644 index 61e6d25..0000000 --- a/docs/api/TCPServer.html +++ /dev/null @@ -1,528 +0,0 @@ - - - - - - - Class: TCPServer - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: TCPServer - - - -

    -
    - -
    -
    Inherits:
    -
    - TCPSocket - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-socket/mrblib/socket.rb
    -
    - -
    - - - - -

    Constant Summary

    - -

    Constants inherited - from IO

    -

    IO::BUF_SIZE, IO::SEEK_CUR, IO::SEEK_END, IO::SEEK_SET

    - - - - -

    Instance Attribute Summary

    - -

    Attributes inherited from BasicSocket

    -

    #do_not_reverse_lookup

    - - - -

    - Instance Method Summary - collapse -

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

    Methods inherited from TCPSocket

    -

    new_with_prelude

    - - - - - - - - - -

    Methods inherited from IPSocket

    -

    #addr, getaddress, #peeraddr, #recvfrom

    - - - - - - - - - -

    Methods inherited from BasicSocket

    -

    #_is_socket=, #_recvfrom, #_setnonblock, #close, do_not_reverse_lookup, do_not_reverse_lookup=, for_fd, #getpeereid, #getpeername, #getsockname, #getsockopt, #local_address, #recv, #recv_nonblock, #remote_address, #send, #setsockopt, #shutdown, #sysread, #sysseek, #syswrite

    - - - - - - - - - -

    Methods inherited from IO

    -

    #<<, #_check_readable, #_read_buf, #close, #close_on_exec=, #close_on_exec?, #close_write, #closed?, #each, #each_byte, #eof?, #fileno, #flush, #getc, #gets, #hash, #initialize_copy, #isatty, open, #pid, pipe, popen, #pos, #pos=, #print, #printf, #puts, read, #read, #readchar, #readline, #readlines, #rewind, #seek, #sync, #sync=, #sysread, #sysseek, #syswrite, #ungetc, #write

    -
    -

    Constructor Details

    - -
    -

    - - #initialize(host = nil, service) ⇒ TCPServer - - - - - -

    -
    -

    Returns a new instance of TCPServer

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -268
    -269
    -270
    -271
    -272
    -273
    -274
    -275
    -276
    -277
    -278
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 268
    -
    -def initialize(host=nil, service)
    -  ai = Addrinfo.getaddrinfo(host, service, nil, nil, nil, Socket::AI_PASSIVE)[0]
    -  @init_with_fd = true
    -  super(Socket._socket(ai.afamily, Socket::SOCK_STREAM, 0), "r+")
    -  if Socket.const_defined?(:SO_REUSEADDR)
    -    self.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, true)
    -  end
    -  Socket._bind(self.fileno, ai.to_sockaddr)
    -  listen(5)
    -  self
    -end
    -
    -
    - -
    - - -
    -

    Instance Method Details

    - - -
    -

    - - #acceptObject - - - - - -

    - - - - -
    -
    -
    -
    -280
    -281
    -282
    -283
    -284
    -285
    -286
    -287
    -288
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 280
    -
    -def accept
    -  fd = self.sysaccept
    -  begin
    -    TCPSocket.new_with_prelude(proc { @init_with_fd = true }, fd, "r+")
    -  rescue
    -    IO._sysclose(fd) rescue nil
    -    raise
    -  end
    -end
    -
    -
    - -
    -

    - - #accept_nonblockObject - - - - - -

    - - - - -
    -
    -
    -
    -290
    -291
    -292
    -293
    -294
    -295
    -296
    -297
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 290
    -
    -def accept_nonblock
    -  begin
    -    self._setnonblock(true)
    -    self.accept
    -  ensure
    -    self._setnonblock(false)
    -  end
    -end
    -
    -
    - -
    -

    - - #listen(backlog) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -299
    -300
    -301
    -302
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 299
    -
    -def listen(backlog)
    -  Socket._listen(self.fileno, backlog)
    -  0
    -end
    -
    -
    - -
    -

    - - #sysacceptObject - - - - - -

    - - - - -
    -
    -
    -
    -304
    -305
    -306
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 304
    -
    -def sysaccept
    -  Socket._accept(self.fileno)
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/TCPSocket.html b/docs/api/TCPSocket.html deleted file mode 100644 index 885c93e..0000000 --- a/docs/api/TCPSocket.html +++ /dev/null @@ -1,381 +0,0 @@ - - - - - - - Class: TCPSocket - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: TCPSocket - - - -

    -
    - -
    -
    Inherits:
    -
    - IPSocket - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-socket/src/socket.c,
    - mrbgems/mruby-socket/mrblib/socket.rb
    -
    -
    - -
    - -
    -

    Direct Known Subclasses

    -

    TCPServer

    -
    - - - -

    Constant Summary

    - -

    Constants inherited - from IO

    -

    IO::BUF_SIZE, IO::SEEK_CUR, IO::SEEK_END, IO::SEEK_SET

    - - - - -

    Instance Attribute Summary

    - -

    Attributes inherited from BasicSocket

    -

    #do_not_reverse_lookup

    - - - -

    - Class Method Summary - collapse -

    - - - -

    - Instance Method Summary - collapse -

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

    Methods inherited from IPSocket

    -

    #addr, getaddress, #peeraddr, #recvfrom

    - - - - - - - - - -

    Methods inherited from BasicSocket

    -

    #_is_socket=, #_recvfrom, #_setnonblock, #close, do_not_reverse_lookup, do_not_reverse_lookup=, for_fd, #getpeereid, #getpeername, #getsockname, #getsockopt, #local_address, #recv, #recv_nonblock, #remote_address, #send, #setsockopt, #shutdown, #sysread, #sysseek, #syswrite

    - - - - - - - - - -

    Methods inherited from IO

    -

    #<<, #_check_readable, #_read_buf, #close, #close_on_exec=, #close_on_exec?, #close_write, #closed?, #each, #each_byte, #eof?, #fileno, #flush, #getc, #gets, #hash, #initialize_copy, #isatty, open, #pid, pipe, popen, #pos, #pos=, #print, #printf, #puts, read, #read, #readchar, #readline, #readlines, #rewind, #seek, #sync, #sync=, #sysread, #sysseek, #syswrite, #ungetc, #write

    -
    -

    Constructor Details

    - -
    -

    - - #initialize(host, service, local_host = nil, local_service = nil) ⇒ TCPSocket - - - - - -

    -
    -

    Returns a new instance of TCPSocket

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 231
    -
    -def initialize(host, service, local_host=nil, local_service=nil)
    -  if @init_with_fd
    -    super(host, service)
    -  else
    -    s = nil
    -    e = SocketError
    -    Addrinfo.foreach(host, service) { |ai|
    -      begin
    -        s = Socket._socket(ai.afamily, Socket::SOCK_STREAM, 0)
    -        if local_host or local_service
    -          local_host ||= (ai.afamily == Socket::AF_INET) ? "0.0.0.0" : "::"
    -          local_service ||= "0"
    -          bi = Addrinfo.getaddrinfo(local_host, local_service, ai.afamily, ai.socktype)[0]
    -          Socket._bind(s, bi.to_sockaddr)
    -        end
    -        Socket._connect(s, ai.to_sockaddr)
    -        super(s, "r+")
    -        return
    -      rescue => e0
    -        e = e0
    -      end
    -    }
    -    raise e
    -  end
    -end
    -
    -
    - -
    - - -
    -

    Class Method Details

    - - -
    -

    - - .new_with_prelude(pre, *args) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -257
    -258
    -259
    -260
    -261
    -262
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 257
    -
    -def self.new_with_prelude pre, *args
    -  o = self._allocate
    -  o.instance_eval(&pre)
    -  o.initialize(*args)
    -  o
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/Time.html b/docs/api/Time.html deleted file mode 100644 index 39b3caa..0000000 --- a/docs/api/Time.html +++ /dev/null @@ -1,3480 +0,0 @@ - - - - - - - Class: Time - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: Time - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-time/src/time.c,
    - mrbgems/mruby-time/mrblib/time.rb
    -
    -
    - -
    - -

    Overview

    -
    -

    ISO 15.2.19.2

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

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #+ ⇒ Object - - - - - - - - - - - - - -

      15.2.19.7.2.

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

      15.2.19.7.3.

      -
      - -
    • - - -
    • - - - #<=> ⇒ Object - - - - - - - - - - - - - -

      15.2.19.7.1.

      -
      - -
    • - - -
    • - - - #== ⇒ Object - - - - - - - - - - - - - -

      15.2.19.6.6.

      -
      - -
    • - - -
    • - - - #asctime ⇒ Object - - - - - - - - - - - - - -

      Returns a string that describes the time.

      -
      - -
    • - - -
    • - - - #ctime ⇒ Object - - - - - - - - - - - - - -

      Returns a string that describes the time.

      -
      - -
    • - - -
    • - - - #day ⇒ Object - - - - - - - - - - - - - -

      Returns the day in the month of the time.

      -
      - -
    • - - -
    • - - - #dst? ⇒ Boolean - - - - - - - - - - - - - -

      Returns true if daylight saving was applied for this time.

      -
      - -
    • - - -
    • - - - #friday? ⇒ Boolean - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #getgm ⇒ Object - - - - - - - - - - - - - -

      Returns the Time object of the UTC(GMT) timezone.

      -
      - -
    • - - -
    • - - - #getlocal ⇒ Object - - - - - - - - - - - - - -

      Returns the Time object of the LOCAL timezone.

      -
      - -
    • - - -
    • - - - #getutc ⇒ Object - - - - - - - - - - - - - -

      Returns the Time object of the UTC(GMT) timezone.

      -
      - -
    • - - -
    • - - - #gmt? ⇒ Boolean - - - - - - - - - - - - - -

      Returns true if this time is in the UTC timezone false if not.

      -
      - -
    • - - -
    • - - - #gmtime ⇒ Object - - - - - - - - - - - - - -

      Sets the timezone attribute of the Time object to UTC.

      -
      - -
    • - - -
    • - - - #hour ⇒ Object - - - - - - - - - - - - - -

      Returns hour of time.

      -
      - -
    • - - -
    • - - - #initialize ⇒ Object - - - - - - - constructor - - - - - - - - -

      Initializes a time by setting the amount of milliseconds since the epoch.

      -
      - -
    • - - -
    • - - - #initialize_copy ⇒ Object - - - - - - - - - - - - - -

      Initializes a copy of this time object.

      -
      - -
    • - - -
    • - - - #inspect ⇒ Object - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #localtime ⇒ Object - - - - - - - - - - - - - -

      Sets the timezone attribute of the Time object to LOCAL.

      -
      - -
    • - - -
    • - - - #mday ⇒ Object - - - - - - - - - - - - - -

      Returns day of month of time.

      -
      - -
    • - - -
    • - - - #min ⇒ Object - - - - - - - - - - - - - -

      Returns minutes of time.

      -
      - -
    • - - -
    • - - - #mon ⇒ Object - - - - - - - - - - - - - -

      Returns month of time.

      -
      - -
    • - - -
    • - - - #monday? ⇒ Boolean - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #month ⇒ Object - - - - - - - - - - - - - -

      Returns month of time.

      -
      - -
    • - - -
    • - - - #saturday? ⇒ Boolean - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #sec ⇒ Object - - - - - - - - - - - - - -

      Returns seconds in minute of time.

      -
      - -
    • - - -
    • - - - #sunday? ⇒ Boolean - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #thursday? ⇒ Boolean - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #to_f ⇒ Object - - - - - - - - - - - - - -

      Returns a Float with the time since the epoch in seconds.

      -
      - -
    • - - -
    • - - - #to_i ⇒ Object - - - - - - - - - - - - - -

      Returns an Integer with the time since the epoch in seconds.

      -
      - -
    • - - -
    • - - - #to_s ⇒ Object - - - - - - - - - - - - - -

      15.2.19.7.3.

      -
      - -
    • - - -
    • - - - #tuesday? ⇒ Boolean - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #usec ⇒ Object - - - - - - - - - - - - - -

      Returns an Integer with the time since the epoch in microseconds.

      -
      - -
    • - - -
    • - - - #utc ⇒ Object - - - - - - - - - - - - - -

      Sets the timezone attribute of the Time object to UTC.

      -
      - -
    • - - -
    • - - - #utc? ⇒ Boolean - - - - - - - - - - - - - -

      Returns true if this time is in the UTC timezone false if not.

      -
      - -
    • - - -
    • - - - #wday ⇒ Object - - - - - - - - - - - - - -

      Returns week day number of time.

      -
      - -
    • - - -
    • - - - #wednesday? ⇒ Boolean - - - - - - - - - - - - - -
      -
      - -
    • - - -
    • - - - #yday ⇒ Object - - - - - - - - - - - - - -

      Returns year day number of time.

      -
      - -
    • - - -
    • - - - #year ⇒ Object - - - - - - - - - - - - - -

      Returns year of time.

      -
      - -
    • - - -
    • - - - #zone ⇒ Object - - - - - - - - - - - - - -

      Returns name of time’s timezone.

      -
      - -
    • - - -
    - - -
    -

    Constructor Details

    - -
    -

    - - #initializeObject - - - - - -

    -
    -

    Initializes a time by setting the amount of milliseconds since the epoch.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 739
    -
    -static mrb_value
    -mrb_time_initialize(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_int ayear = 0, amonth = 1, aday = 1, ahour = 0,
    -  amin = 0, asec = 0, ausec = 0;
    -  mrb_int n;
    -  struct mrb_time *tm;
    -
    -  n = mrb_get_args(mrb, "|iiiiiii",
    -       &ayear, &amonth, &aday, &ahour, &amin, &asec, &ausec);
    -  tm = (struct mrb_time*)DATA_PTR(self);
    -  if (tm) {
    -    mrb_free(mrb, tm);
    -  }
    -  mrb_data_init(self, NULL, &mrb_time_type);
    -
    -  if (n == 0) {
    -    tm = current_mrb_time(mrb);
    -  }
    -  else {
    -    tm = time_mktime(mrb, ayear, amonth, aday, ahour, amin, asec, ausec, MRB_TIMEZONE_LOCAL);
    -  }
    -  mrb_data_init(self, tm, &mrb_time_type);
    -  return self;
    -}
    -
    -
    - -
    - - -
    -

    Instance Method Details

    - - -
    -

    - - #+Object - - - - - -

    -
    -

    15.2.19.7.2

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -553
    -554
    -555
    -556
    -557
    -558
    -559
    -560
    -561
    -562
    -563
    -564
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 553
    -
    -static mrb_value
    -mrb_time_plus(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value o;
    -  struct mrb_time *tm;
    -  time_t sec, usec;
    -
    -  mrb_get_args(mrb, "o", &o);
    -  tm = time_get_ptr(mrb, self);
    -  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);
    -}
    -
    -
    - -
    -

    - - #-Object - - - - - -

    -
    -

    15.2.19.7.3

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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_value other;
    -  struct mrb_time *tm, *tm2;
    -
    -  mrb_get_args(mrb, "o", &other);
    -  tm = time_get_ptr(mrb, self);
    -  tm2 = DATA_CHECK_GET_PTR(mrb, other, &mrb_time_type, struct mrb_time);
    -  if (tm2) {
    -#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 {
    -    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);
    -  }
    -}
    -
    -
    - -
    -

    - - #<=>Object - - - - - -

    -
    -

    15.2.19.7.1

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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)
    -{
    -  mrb_value other;
    -  struct mrb_time *tm1, *tm2;
    -
    -  mrb_get_args(mrb, "o", &other);
    -  tm1 = DATA_GET_PTR(mrb, self, &mrb_time_type, struct mrb_time);
    -  tm2 = DATA_CHECK_GET_PTR(mrb, other, &mrb_time_type, struct mrb_time);
    -  if (!tm1 || !tm2) return mrb_nil_value();
    -  if (tm1->sec > tm2->sec) {
    -    return mrb_fixnum_value(1);
    -  }
    -  else if (tm1->sec < tm2->sec) {
    -    return mrb_fixnum_value(-1);
    -  }
    -  /* tm1->sec == tm2->sec */
    -  if (tm1->usec > tm2->usec) {
    -    return mrb_fixnum_value(1);
    -  }
    -  else if (tm1->usec < tm2->usec) {
    -    return mrb_fixnum_value(-1);
    -  }
    -  return mrb_fixnum_value(0);
    -}
    -
    -
    - -
    -

    - - #==Object - - - - - -

    -
    -

    15.2.19.6.6

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -512
    -513
    -514
    -515
    -516
    -517
    -518
    -519
    -520
    -521
    -522
    -523
    -524
    -525
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 512
    -
    -static mrb_value
    -mrb_time_eq(mrb_state *mrb, mrb_value self)
    -{
    -  mrb_value other;
    -  struct mrb_time *tm1, *tm2;
    -  mrb_bool eq_p;
    -
    -  mrb_get_args(mrb, "o", &other);
    -  tm1 = DATA_GET_PTR(mrb, self, &mrb_time_type, struct mrb_time);
    -  tm2 = DATA_CHECK_GET_PTR(mrb, other, &mrb_time_type, struct mrb_time);
    -  eq_p = tm1 && tm2 && tm1->sec == tm2->sec && tm1->usec == tm2->usec;
    -
    -  return mrb_bool_value(eq_p);
    -}
    -
    -
    - -
    -

    - - #asctimeObject - - - - - -

    -
    -

    Returns a string that describes the time.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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 645
    -
    -static mrb_value
    -mrb_time_asctime(mrb_state *mrb, mrb_value self)
    -{
    -  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 %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,
    -    d->tm_year + 1900);
    -#endif
    -  return mrb_str_new(mrb, buf, len);
    -}
    -
    -
    - -
    -

    - - #ctimeObject - - - - - -

    -
    -

    Returns a string that describes the time.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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 645
    -
    -static mrb_value
    -mrb_time_asctime(mrb_state *mrb, mrb_value self)
    -{
    -  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 %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,
    -    d->tm_year + 1900);
    -#endif
    -  return mrb_str_new(mrb, buf, len);
    -}
    -
    -
    - -
    -

    - - #dayObject - - - - - -

    -
    -

    Returns the day in the month of the time.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -674
    -675
    -676
    -677
    -678
    -679
    -680
    -681
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 674
    -
    -static mrb_value
    -mrb_time_day(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  return mrb_fixnum_value(tm->datetime.tm_mday);
    -}
    -
    -
    - -
    -

    - - #dst?Boolean - - - - - -

    -
    -

    Returns true if daylight saving was applied for this time.

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -686
    -687
    -688
    -689
    -690
    -691
    -692
    -693
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 686
    -
    -static mrb_value
    -mrb_time_dst_p(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  return mrb_bool_value(tm->datetime.tm_isdst);
    -}
    -
    -
    - -
    -

    - - #friday?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -7
    -
    -
    # File 'mrbgems/mruby-time/mrblib/time.rb', line 7
    -
    -def friday?;  wday == 5 end
    -
    -
    - -
    -

    - - #getgmObject - - - - - -

    -
    -

    Returns the Time object of the UTC(GMT) timezone.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -698
    -699
    -700
    -701
    -702
    -703
    -704
    -705
    -706
    -707
    -708
    -709
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 698
    -
    -static mrb_value
    -mrb_time_getutc(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm, *tm2;
    -
    -  tm = time_get_ptr(mrb, self);
    -  tm2 = (struct mrb_time *)mrb_malloc(mrb, sizeof(*tm));
    -  *tm2 = *tm;
    -  tm2->timezone = MRB_TIMEZONE_UTC;
    -  time_update_datetime(mrb, tm2, TRUE);
    -  return mrb_time_wrap(mrb, mrb_obj_class(mrb, self), tm2);
    -}
    -
    -
    - -
    -

    - - #getlocalObject - - - - - -

    -
    -

    Returns the Time object of the LOCAL timezone.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -713
    -714
    -715
    -716
    -717
    -718
    -719
    -720
    -721
    -722
    -723
    -724
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 713
    -
    -static mrb_value
    -mrb_time_getlocal(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm, *tm2;
    -
    -  tm = time_get_ptr(mrb, self);
    -  tm2 = (struct mrb_time *)mrb_malloc(mrb, sizeof(*tm));
    -  *tm2 = *tm;
    -  tm2->timezone = MRB_TIMEZONE_LOCAL;
    -  time_update_datetime(mrb, tm2, TRUE);
    -  return mrb_time_wrap(mrb, mrb_obj_class(mrb, self), tm2);
    -}
    -
    -
    - -
    -

    - - #getutcObject - - - - - -

    -
    -

    Returns the Time object of the UTC(GMT) timezone.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -698
    -699
    -700
    -701
    -702
    -703
    -704
    -705
    -706
    -707
    -708
    -709
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 698
    -
    -static mrb_value
    -mrb_time_getutc(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm, *tm2;
    -
    -  tm = time_get_ptr(mrb, self);
    -  tm2 = (struct mrb_time *)mrb_malloc(mrb, sizeof(*tm));
    -  *tm2 = *tm;
    -  tm2->timezone = MRB_TIMEZONE_UTC;
    -  time_update_datetime(mrb, tm2, TRUE);
    -  return mrb_time_wrap(mrb, mrb_obj_class(mrb, self), tm2);
    -}
    -
    -
    - -
    -

    - - #gmt?Boolean - - - - - -

    -
    -

    Returns true if this time is in the UTC timezone false if not.

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -908
    -909
    -910
    -911
    -912
    -913
    -914
    -915
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 908
    -
    -static mrb_value
    -mrb_time_utc_p(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  return mrb_bool_value(tm->timezone == MRB_TIMEZONE_UTC);
    -}
    -
    -
    - -
    -

    - - #gmtimeObject - - - - - -

    -
    -

    Sets the timezone attribute of the Time object to UTC.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -895
    -896
    -897
    -898
    -899
    -900
    -901
    -902
    -903
    -904
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 895
    -
    -static mrb_value
    -mrb_time_utc(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  tm->timezone = MRB_TIMEZONE_UTC;
    -  time_update_datetime(mrb, tm, FALSE);
    -  return self;
    -}
    -
    -
    - -
    -

    - - #hourObject - - - - - -

    -
    -

    Returns hour of time.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -728
    -729
    -730
    -731
    -732
    -733
    -734
    -735
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 728
    -
    -static mrb_value
    -mrb_time_hour(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  return mrb_fixnum_value(tm->datetime.tm_hour);
    -}
    -
    -
    - -
    -

    - - #initialize_copyObject - - - - - -

    -
    -

    Initializes a copy of this time object.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -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 767
    -
    -static mrb_value
    -mrb_time_initialize_copy(mrb_state *mrb, mrb_value copy)
    -{
    -  mrb_value src;
    -  struct mrb_time *t1, *t2;
    -
    -  mrb_get_args(mrb, "o", &src);
    -  if (mrb_obj_equal(mrb, copy, src)) return copy;
    -  if (!mrb_obj_is_instance_of(mrb, src, mrb_obj_class(mrb, copy))) {
    -    mrb_raise(mrb, E_TYPE_ERROR, "wrong argument class");
    -  }
    -  t1 = (struct mrb_time *)DATA_PTR(copy);
    -  t2 = (struct mrb_time *)DATA_PTR(src);
    -  if (!t2) {
    -    mrb_raise(mrb, E_ARGUMENT_ERROR, "uninitialized time");
    -  }
    -  if (!t1) {
    -    t1 = (struct mrb_time *)mrb_malloc(mrb, sizeof(struct mrb_time));
    -    mrb_data_init(copy, t1, &mrb_time_type);
    -  }
    -  *t1 = *t2;
    -  return copy;
    -}
    -
    -
    - -
    -

    - - #inspectObject - - - - - -

    - - - - -
    -
    -
    -
    -948
    -949
    -950
    -951
    -952
    -953
    -954
    -955
    -956
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 948
    -
    -static mrb_value
    -mrb_time_to_s(mrb_state *mrb, mrb_value self)
    -{
    -  char buf[64];
    -  struct mrb_time *tm = time_get_ptr(mrb, self);
    -  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);
    -}
    -
    -
    - -
    -

    - - #localtimeObject - - - - - -

    -
    -

    Sets the timezone attribute of the Time object to LOCAL.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -793
    -794
    -795
    -796
    -797
    -798
    -799
    -800
    -801
    -802
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 793
    -
    -static mrb_value
    -mrb_time_localtime(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  tm->timezone = MRB_TIMEZONE_LOCAL;
    -  time_update_datetime(mrb, tm, FALSE);
    -  return self;
    -}
    -
    -
    - -
    -

    - - #mdayObject - - - - - -

    -
    -

    Returns day of month of time.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -806
    -807
    -808
    -809
    -810
    -811
    -812
    -813
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 806
    -
    -static mrb_value
    -mrb_time_mday(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  return mrb_fixnum_value(tm->datetime.tm_mday);
    -}
    -
    -
    - -
    -

    - - #minObject - - - - - -

    -
    -

    Returns minutes of time.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -817
    -818
    -819
    -820
    -821
    -822
    -823
    -824
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 817
    -
    -static mrb_value
    -mrb_time_min(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  return mrb_fixnum_value(tm->datetime.tm_min);
    -}
    -
    -
    - -
    -

    - - #monObject - - - - - -

    -
    -

    Returns month of time.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -828
    -829
    -830
    -831
    -832
    -833
    -834
    -835
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 828
    -
    -static mrb_value
    -mrb_time_mon(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  return mrb_fixnum_value(tm->datetime.tm_mon + 1);
    -}
    -
    -
    - -
    -

    - - #monday?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -3
    -
    -
    # File 'mrbgems/mruby-time/mrblib/time.rb', line 3
    -
    -def monday?;  wday == 1 end
    -
    -
    - -
    -

    - - #monthObject - - - - - -

    -
    -

    Returns month of time.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -828
    -829
    -830
    -831
    -832
    -833
    -834
    -835
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 828
    -
    -static mrb_value
    -mrb_time_mon(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  return mrb_fixnum_value(tm->datetime.tm_mon + 1);
    -}
    -
    -
    - -
    -

    - - #saturday?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -8
    -
    -
    # File 'mrbgems/mruby-time/mrblib/time.rb', line 8
    -
    -def saturday?;  wday == 6 end
    -
    -
    - -
    -

    - - #secObject - - - - - -

    -
    -

    Returns seconds in minute of time.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -839
    -840
    -841
    -842
    -843
    -844
    -845
    -846
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 839
    -
    -static mrb_value
    -mrb_time_sec(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  return mrb_fixnum_value(tm->datetime.tm_sec);
    -}
    -
    -
    - -
    -

    - - #sunday?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -2
    -
    -
    # File 'mrbgems/mruby-time/mrblib/time.rb', line 2
    -
    -def sunday?;  wday == 0 end
    -
    -
    - -
    -

    - - #thursday?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -6
    -
    -
    # File 'mrbgems/mruby-time/mrblib/time.rb', line 6
    -
    -def thursday?;  wday == 4 end
    -
    -
    - -
    -

    - - #to_fObject - - - - - -

    -
    -

    Returns a Float with the time since the epoch in seconds.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -851
    -852
    -853
    -854
    -855
    -856
    -857
    -858
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 851
    -
    -static mrb_value
    -mrb_time_to_f(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  return mrb_float_value(mrb, (mrb_float)tm->sec + (mrb_float)tm->usec/1.0e6);
    -}
    -
    -
    - -
    -

    - - #to_iObject - - - - - -

    -
    -

    Returns an Integer with the time since the epoch in seconds.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -863
    -864
    -865
    -866
    -867
    -868
    -869
    -870
    -871
    -872
    -873
    -874
    -875
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 863
    -
    -static mrb_value
    -mrb_time_to_i(mrb_state *mrb, mrb_value self)
    -{
    -  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);
    -}
    -
    -
    - -
    -

    - - #to_sObject - - - - - -

    -
    -

    15.2.19.7.3

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -948
    -949
    -950
    -951
    -952
    -953
    -954
    -955
    -956
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 948
    -
    -static mrb_value
    -mrb_time_to_s(mrb_state *mrb, mrb_value self)
    -{
    -  char buf[64];
    -  struct mrb_time *tm = time_get_ptr(mrb, self);
    -  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);
    -}
    -
    -
    - -
    -

    - - #tuesday?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -4
    -
    -
    # File 'mrbgems/mruby-time/mrblib/time.rb', line 4
    -
    -def tuesday?;  wday == 2 end
    -
    -
    - -
    -

    - - #usecObject - - - - - -

    -
    -

    Returns an Integer with the time since the epoch in microseconds.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -879
    -880
    -881
    -882
    -883
    -884
    -885
    -886
    -887
    -888
    -889
    -890
    -891
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 879
    -
    -static mrb_value
    -mrb_time_usec(mrb_state *mrb, mrb_value self)
    -{
    -  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);
    -}
    -
    -
    - -
    -

    - - #utcObject - - - - - -

    -
    -

    Sets the timezone attribute of the Time object to UTC.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -895
    -896
    -897
    -898
    -899
    -900
    -901
    -902
    -903
    -904
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 895
    -
    -static mrb_value
    -mrb_time_utc(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  tm->timezone = MRB_TIMEZONE_UTC;
    -  time_update_datetime(mrb, tm, FALSE);
    -  return self;
    -}
    -
    -
    - -
    -

    - - #utc?Boolean - - - - - -

    -
    -

    Returns true if this time is in the UTC timezone false if not.

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -908
    -909
    -910
    -911
    -912
    -913
    -914
    -915
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 908
    -
    -static mrb_value
    -mrb_time_utc_p(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  return mrb_bool_value(tm->timezone == MRB_TIMEZONE_UTC);
    -}
    -
    -
    - -
    -

    - - #wdayObject - - - - - -

    -
    -

    Returns week day number of time.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -597
    -598
    -599
    -600
    -601
    -602
    -603
    -604
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 597
    -
    -static mrb_value
    -mrb_time_wday(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  return mrb_fixnum_value(tm->datetime.tm_wday);
    -}
    -
    -
    - -
    -

    - - #wednesday?Boolean - - - - - -

    -
    - - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - - - -
    -
    -
    -
    -5
    -
    -
    # File 'mrbgems/mruby-time/mrblib/time.rb', line 5
    -
    -def wednesday?;  wday == 3 end
    -
    -
    - -
    -

    - - #ydayObject - - - - - -

    -
    -

    Returns year day number of time.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -608
    -609
    -610
    -611
    -612
    -613
    -614
    -615
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 608
    -
    -static mrb_value
    -mrb_time_yday(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  return mrb_fixnum_value(tm->datetime.tm_yday + 1);
    -}
    -
    -
    - -
    -

    - - #yearObject - - - - - -

    -
    -

    Returns year of time.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -619
    -620
    -621
    -622
    -623
    -624
    -625
    -626
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 619
    -
    -static mrb_value
    -mrb_time_year(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  return mrb_fixnum_value(tm->datetime.tm_year + 1900);
    -}
    -
    -
    - -
    -

    - - #zoneObject - - - - - -

    -
    -

    Returns name of time’s timezone.

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -630
    -631
    -632
    -633
    -634
    -635
    -636
    -637
    -638
    -639
    -640
    -641
    -
    -
    # File 'mrbgems/mruby-time/src/time.c', line 630
    -
    -static mrb_value
    -mrb_time_zone(mrb_state *mrb, mrb_value self)
    -{
    -  struct mrb_time *tm;
    -
    -  tm = time_get_ptr(mrb, self);
    -  if (tm->timezone <= MRB_TIMEZONE_NONE) return mrb_nil_value();
    -  if (tm->timezone >= MRB_TIMEZONE_LAST) return mrb_nil_value();
    -  return mrb_str_new_static(mrb,
    -                            timezone_names[tm->timezone].name,
    -                            timezone_names[tm->timezone].len);
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/TrueClass.html b/docs/api/TrueClass.html deleted file mode 100644 index 634cf8c..0000000 --- a/docs/api/TrueClass.html +++ /dev/null @@ -1,585 +0,0 @@ - - - - - - - Class: TrueClass - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: TrueClass - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    src/object.c
    -
    - -
    - - - - - - - - - -

    - Instance Method Summary - collapse -

    - -
      - -
    • - - - #&(obj) ⇒ Boolean - - - - - - - - - - - - - -

      And—Returns false if obj is nil or false, true otherwise.

      -
      - -
    • - - -
    • - - - #^(obj) ⇒ Object - - - - - - - - - - - - - -

      Exclusive Or—Returns true if obj is nil or false, false otherwise.

      -
      - -
    • - - -
    • - - - #to_s ⇒ Object - - - - - - - - - - - - - -

      The string representation of true is “true”.

      -
      - -
    • - - -
    • - - - #to_s ⇒ Object - - - - - - - - - - - - - -

      The string representation of true is “true”.

      -
      - -
    • - - -
    • - - - #|(obj) ⇒ true - - - - - - - - - - - - - -

      Or—Returns true.

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

    Instance Method Details

    - - -
    -

    - - #&(obj) ⇒ Boolean - - - - - -

    -
    -

    And—Returns false if obj is -nil or false, true otherwise.

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

    Returns:

    -
      - -
    • - - - (Boolean) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -113
    -114
    -115
    -116
    -117
    -118
    -119
    -120
    -121
    -
    -
    # File 'src/object.c', line 113
    -
    -static mrb_value
    -true_and(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_bool obj2;
    -
    -  mrb_get_args(mrb, "b", &obj2);
    -
    -  return mrb_bool_value(obj2);
    -}
    -
    -
    - -
    -

    - - #^(obj) ⇒ Object - - - - - -

    -
    -

    Exclusive Or—Returns true if obj is -nil or false, false -otherwise.

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -133
    -134
    -135
    -136
    -137
    -138
    -139
    -140
    -
    -
    # File 'src/object.c', line 133
    -
    -static mrb_value
    -true_xor(mrb_state *mrb, mrb_value obj)
    -{
    -  mrb_bool obj2;
    -
    -  mrb_get_args(mrb, "b", &obj2);
    -  return mrb_bool_value(!obj2);
    -}
    -
    -
    - -
    -

    - - #to_sObject - - - - - -

    -
    -

    The string representation of true is “true”.

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -150
    -151
    -152
    -153
    -154
    -
    -
    # File 'src/object.c', line 150
    -
    -static mrb_value
    -true_to_s(mrb_state *mrb, mrb_value obj)
    -{
    -  return mrb_str_new_lit_frozen(mrb, "true");
    -}
    -
    -
    - -
    -

    - - #to_sObject - - - - - -

    -
    -

    The string representation of true is “true”.

    - - -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    -150
    -151
    -152
    -153
    -154
    -
    -
    # File 'src/object.c', line 150
    -
    -static mrb_value
    -true_to_s(mrb_state *mrb, mrb_value obj)
    -{
    -  return mrb_str_new_lit_frozen(mrb, "true");
    -}
    -
    -
    - -
    -

    - - #|(obj) ⇒ true - - - - - -

    -
    -

    Or—Returns true. As anObject is an argument to -a method call, it is always evaluated; there is no short-circuit -evaluation in this case.

    - - - - - - - - - - - - - - -
    trueputs(“or”) 
    true puts(“logical or”)
    - -

    produces:

    - -

    or

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

    Returns:

    -
      - -
    • - - - (true) - - - -
    • - -
    - -
    - - - - -
    - - - - - - -
    -
    -
    -
    -173
    -174
    -175
    -176
    -177
    -
    -
    # File 'src/object.c', line 173
    -
    -static mrb_value
    -true_or(mrb_state *mrb, mrb_value obj)
    -{
    -  return mrb_true_value();
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/TypeError.html b/docs/api/TypeError.html deleted file mode 100644 index 4cecfff..0000000 --- a/docs/api/TypeError.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - Exception: TypeError - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Exception: TypeError - - - -

    -
    - -
    -
    Inherits:
    -
    - StandardError - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrblib/10error.rb
    -
    - -
    - -

    Overview

    -
    -

    ISO 15.2.29

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

    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/UDPSocket.html b/docs/api/UDPSocket.html deleted file mode 100644 index 698d538..0000000 --- a/docs/api/UDPSocket.html +++ /dev/null @@ -1,564 +0,0 @@ - - - - - - - Class: UDPSocket - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: UDPSocket - - - -

    -
    - -
    -
    Inherits:
    -
    - IPSocket - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-socket/mrblib/socket.rb
    -
    - -
    - - - - -

    Constant Summary

    - -

    Constants inherited - from IO

    -

    IO::BUF_SIZE, IO::SEEK_CUR, IO::SEEK_END, IO::SEEK_SET

    - - - - -

    Instance Attribute Summary

    - -

    Attributes inherited from BasicSocket

    -

    #do_not_reverse_lookup

    - - - -

    - Instance Method Summary - collapse -

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

    Methods inherited from IPSocket

    -

    #addr, getaddress, #peeraddr, #recvfrom

    - - - - - - - - - -

    Methods inherited from BasicSocket

    -

    #_is_socket=, #_recvfrom, #_setnonblock, #close, do_not_reverse_lookup, do_not_reverse_lookup=, for_fd, #getpeereid, #getpeername, #getsockname, #getsockopt, #local_address, #recv, #recv_nonblock, #remote_address, #setsockopt, #shutdown, #sysread, #sysseek, #syswrite

    - - - - - - - - - -

    Methods inherited from IO

    -

    #<<, #_check_readable, #_read_buf, #close, #close_on_exec=, #close_on_exec?, #close_write, #closed?, #each, #each_byte, #eof?, #fileno, #flush, #getc, #gets, #hash, #initialize_copy, #isatty, open, #pid, pipe, popen, #pos, #pos=, #print, #printf, #puts, read, #read, #readchar, #readline, #readlines, #rewind, #seek, #sync, #sync=, #sysread, #sysseek, #syswrite, #ungetc, #write

    -
    -

    Constructor Details

    - -
    -

    - - #initialize(af = Socket::AF_INET) ⇒ UDPSocket - - - - - -

    -
    -

    Returns a new instance of UDPSocket

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -310
    -311
    -312
    -313
    -314
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 310
    -
    -def initialize(af=Socket::AF_INET)
    -  super(Socket._socket(af, Socket::SOCK_DGRAM, 0), "r+")
    -  @af = af
    -  self
    -end
    -
    -
    - -
    - - -
    -

    Instance Method Details

    - - -
    -

    - - #_sockaddr_in(port, host) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -347
    -348
    -349
    -350
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 347
    -
    -def _sockaddr_in(port, host)
    -  ai = Addrinfo.getaddrinfo(host, port, @af, Socket::SOCK_DGRAM)[0]
    -  ai.to_sockaddr
    -end
    -
    -
    - -
    -

    - - #bind(host, port) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -316
    -317
    -318
    -319
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 316
    -
    -def bind(host, port)
    -  Socket._bind(self.fileno, _sockaddr_in(port, host))
    -  0
    -end
    -
    -
    - -
    -

    - - #connect(host, port) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -321
    -322
    -323
    -324
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 321
    -
    -def connect(host, port)
    -  Socket._connect(self.fileno, _sockaddr_in(port, host))
    -  0
    -end
    -
    -
    - -
    -

    - - #recvfrom_nonblock(*args) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -326
    -327
    -328
    -329
    -330
    -331
    -332
    -333
    -334
    -335
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 326
    -
    -def recvfrom_nonblock(*args)
    -  s = self
    -  begin
    -    self._setnonblock(true)
    -    self.recvfrom(*args)
    -  ensure
    -    # XXX: self is a SystemcallException here! (should be bug)
    -    s._setnonblock(false)
    -  end
    -end
    -
    -
    - -
    -

    - - #send(mesg, flags, host = nil, port = nil) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -337
    -338
    -339
    -340
    -341
    -342
    -343
    -344
    -345
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 337
    -
    -def send(mesg, flags, host=nil, port=nil)
    -  if port
    -    super(mesg, flags, _sockaddr_in(port, host))
    -  elsif host
    -    super(mesg, flags, host)
    -  else
    -    super(mesg, flags)
    -  end
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/UNIXServer.html b/docs/api/UNIXServer.html deleted file mode 100644 index b43272b..0000000 --- a/docs/api/UNIXServer.html +++ /dev/null @@ -1,531 +0,0 @@ - - - - - - - Class: UNIXServer - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: UNIXServer - - - -

    -
    - -
    -
    Inherits:
    -
    - UNIXSocket - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-socket/mrblib/socket.rb
    -
    - -
    - - - - -

    Constant Summary

    - -

    Constants inherited - from IO

    -

    IO::BUF_SIZE, IO::SEEK_CUR, IO::SEEK_END, IO::SEEK_SET

    - - - - -

    Instance Attribute Summary

    - -

    Attributes inherited from BasicSocket

    -

    #do_not_reverse_lookup

    - - - -

    - Instance Method Summary - collapse -

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

    Methods inherited from UNIXSocket

    -

    #addr, #path, #peeraddr, #recvfrom, socketpair

    - - - - - - - - - -

    Methods inherited from BasicSocket

    -

    #_is_socket=, #_recvfrom, #_setnonblock, #close, do_not_reverse_lookup, do_not_reverse_lookup=, for_fd, #getpeereid, #getpeername, #getsockname, #getsockopt, #local_address, #recv, #recv_nonblock, #remote_address, #send, #setsockopt, #shutdown, #sysread, #sysseek, #syswrite

    - - - - - - - - - -

    Methods inherited from IO

    -

    #<<, #_check_readable, #_read_buf, #close, #close_on_exec=, #close_on_exec?, #close_write, #closed?, #each, #each_byte, #eof?, #fileno, #flush, #getc, #gets, #hash, #initialize_copy, #isatty, open, #pid, pipe, popen, #pos, #pos=, #print, #printf, #puts, read, #read, #readchar, #readline, #readlines, #rewind, #seek, #sync, #sync=, #sysread, #sysseek, #syswrite, #ungetc, #write

    -
    -

    Constructor Details

    - -
    -

    - - #initialize(path) ⇒ UNIXServer - - - - - -

    -
    -

    Returns a new instance of UNIXServer

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -524
    -525
    -526
    -527
    -528
    -529
    -530
    -531
    -532
    -533
    -534
    -535
    -536
    -537
    -538
    -539
    -540
    -541
    -542
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 524
    -
    -def initialize(path)
    -  fd = Socket._socket(Socket::AF_UNIX, Socket::SOCK_STREAM, 0)
    -  begin
    -    super(fd)
    -    Socket._bind(fd, Socket.pack_sockaddr_un(path))
    -    self.listen(5)
    -  rescue => e
    -    IO._sysclose(fd) rescue nil
    -    raise e
    -  end
    -
    -  if block_given?
    -    begin
    -      yield self
    -    ensure
    -      self.close rescue nil unless self.closed?
    -    end
    -  end
    -end
    -
    -
    - -
    - - -
    -

    Instance Method Details

    - - -
    -

    - - #acceptObject - - - - - -

    - - - - -
    -
    -
    -
    -544
    -545
    -546
    -547
    -548
    -549
    -550
    -551
    -552
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 544
    -
    -def accept
    -  fd = self.sysaccept
    -  begin
    -    sock = UNIXSocket.for_fd(fd)
    -  rescue
    -    IO._sysclose(fd) rescue nil
    -  end
    -  sock
    -end
    -
    -
    - -
    -

    - - #accept_nonblockObject - - - - - -

    - - - - -
    -
    -
    -
    -554
    -555
    -556
    -557
    -558
    -559
    -560
    -561
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 554
    -
    -def accept_nonblock
    -  begin
    -    self._setnonblock(true)
    -    self.accept
    -  ensure
    -    self._setnonblock(false)
    -  end
    -end
    -
    -
    - -
    -

    - - #listen(backlog) ⇒ Object - - - - - -

    - - - - -
    -
    -
    -
    -563
    -564
    -565
    -566
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 563
    -
    -def listen(backlog)
    -  Socket._listen(self.fileno, backlog)
    -  0
    -end
    -
    -
    - -
    -

    - - #sysacceptObject - - - - - -

    - - - - -
    -
    -
    -
    -568
    -569
    -570
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 568
    -
    -def sysaccept
    -  Socket._accept(self.fileno)
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/UNIXSocket.html b/docs/api/UNIXSocket.html deleted file mode 100644 index 52e1f7a..0000000 --- a/docs/api/UNIXSocket.html +++ /dev/null @@ -1,590 +0,0 @@ - - - - - - - Class: UNIXSocket - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: UNIXSocket - - - -

    -
    - -
    -
    Inherits:
    -
    - BasicSocket - - - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-socket/mrblib/socket.rb
    -
    - -
    - -
    -

    Direct Known Subclasses

    -

    UNIXServer

    -
    - - - -

    Constant Summary

    - -

    Constants inherited - from IO

    -

    IO::BUF_SIZE, IO::SEEK_CUR, IO::SEEK_END, IO::SEEK_SET

    - - - - -

    Instance Attribute Summary

    - -

    Attributes inherited from BasicSocket

    -

    #do_not_reverse_lookup

    - - - -

    - Class Method Summary - collapse -

    - - - -

    - Instance Method Summary - collapse -

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

    Methods inherited from BasicSocket

    -

    #_is_socket=, #_recvfrom, #_setnonblock, #close, do_not_reverse_lookup, do_not_reverse_lookup=, for_fd, #getpeereid, #getpeername, #getsockname, #getsockopt, #local_address, #recv, #recv_nonblock, #remote_address, #send, #setsockopt, #shutdown, #sysread, #sysseek, #syswrite

    - - - - - - - - - -

    Methods inherited from IO

    -

    #<<, #_check_readable, #_read_buf, #close, #close_on_exec=, #close_on_exec?, #close_write, #closed?, #each, #each_byte, #eof?, #fileno, #flush, #getc, #gets, #hash, #initialize_copy, #isatty, open, #pid, pipe, popen, #pos, #pos=, #print, #printf, #puts, read, #read, #readchar, #readline, #readlines, #rewind, #seek, #sync, #sync=, #sysread, #sysseek, #syswrite, #ungetc, #write

    -
    -

    Constructor Details

    - -
    -

    - - #initialize(path, &block) ⇒ UNIXSocket - - - - - -

    -
    -

    Returns a new instance of UNIXSocket

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -471
    -472
    -473
    -474
    -475
    -476
    -477
    -478
    -479
    -480
    -481
    -482
    -483
    -484
    -485
    -486
    -487
    -488
    -489
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 471
    -
    -def initialize(path, &block)
    -  if self.is_a? UNIXServer
    -    super(path, "r")
    -  else
    -    super(Socket._socket(Socket::AF_UNIX, Socket::SOCK_STREAM, 0), "r+")
    -    Socket._connect(self.fileno, Socket.sockaddr_un(path))
    -
    -    if block_given?
    -      begin
    -        yield self
    -      ensure
    -        begin
    -          self.close unless self.closed?
    -        rescue StandardError
    -        end
    -      end
    -    end
    -  end
    -end
    -
    -
    - -
    - - -
    -

    Class Method Details

    - - -
    -

    - - .socketpair(type = Socket::SOCK_STREAM, protocol = 0) ⇒ Object - - - - Also known as: - pair - - - - -

    - - - - -
    -
    -
    -
    -491
    -492
    -493
    -494
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 491
    -
    -def self.socketpair(type=Socket::SOCK_STREAM, protocol=0)
    -  a = Socket.socketpair(Socket::AF_UNIX, type, protocol)
    -  [ UNIXSocket.for_fd(a[0]), UNIXSocket.for_fd(a[1]) ]
    -end
    -
    -
    - -
    - -
    -

    Instance Method Details

    - - -
    -

    - - #addrObject - - - - - -

    - - - - -
    -
    -
    -
    -500
    -501
    -502
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 500
    -
    -def addr
    -  [ "AF_UNIX", path ]
    -end
    -
    -
    - -
    -

    - - #pathObject - - - - - -

    - - - - -
    -
    -
    -
    -504
    -505
    -506
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 504
    -
    -def path
    -  Addrinfo.new(self.getsockname).unix_path
    -end
    -
    -
    - -
    -

    - - #peeraddrObject - - - - - -

    - - - - -
    -
    -
    -
    -508
    -509
    -510
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 508
    -
    -def peeraddr
    -  [ "AF_UNIX", Addrinfo.new(self.getpeername).unix_path ]
    -end
    -
    -
    - -
    -

    - - #recvfrom(maxlen, flags = 0) ⇒ Object - - - - - -

    -
    -

    def recv_io

    - - -
    -
    -
    - - -
    - - - - - - -
    -
    -
    -
    -514
    -515
    -516
    -517
    -518
    -
    -
    # File 'mrbgems/mruby-socket/mrblib/socket.rb', line 514
    -
    -def recvfrom(maxlen, flags=0)
    -  msg, sa = _recvfrom(maxlen, flags)
    -  path = (sa.size > 0) ? Addrinfo.new(sa).unix_path : ""
    -  [ msg, [ "AF_UNIX", path ] ]
    -end
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/UnboundMethod.html b/docs/api/UnboundMethod.html deleted file mode 100644 index 541d1b3..0000000 --- a/docs/api/UnboundMethod.html +++ /dev/null @@ -1,1329 +0,0 @@ - - - - - - - Class: UnboundMethod - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Class: UnboundMethod - - - -

    -
    - -
    -
    Inherits:
    -
    - Object - -
      -
    • Object
    • - - - -
    - show all - -
    -
    - - - - - - - - - - - -
    -
    Defined in:
    -
    mrbgems/mruby-method/src/method.c
    -
    - -
    - - - - - - - - - -

    - Instance Method Summary - collapse -

    - - - - - - -
    -

    Instance Method Details

    - - -
    -

    - - #==Object - - - - - -

    - - - - -
    -
    -
    -
    -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();
    -}
    -
    -
    - -
    -

    - - #arityObject - - - - - -

    - - - - -
    -
    -
    -
    -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);
    -}
    -
    -
    - -
    -

    - - #bindObject - - - - - -

    - - - - -
    -
    -
    -
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    -42
    -43
    -44
    -45
    -46
    -47
    -48
    -
    -
    # 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 recv;
    -
    -  mrb_get_args(mrb, "o", &recv);
    -  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);
    -
    -  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 - - - - - -

    - - - - -
    -
    -
    -
    -287
    -288
    -289
    -290
    -291
    -292
    -293
    -294
    -295
    -296
    -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 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 str = mrb_str_new_lit(mrb, "#<");
    -  struct RClass *rklass;
    -
    -  mrb_str_cat_cstr(mrb, str, mrb_obj_classname(mrb, self));
    -  mrb_str_cat_lit(mrb, str, ": ");
    -  rklass = mrb_class_ptr(klass);
    -  if (mrb_class_ptr(owner) == rklass) {
    -    mrb_str_concat(mrb, str, owner);
    -    mrb_str_cat_lit(mrb, str, "#");
    -    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_concat(mrb, str, owner);
    -    mrb_str_cat_lit(mrb, str, ")#");
    -    mrb_str_concat(mrb, str, name);
    -  }
    -  mrb_str_cat_lit(mrb, str, ">");
    -  return str;
    -}
    -
    -
    - -
    -

    - - #nameObject - - - - - -

    - - - - -
    -
    -
    -
    -401
    -402
    -403
    -404
    -405
    -
    -
    # File 'mrbgems/mruby-method/src/method.c', line 401
    -
    -static mrb_value
    -method_name(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_name"));
    -}
    -
    -
    - -
    -

    - - #ownerObject - - - - - -

    - - - - -
    -
    -
    -
    -389
    -390
    -391
    -392
    -393
    -
    -
    # File 'mrbgems/mruby-method/src/method.c', line 389
    -
    -static mrb_value
    -method_owner(mrb_state *mrb, mrb_value self)
    -{
    -  return mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "_owner"));
    -}
    -
    -
    - -
    -

    - - #parametersObject - - - - - -

    - - - - -
    -
    -
    -
    -265
    -266
    -267
    -268
    -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 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"));
    -  struct RProc *rproc;
    -  struct RClass *orig;
    -  mrb_value ret;
    -
    -  if (mrb_nil_p(proc)) {
    -    mrb_value rest = mrb_symbol_value(mrb_intern_lit(mrb, "rest"));
    -    mrb_value arest = mrb_ary_new_from_values(mrb, 1, &rest);
    -    return mrb_ary_new_from_values(mrb, 1, &arest);
    -  }
    -
    -  rproc = mrb_proc_ptr(proc);
    -  orig = rproc->c;
    -  rproc->c = mrb->proc_class;
    -  ret = mrb_funcall(mrb, proc, "parameters", 0);
    -  rproc->c = orig;
    -  return ret;
    -}
    -
    -
    - -
    -

    - - #source_locationObject - - - - - -

    - - - - -
    -
    -
    -
    -246
    -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 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"));
    -  struct RProc *rproc;
    -  struct RClass *orig;
    -  mrb_value ret;
    -
    -  if (mrb_nil_p(proc))
    -    return mrb_nil_value();
    -
    -  rproc = mrb_proc_ptr(proc);
    -  orig = rproc->c;
    -  rproc->c = mrb->proc_class;
    -  ret = mrb_funcall(mrb, proc, "source_location", 0);
    -  rproc->c = orig;
    -  return ret;
    -}
    -
    -
    - -
    -

    - - #super_methodObject - - - - - -

    - - - - -
    -
    -
    -
    -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
    -
    -
    # 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"));
    -  struct RClass *super, *rklass;
    -  struct RProc *proc;
    -  struct RObject *me;
    -
    -  switch (mrb_type(klass)) {
    -    case MRB_TT_SCLASS:
    -      super = mrb_class_ptr(klass)->super->super;
    -      break;
    -    case MRB_TT_ICLASS:
    -      super = mrb_class_ptr(klass)->super;
    -      break;
    -    default:
    -      super = mrb_class_ptr(owner)->super;
    -      break;
    -  }
    -
    -  proc = method_search_vm(mrb, &super, mrb_symbol(name));
    -  if (!proc)
    -    return mrb_nil_value();
    -
    -  rklass = super;
    -  while (super->tt == MRB_TT_ICLASS)
    -    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));
    -
    -  return mrb_obj_value(me);
    -}
    -
    -
    - -
    -

    - - #to_sObject - - - - - -

    - - - - -
    -
    -
    -
    -287
    -288
    -289
    -290
    -291
    -292
    -293
    -294
    -295
    -296
    -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 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 str = mrb_str_new_lit(mrb, "#<");
    -  struct RClass *rklass;
    -
    -  mrb_str_cat_cstr(mrb, str, mrb_obj_classname(mrb, self));
    -  mrb_str_cat_lit(mrb, str, ": ");
    -  rklass = mrb_class_ptr(klass);
    -  if (mrb_class_ptr(owner) == rklass) {
    -    mrb_str_concat(mrb, str, owner);
    -    mrb_str_cat_lit(mrb, str, "#");
    -    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_concat(mrb, str, owner);
    -    mrb_str_cat_lit(mrb, str, ")#");
    -    mrb_str_concat(mrb, str, name);
    -  }
    -  mrb_str_cat_lit(mrb, str, ">");
    -  return str;
    -}
    -
    -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/_index.html b/docs/api/_index.html deleted file mode 100644 index 8843b26..0000000 --- a/docs/api/_index.html +++ /dev/null @@ -1,646 +0,0 @@ - - - - - - - Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Documentation by YARD 0.9.20

    -
    -

    Alphabetic Index

    - -

    File Listing

    - - -
    -

    Namespace Listing A-Z

    - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - -
      -
    • G
    • -
        - -
      • - GC - -
      • - -
      • - Generator - - (Enumerator) - -
      • - -
      -
    - - -
      -
    • H
    • -
        - -
      • - Hash - -
      • - -
      -
    - - -
    - - - - - - - - - - - - - - - - - - - - -
      -
    • P
    • -
        - -
      • - Proc - -
      • - -
      -
    - - - - - -
    - - - - - - - - - - - -
      -
    • Y
    • -
        - -
      • - Yielder - - (Enumerator) - -
      • - -
      -
    - -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/class_list.html b/docs/api/class_list.html deleted file mode 100644 index 09bb080..0000000 --- a/docs/api/class_list.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - Class List - - - -
    -
    -

    Class List

    - - - -
    - - -
    - - diff --git a/docs/api/css/common.css b/docs/api/css/common.css deleted file mode 100644 index cf25c45..0000000 --- a/docs/api/css/common.css +++ /dev/null @@ -1 +0,0 @@ -/* Override this file with custom rules */ \ No newline at end of file diff --git a/docs/api/css/full_list.css b/docs/api/css/full_list.css deleted file mode 100644 index fa35982..0000000 --- a/docs/api/css/full_list.css +++ /dev/null @@ -1,58 +0,0 @@ -body { - margin: 0; - font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; - font-size: 13px; - height: 101%; - overflow-x: hidden; - background: #fafafa; -} - -h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; } -.clear { clear: both; } -.fixed_header { position: fixed; background: #fff; width: 100%; padding-bottom: 10px; margin-top: 0; top: 0; z-index: 9999; height: 70px; } -#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; } -#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; } -#full_list { padding: 0; list-style: none; margin-left: 0; margin-top: 80px; font-size: 1.1em; } -#full_list ul { padding: 0; } -#full_list li { padding: 0; margin: 0; list-style: none; } -#full_list li .item { padding: 5px 5px 5px 12px; } -#noresults { padding: 7px 12px; background: #fff; } -#content.insearch #noresults { margin-left: 7px; } -li.collapsed ul { display: none; } -li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; } -li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; } -li { color: #888; cursor: pointer; } -li.deprecated { text-decoration: line-through; font-style: italic; } -li.odd { background: #f0f0f0; } -li.even { background: #fafafa; } -.item:hover { background: #ddd; } -li small:before { content: "("; } -li small:after { content: ")"; } -li small.search_info { display: none; } -a, a:visited { text-decoration: none; color: #05a; } -li.clicked > .item { background: #05a; color: #ccc; } -li.clicked > .item a, li.clicked > .item a:visited { color: #eee; } -li.clicked > .item a.toggle { opacity: 0.5; background-position: bottom right; } -li.collapsed.clicked a.toggle { background-position: top right; } -#search input { border: 1px solid #bbb; border-radius: 3px; } -#full_list_nav { margin-left: 10px; font-size: 0.9em; display: block; color: #aaa; } -#full_list_nav a, #nav a:visited { color: #358; } -#full_list_nav a:hover { background: transparent; color: #5af; } -#full_list_nav span:after { content: ' | '; } -#full_list_nav span:last-child:after { content: ''; } - -#content h1 { margin-top: 0; } -li { white-space: nowrap; cursor: normal; } -li small { display: block; font-size: 0.8em; } -li small:before { content: ""; } -li small:after { content: ""; } -li small.search_info { display: none; } -#search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; } -#content.insearch #search { background-position: center right; } -#search input { width: 110px; } - -#full_list.insearch ul { display: block; } -#full_list.insearch .item { display: none; } -#full_list.insearch .found { display: block; padding-left: 11px !important; } -#full_list.insearch li a.toggle { display: none; } -#full_list.insearch li small.search_info { display: block; } diff --git a/docs/api/css/mruby.css b/docs/api/css/mruby.css deleted file mode 100644 index e69de29..0000000 diff --git a/docs/api/css/style.css b/docs/api/css/style.css deleted file mode 100644 index 0bf7e2c..0000000 --- a/docs/api/css/style.css +++ /dev/null @@ -1,496 +0,0 @@ -html { - width: 100%; - height: 100%; -} -body { - font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; - font-size: 13px; - width: 100%; - margin: 0; - padding: 0; - display: flex; - display: -webkit-flex; - display: -ms-flexbox; -} - -#nav { - position: relative; - width: 100%; - height: 100%; - border: 0; - border-right: 1px dotted #eee; - overflow: auto; -} -.nav_wrap { - margin: 0; - padding: 0; - width: 20%; - height: 100%; - position: relative; - display: flex; - display: -webkit-flex; - display: -ms-flexbox; - flex-shrink: 0; - -webkit-flex-shrink: 0; - -ms-flex: 1 0; -} -#resizer { - position: absolute; - right: -5px; - top: 0; - width: 10px; - height: 100%; - cursor: col-resize; - z-index: 9999; -} -#main { - flex: 5 1; - -webkit-flex: 5 1; - -ms-flex: 5 1; - outline: none; - position: relative; - background: #fff; - padding: 1.2em; - padding-top: 0.2em; -} - -@media (max-width: 920px) { - .nav_wrap { width: 100%; top: 0; right: 0; overflow: visible; position: absolute; } - #resizer { display: none; } - #nav { - z-index: 9999; - background: #fff; - display: none; - position: absolute; - top: 40px; - right: 12px; - width: 500px; - max-width: 80%; - height: 80%; - overflow-y: scroll; - border: 1px solid #999; - border-collapse: collapse; - box-shadow: -7px 5px 25px #aaa; - border-radius: 2px; - } -} - -@media (min-width: 920px) { - body { height: 100%; overflow: hidden; } - #main { height: 100%; overflow: auto; } - #search { display: none; } -} - -#main img { max-width: 100%; } -h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; } -h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; } -h1.title { margin-bottom: 10px; } -h1.alphaindex { margin-top: 0; font-size: 22px; } -h2 { - padding: 0; - padding-bottom: 3px; - border-bottom: 1px #aaa solid; - font-size: 1.4em; - margin: 1.8em 0 0.5em; - position: relative; -} -h2 small { font-weight: normal; font-size: 0.7em; display: inline; position: absolute; right: 0; } -h2 small a { - display: block; - height: 20px; - border: 1px solid #aaa; - border-bottom: 0; - border-top-left-radius: 5px; - background: #f8f8f8; - position: relative; - padding: 2px 7px; -} -.clear { clear: both; } -.inline { display: inline; } -.inline p:first-child { display: inline; } -.docstring, .tags, #filecontents { font-size: 15px; line-height: 1.5145em; } -.docstring p > code, .docstring p > tt, .tags p > code, .tags p > tt { - color: #c7254e; background: #f9f2f4; padding: 2px 4px; font-size: 1em; - border-radius: 4px; -} -.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; } -.docstring h1 { font-size: 1.2em; } -.docstring h2 { font-size: 1.1em; } -.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; } -.summary_desc .object_link a, .docstring .object_link a { - font-family: monospace; font-size: 1.05em; - color: #05a; background: #EDF4FA; padding: 2px 4px; font-size: 1em; - border-radius: 4px; -} -.rdoc-term { padding-right: 25px; font-weight: bold; } -.rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; } -.summary_desc pre.code .object_link a, .docstring pre.code .object_link a { - padding: 0px; background: inherit; color: inherit; border-radius: inherit; -} - -/* style for */ -#filecontents table, .docstring table { border-collapse: collapse; } -#filecontents table th, #filecontents table td, -.docstring table th, .docstring table td { border: 1px solid #ccc; padding: 8px; padding-right: 17px; } -#filecontents table tr:nth-child(odd), -.docstring table tr:nth-child(odd) { background: #eee; } -#filecontents table tr:nth-child(even), -.docstring table tr:nth-child(even) { background: #fff; } -#filecontents table th, .docstring table th { background: #fff; } - -/* style for
      */ -#filecontents li > p, .docstring li > p { margin: 0px; } -#filecontents ul, .docstring ul { padding-left: 20px; } -/* style for
      */ -#filecontents dl, .docstring dl { border: 1px solid #ccc; } -#filecontents dt, .docstring dt { background: #ddd; font-weight: bold; padding: 3px 5px; } -#filecontents dd, .docstring dd { padding: 5px 0px; margin-left: 18px; } -#filecontents dd > p, .docstring dd > p { margin: 0px; } - -.note { - color: #222; - margin: 20px 0; - padding: 10px; - border: 1px solid #eee; - border-radius: 3px; - display: block; -} -.docstring .note { - border-left-color: #ccc; - border-left-width: 5px; -} -.note.todo { background: #ffffc5; border-color: #ececaa; } -.note.returns_void { background: #efefef; } -.note.deprecated { background: #ffe5e5; border-color: #e9dada; } -.note.title.deprecated { background: #ffe5e5; border-color: #e9dada; } -.note.private { background: #ffffc5; border-color: #ececaa; } -.note.title { padding: 3px 6px; font-size: 0.9em; font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; display: inline; } -.summary_signature + .note.title { margin-left: 7px; } -h1 .note.title { font-size: 0.5em; font-weight: normal; padding: 3px 5px; position: relative; top: -3px; text-transform: capitalize; } -.note.title { background: #efefef; } -.note.title.constructor { color: #fff; background: #6a98d6; border-color: #6689d6; } -.note.title.writeonly { color: #fff; background: #45a638; border-color: #2da31d; } -.note.title.readonly { color: #fff; background: #6a98d6; border-color: #6689d6; } -.note.title.private { background: #d5d5d5; border-color: #c5c5c5; } -.note.title.not_defined_here { background: transparent; border: none; font-style: italic; } -.discussion .note { margin-top: 6px; } -.discussion .note:first-child { margin-top: 0; } - -h3.inherited { - font-style: italic; - font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; - font-weight: normal; - padding: 0; - margin: 0; - margin-top: 12px; - margin-bottom: 3px; - font-size: 13px; -} -p.inherited { - padding: 0; - margin: 0; - margin-left: 25px; -} - -.box_info dl { - margin: 0; - border: 0; - width: 100%; - font-size: 1em; - display: flex; - display: -webkit-flex; - display: -ms-flexbox; -} -.box_info dl dt { - flex-shrink: 0; - -webkit-flex-shrink: 1; - -ms-flex-shrink: 1; - width: 100px; - text-align: right; - font-weight: bold; - border: 1px solid #aaa; - border-width: 1px 0px 0px 1px; - padding: 6px 0; - padding-right: 10px; -} -.box_info dl dd { - flex-grow: 1; - -webkit-flex-grow: 1; - -ms-flex: 1; - max-width: 420px; - padding: 6px 0; - padding-right: 20px; - border: 1px solid #aaa; - border-width: 1px 1px 0 0; - overflow: hidden; - position: relative; -} -.box_info dl:last-child > * { - border-bottom: 1px solid #aaa; -} -.box_info dl:nth-child(odd) > * { background: #eee; } -.box_info dl:nth-child(even) > * { background: #fff; } -.box_info dl > * { margin: 0; } - -ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; } -.index_inline_list { padding-left: 0; font-size: 1.1em; } - -.index_inline_list li { - list-style: none; - display: inline-block; - padding: 0 12px; - line-height: 30px; - margin-bottom: 5px; -} - -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; } - -.summary_desc { - margin-left: 32px; - display: block; - font-family: sans-serif; - font-size: 1.1em; - margin-top: 8px; - line-height: 1.5145em; - margin-bottom: 0.8em; -} -.summary_desc tt { font-size: 0.9em; } -dl.constants .note { padding: 2px 6px; padding-right: 12px; margin-top: 6px; } -dl.constants .docstring { margin-left: 32px; font-size: 0.9em; font-weight: normal; } -dl.constants .tags { padding-left: 32px; font-size: 0.9em; line-height: 0.8em; } -dl.constants .discussion *:first-child { margin-top: 0; } -dl.constants .discussion *:last-child { margin-bottom: 0; } - -.method_details { border-top: 1px dotted #ccc; margin-top: 25px; padding-top: 0; } -.method_details.first { border: 0; margin-top: 5px; } -.method_details.first h3.signature { margin-top: 1em; } -p.signature, h3.signature { - font-size: 1.1em; font-weight: normal; font-family: Monaco, Consolas, Courier, monospace; - padding: 6px 10px; margin-top: 1em; - background: #E8F4FF; border: 1px solid #d8d8e5; border-radius: 5px; -} -p.signature tt, -h3.signature tt { font-family: Monaco, Consolas, Courier, monospace; } -p.signature .overload, -h3.signature .overload { display: block; } -p.signature .extras, -h3.signature .extras { font-weight: normal; font-family: sans-serif; color: #444; font-size: 1em; } -p.signature .not_defined_here, -h3.signature .not_defined_here, -p.signature .aliases, -h3.signature .aliases { display: block; font-weight: normal; font-size: 0.9em; font-family: sans-serif; margin-top: 0px; color: #555; } -p.signature .aliases .names, -h3.signature .aliases .names { font-family: Monaco, Consolas, Courier, monospace; font-weight: bold; color: #000; font-size: 1.2em; } - -.tags .tag_title { font-size: 1.05em; margin-bottom: 0; font-weight: bold; } -.tags .tag_title tt { color: initial; padding: initial; background: initial; } -.tags ul { margin-top: 5px; padding-left: 30px; list-style: square; } -.tags ul li { margin-bottom: 3px; } -.tags ul .name { font-family: monospace; font-weight: bold; } -.tags ul .note { padding: 3px 6px; } -.tags { margin-bottom: 12px; } - -.tags .examples .tag_title { margin-bottom: 10px; font-weight: bold; } -.tags .examples .inline p { padding: 0; margin: 0; font-weight: bold; font-size: 1em; } -.tags .examples .inline p:before { content: "▸"; font-size: 1em; margin-right: 5px; } - -.tags .overload .overload_item { list-style: none; margin-bottom: 25px; } -.tags .overload .overload_item .signature { - padding: 2px 8px; - background: #F1F8FF; border: 1px solid #d8d8e5; border-radius: 3px; -} -.tags .overload .signature { margin-left: -15px; font-family: monospace; display: block; font-size: 1.1em; } -.tags .overload .docstring { margin-top: 15px; } - -.defines { display: none; } - -#method_missing_details .notice.this { position: relative; top: -8px; color: #888; padding: 0; margin: 0; } - -.showSource { font-size: 0.9em; } -.showSource a, .showSource a:visited { text-decoration: none; color: #666; } - -#content a, #content a:visited { text-decoration: none; color: #05a; } -#content a:hover { background: #ffffa5; } - -ul.summary { - list-style: none; - font-family: monospace; - font-size: 1em; - line-height: 1.5em; - padding-left: 0px; -} -ul.summary a, ul.summary a:visited { - text-decoration: none; font-size: 1.1em; -} -ul.summary li { margin-bottom: 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, -#content .summary_signature:hover a:visited { - background: transparent; - color: #049; -} - -p.inherited a { font-family: monospace; font-size: 0.9em; } -p.inherited { word-spacing: 5px; font-size: 1.2em; } - -p.children { font-size: 1.2em; } -p.children a { font-size: 0.9em; } -p.children strong { font-size: 0.8em; } -p.children strong.modules { padding-left: 5px; } - -ul.fullTree { display: none; padding-left: 0; list-style: none; margin-left: 0; margin-bottom: 10px; } -ul.fullTree ul { margin-left: 0; padding-left: 0; list-style: none; } -ul.fullTree li { text-align: center; padding-top: 18px; padding-bottom: 12px; background: url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHtJREFUeNqMzrEJAkEURdGzuhgZbSoYWcAWoBVsB4JgZAGmphsZCZYzTQgWNCYrDN9RvMmHx+X916SUBFbo8CzD1idXrLErw1mQttgXtyrOcQ/Ny5p4Qh+2XqLYYazsPWNTiuMkRxa4vcV+evuNAUOLIx5+c2hyzv7hNQC67Q+/HHmlEwAAAABJRU5ErkJggg==) no-repeat top center; } -ul.fullTree li:first-child { padding-top: 0; background: transparent; } -ul.fullTree li:last-child { padding-bottom: 0; } -.showAll ul.fullTree { display: block; } -.showAll .inheritName { display: none; } - -#search { position: absolute; right: 12px; top: 0px; z-index: 9000; } -#search a { - display: block; float: left; - padding: 4px 8px; text-decoration: none; color: #05a; fill: #05a; - border: 1px solid #d8d8e5; - border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; - background: #F1F8FF; - box-shadow: -1px 1px 3px #ddd; -} -#search a:hover { background: #f5faff; color: #06b; fill: #06b; } -#search a.active { - background: #568; padding-bottom: 20px; color: #fff; fill: #fff; - border: 1px solid #457; - border-top-left-radius: 5px; border-top-right-radius: 5px; -} -#search a.inactive { color: #999; fill: #999; } -.inheritanceTree, .toggleDefines { - float: right; - border-left: 1px solid #aaa; - position: absolute; top: 0; right: 0; - height: 100%; - background: #f6f6f6; - padding: 5px; - min-width: 55px; - text-align: center; -} - -#menu { font-size: 1.3em; color: #bbb; } -#menu .title, #menu a { font-size: 0.7em; } -#menu .title a { font-size: 1em; } -#menu .title { color: #555; } -#menu a, #menu a:visited { color: #333; text-decoration: none; border-bottom: 1px dotted #bbd; } -#menu a:hover { color: #05a; } - -#footer { margin-top: 15px; border-top: 1px solid #ccc; text-align: center; padding: 7px 0; color: #999; } -#footer a, #footer a:visited { color: #444; text-decoration: none; border-bottom: 1px dotted #bbd; } -#footer a:hover { color: #05a; } - -#listing ul.alpha { font-size: 1.1em; } -#listing ul.alpha { margin: 0; padding: 0; padding-bottom: 10px; list-style: none; } -#listing ul.alpha li.letter { font-size: 1.4em; padding-bottom: 10px; } -#listing ul.alpha ul { margin: 0; padding-left: 15px; } -#listing ul small { color: #666; font-size: 0.7em; } - -li.r1 { background: #f0f0f0; } -li.r2 { background: #fafafa; } - -#content ul.summary li.deprecated .summary_signature a, -#content ul.summary li.deprecated .summary_signature a:visited { text-decoration: line-through; font-style: italic; } - -#toc { - position: relative; - float: right; - overflow-x: auto; - right: -3px; - margin-left: 20px; - margin-bottom: 20px; - padding: 20px; padding-right: 30px; - max-width: 300px; - z-index: 5000; - background: #fefefe; - border: 1px solid #ddd; - box-shadow: -2px 2px 6px #bbb; -} -#toc .title { margin: 0; } -#toc ol { padding-left: 1.8em; } -#toc li { font-size: 1.1em; line-height: 1.7em; } -#toc > ol > li { font-size: 1.1em; font-weight: bold; } -#toc ol > ol { font-size: 0.9em; } -#toc ol ol > ol { padding-left: 2.3em; } -#toc ol + li { margin-top: 0.3em; } -#toc.hidden { padding: 10px; background: #fefefe; box-shadow: none; } -#toc.hidden:hover { background: #fafafa; } -#filecontents h1 + #toc.nofloat { margin-top: 0; } -@media (max-width: 560px) { - #toc { - margin-left: 0; - margin-top: 16px; - float: none; - max-width: none; - } -} - -/* syntax highlighting */ -.source_code { display: none; padding: 3px 8px; border-left: 8px solid #ddd; margin-top: 5px; } -#filecontents pre.code, .docstring pre.code, .source_code pre { font-family: monospace; } -#filecontents pre.code, .docstring pre.code { display: block; } -.source_code .lines { padding-right: 12px; color: #555; text-align: right; } -#filecontents pre.code, .docstring pre.code, -.tags pre.example { - padding: 9px 14px; - margin-top: 4px; - border: 1px solid #e1e1e8; - background: #f7f7f9; - border-radius: 4px; - font-size: 1em; - overflow-x: auto; - line-height: 1.2em; -} -pre.code { color: #000; tab-size: 2; } -pre.code .info.file { color: #555; } -pre.code .val { color: #036A07; } -pre.code .tstring_content, -pre.code .heredoc_beg, pre.code .heredoc_end, -pre.code .qwords_beg, pre.code .qwords_end, pre.code .qwords_sep, -pre.code .words_beg, pre.code .words_end, pre.code .words_sep, -pre.code .qsymbols_beg, pre.code .qsymbols_end, pre.code .qsymbols_sep, -pre.code .symbols_beg, pre.code .symbols_end, pre.code .symbols_sep, -pre.code .tstring, pre.code .dstring { color: #036A07; } -pre.code .fid, pre.code .rubyid_new, pre.code .rubyid_to_s, -pre.code .rubyid_to_sym, pre.code .rubyid_to_f, -pre.code .dot + pre.code .id, -pre.code .rubyid_to_i pre.code .rubyid_each { color: #0085FF; } -pre.code .comment { color: #0066FF; } -pre.code .const, pre.code .constant { color: #585CF6; } -pre.code .label, -pre.code .symbol { color: #C5060B; } -pre.code .kw, -pre.code .rubyid_require, -pre.code .rubyid_extend, -pre.code .rubyid_include { color: #0000FF; } -pre.code .ivar { color: #318495; } -pre.code .gvar, -pre.code .rubyid_backref, -pre.code .rubyid_nth_ref { color: #6D79DE; } -pre.code .regexp, .dregexp { color: #036A07; } -pre.code a { border-bottom: 1px dotted #bbf; } -/* inline code */ -*:not(pre) > code { - padding: 1px 3px 1px 3px; - border: 1px solid #E1E1E8; - background: #F7F7F9; - border-radius: 4px; -} - -/* Color fix for links */ -#content .summary_desc pre.code .id > .object_link a, /* identifier */ -#content .docstring pre.code .id > .object_link a { color: #0085FF; } -#content .summary_desc pre.code .const > .object_link a, /* constant */ -#content .docstring pre.code .const > .object_link a { color: #585CF6; } diff --git a/docs/api/file.AUTHORS.html b/docs/api/file.AUTHORS.html deleted file mode 100644 index 22e7aba..0000000 --- a/docs/api/file.AUTHORS.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - File: AUTHORS - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
      - - -

      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. - Daniel Bovensiepen - Jon Maken - Bjorn De Meyer - Yuichiro MASUI - Masamitsu MURASE - Masaki Muranaka - Internet Initiative Japan Inc. - Tadashi FUKUZAWA - MATSUMOTO Ryosuke - Yasuhiro Matsumoto - Koji Yoshioka - Jun Hiroe - Narihiro Nakamura - Yuichi Nishiwaki - Tatsuhiko Kubo - Takeshi Watanabe - Yuki Kurihara - specified non-profit corporation mruby Forum - Kazuaki Tanaka - Hiromasa Ishii - Hiroshi Mimaki - Satoshi Odawara - Mitsubishi Electric Micro-Computer Application Software Co.,Ltd. - Ralph Desir(Mav7) - Hiroyuki Matsuzaki - Yuhei Okazaki - Manycolors, Inc. - Shota Nakano - Yuichi Osawa - Terence Lee - Zachary Scott - Tomasz Dąbrowski - Christopher Aue - Masahiro Wakame - YAMAMOTO Masaya - KOBAYASHI Shuji

      -
      - - - -
      - - \ No newline at end of file diff --git a/docs/api/file.CONTRIBUTING.html b/docs/api/file.CONTRIBUTING.html deleted file mode 100644 index c50cd5f..0000000 --- a/docs/api/file.CONTRIBUTING.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - File: CONTRIBUTING - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
      - - -

      How to contribute

      - -

      mruby is an open-source project which is looking forward to each contribution.

      - -

      Your Pull Request

      - -

      To make it easy to review and understand your change please keep the following -things in mind before submitting your pull request:

      - -
        -
      • Work on the latest possible state of mruby/master
      • -
      • Create a branch which is dedicated to your change
      • -
      • Test your changes before creating a pull request (./minirake test)
      • -
      • If possible write a test case which confirms your change
      • -
      • Don’t mix several features or bug-fixes in one pull request
      • -
      • Create a meaningful commit message
      • -
      • Explain your change (i.e. with a link to the issue you are fixing)
      • -
      • Use mrbgem to provide non ISO features (classes, modules and methods) unless -you have a special reason to implement them in the core
      • -
      - -

      Coding conventions

      - -

      How to style your C and Ruby code which you want to submit.

      - -

      C code

      - -

      The core part (parser, bytecode-interpreter, core-lib, etc.) of mruby is -written in the C programming language. Please note the following hints for your -C code:

      - -

      Comply with C99 (ISO/IEC 9899:1999)

      - -

      mruby should be highly portable to other systems and compilers. For this it is -recommended to keep your code as close as possible to the C99 standard -(http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf).

      - -

      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

      - -

      The dependencies to libraries should be kept to an absolute minimum. This -increases the portability but makes it also easier to cut away parts of mruby -on-demand.

      - -

      Don’t use C++ style comments

      - -
      /* This is the preferred comment style */
      -
      - -

      Use C++ style comments only for temporary comment e.g. commenting out some code lines.

      - -

      Insert a break after the method return value:

      - -
      int
      -main(void)
      -{
      -  ...
      -}
      -
      - -

      Ruby code

      - -

      Parts of the standard library of mruby are written in the Ruby programming -language itself. Please note the following hints for your Ruby code:

      - -

      Comply with the Ruby standard (ISO/IEC 30170:2012)

      - -

      mruby is currently targeting to execute Ruby code which complies to ISO/IEC -30170:2012 (http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=59579).

      -
      - - - -
      - - \ No newline at end of file diff --git a/docs/api/file.LICENSE.html b/docs/api/file.LICENSE.html deleted file mode 100644 index 32e0ae2..0000000 --- a/docs/api/file.LICENSE.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - File: LICENSE - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
      - - -

      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”), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions:

      - -

      The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software.

      - -

      THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE.

      -
      - - - -
      - - \ No newline at end of file diff --git a/docs/api/file.README.html b/docs/api/file.README.html deleted file mode 100644 index 0ab8144..0000000 --- a/docs/api/file.README.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - File: README - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
      - - -

      Build Status

      - -

      What is mruby

      - -

      mruby is the lightweight implementation of the Ruby language complying to (part -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. -You can also compile Ruby programs into compiled byte code using the mruby -compiler “mrbc”. All those tools reside in the “bin” directory. “mrbc” is -also able to generate compiled byte code in a C source file, see the “mrbtest” -program under the “test” directory for an example.

      - -

      This achievement was sponsored by the Regional Innovation Creation R&D Programs -of the Ministry of Economy, Trade and Industry of Japan.

      - -

      How to get mruby

      - -

      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

      - -

      The trunk of the mruby source tree can be checked out with the -following command:

      - -
      $ git clone https://github.com/mruby/mruby.git
      -
      - -

      You can also install and compile mruby using ruby-install, ruby-build or rvm.

      - -

      mruby home-page

      - -

      The URL of the mruby home-page is: http://www.mruby.org.

      - -

      Mailing list

      - -

      We don’t have a mailing list, but you can use GitHub issues.

      - -

      How to compile and install (mruby and gems)

      - -

      See the compile.md file.

      - -

      Running Tests

      - -

      To run the tests, execute the following from the project’s root directory.

      - -
      $ make test
      -
      - -

      Or

      - -
      $ 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 mrbgems.md. -For example code of how to use mrbgems look into the folder examples/mrbgems/.

      - -

      License

      - -

      mruby is released under the MIT License.

      - -

      Note for License

      - -

      mruby has chosen a MIT License due to its permissive license allowing -developers to target various environments such as embedded systems. -However, the license requires the display of the copyright notice and license -information in manuals for instance. Doing so for big projects can be -complicated or troublesome. This is why mruby has decided to display “mruby -developers” as the copyright name to make it simple conventionally. -In the future, mruby might ask you to distribute your new code -(that you will commit,) under the MIT License as a member of -“mruby developers” but contributors will keep their copyright. -(We did not intend for contributors to transfer or waive their copyrights, -Actual copyright holder name (contributors) will be listed in the AUTHORS -file.)

      - -

      Please ask us if you want to distribute your code under another license.

      - -

      How to Contribute

      - -

      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 -file in your pull request.

      - -
      - - - -
      - - \ No newline at end of file diff --git a/docs/api/file.compile.html b/docs/api/file.compile.html deleted file mode 100644 index 5e474e9..0000000 --- a/docs/api/file.compile.html +++ /dev/null @@ -1,564 +0,0 @@ - - - - - - - File: compile - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
      - - -

      Compile

      - -

      mruby uses Rake to compile and cross-compile all libraries and -binaries.

      - -

      Prerequisites

      - -

      To compile mruby out of the source code you need the following tools: -* 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) -* C++ compiler (to use GEMs which include *.cpp, *.cxx, *.cc) -* Assembler (to use GEMs which include *.asm)

      - -

      Usage

      - -

      Inside of the root directory of the mruby source a file exists -called build_config.rb. This file contains the build configuration -of mruby and looks like this for example: -ruby -MRuby::Build.new do |conf| - toolchain :gcc -end -

      - -

      All tools necessary to compile mruby can be set or modified here. In case -you want to maintain an additional build_config.rb you can define a -customized path using the $MRUBY_CONFIG environment variable.

      - -

      To compile just call ./minirake inside of the mruby source root. To -generate and execute the test tools call ./minirake test. To clean -all build files call ./minirake clean. To see full command line on -build, call ./minirake -v.

      - -

      Build Configuration

      - -

      Inside of the build_config.rb the following options can be configured -based on your environment.

      - -

      Toolchains

      - -

      The mruby build system already contains a set of toolchain templates which -configure the build environment for specific compiler infrastructures.

      - -

      GCC

      - -

      Toolchain configuration for the GNU C Compiler. -ruby -toolchain :gcc -

      - -

      clang

      - -

      Toolchain configuration for the LLVM C Compiler clang. Mainly equal to the -GCC toolchain. -ruby -toolchain :clang -

      - -

      Visual Studio 2010, 2012 and 2013

      - -

      Toolchain configuration for Visual Studio on Windows. If you use the -Visual Studio Command Prompt, -you normally do not have to specify this manually, since it gets automatically detected by our build process. -ruby -toolchain :visualcpp -

      - -

      Android

      - -

      Toolchain configuration for Android. -ruby -toolchain :android -

      - -

      Requires the custom standalone Android NDK and the toolchain path -in ANDROID_STANDALONE_TOOLCHAIN.

      - -

      Binaries

      - -

      It is possible to select which tools should be compiled during the compilation -process. The following tools can be selected: -* mruby (mruby interpreter) -* mirb (mruby interactive shell)

      - -

      To select them declare conf.gem as follows: -ruby -conf.gem "#{root}/mrbgems/mruby-bin-mruby" -conf.gem "#{root}/mrbgems/mruby-bin-mirb" -

      - -

      File Separator

      - -

      Some environments require a different file separator character. It is possible to -set the character via conf.file_separator. -ruby -conf.file_separator = '/' -

      - -

      C Compiler

      - -

      Configuration of the C compiler binary, flags and include paths. -ruby -conf.cc do |cc| - cc.command = ... - cc.flags = ... - cc.include_paths = ... - cc.defines = ... - cc.option_include_path = ... - cc.option_define = ... - cc.compile_options = ... -end -

      - -

      C Compiler has header searcher to detect installed library.

      - -

      If you need a include path of header file use search_header_path: -ruby -# Searchesiconv.h. -# If found it will return include path of the header file. -# Otherwise it will return nil . -fail 'iconv.h not found' unless conf.cc.search_header_path 'iconv.h' -

      - -

      If you need a full file name of header file use search_header: -ruby -# Searchesiconv.h. -# If found it will return full path of the header file. -# Otherwise it will return nil . -iconv_h = conf.cc.search_header 'iconv.h' -print "iconv.h found: #{iconv_h}\n" -

      - -

      Header searcher uses compiler’s include_paths by default. -When you are using GCC toolchain (including clang toolchain since its base is gcc toolchain) -it will use compiler specific include paths too. (For example /usr/local/include, /usr/include)

      - -

      If you need a special header search paths define a singleton method header_search_paths to C compiler: -ruby -def conf.cc.header_search_paths - ['/opt/local/include'] + include_paths -end -

      - -

      Linker

      - -

      Configuration of the Linker binary, flags and library paths. -ruby -conf.linker do |linker| - linker.command = ... - linker.flags = ... - linker.flags_before_libraries = ... - linker.libraries = ... - linker.flags_after_libraries = ... - linker.library_paths = .... - linker.option_library = ... - linker.option_library_path = ... - linker.link_options = ... -end -

      - -

      Archiver

      - -

      Configuration of the Archiver binary and flags. -ruby -conf.archiver do |archiver| - archiver.command = ... - archiver.archive_options = ... -end -

      - -

      Parser Generator

      - -

      Configuration of the Parser Generator binary and flags. -ruby -conf.yacc do |yacc| - yacc.command = ... - yacc.compile_options = ... -end -

      - -

      GPerf

      - -

      Configuration of the GPerf binary and flags. -ruby -conf.gperf do |gperf| - gperf.command = ... - gperf.compile_options = ... -end -

      - -

      File Extensions

      -

      ruby -conf.exts do |exts| - exts.object = ... - exts.executable = ... - exts.library = ... -end -

      - -

      Mrbgems

      - -

      Integrate GEMs in the build process. -```ruby -# Integrate GEM with additional configuration -conf.gem ‘path/to/gem’ do |g| - g.cc.flags « … -end

      - -

      Integrate GEM without additional configuration

      -

      conf.gem ‘path/to/another/gem’ -```

      - -

      See doc/mrbgems/README.md for more option about mrbgems.

      - -

      Mrbtest

      - -

      Configuration Mrbtest build process.

      - -

      If you want mrbtest.a only, You should set conf.build_mrbtest_lib_only -ruby -conf.build_mrbtest_lib_only -

      - -

      Bintest

      - -

      Tests for mrbgem tools using CRuby. -To have bintests place *.rb scripts to bintest/ directory of mrbgems. -See mruby-bin-*/bintest/*.rb if you need examples. -If you want a temporary files use tempfile module of CRuby instead of /tmp/.

      - -

      You can enable it with following: -ruby -conf.enable_bintest -

      - -

      C++ ABI

      - -

      By default, mruby uses setjmp/longjmp to implement its -exceptions. But it doesn’t release C++ stack object -correctly. To support mrbgems written in C++, mruby can be -configured to use C++ exception.

      - -

      There are two levels of C++ exception handling. The one is -enable_cxx_exception that enables C++ exception, but -uses C ABI. The other is enable_cxx_abi where all -files are compiled by C++ compiler.

      - -

      When you mix C++ code, C++ exception would be enabled automatically. -If you need to enable C++ exception explicitly add the following: -ruby -conf.enable_cxx_exception -

      - -

      C++ exception disabling.

      - -

      If your compiler does not support C++ and you want to ensure -you don’t use mrbgem written in C++, you can explicitly disable -C++ exception, add following: -ruby -conf.disable_cxx_exception - -and you will get an error when you try to use C++ gem. -Note that it must be called before enable_cxx_exception or gem method.

      - -

      Debugging mode

      - -

      To enable debugging mode add the following: -ruby -conf.enable_debug -

      - -

      When debugging mode is enabled -* Macro MRB_DEBUG would be defined. - * Which means mrb_assert() macro is enabled. -* Debug information of irep would be generated by mrbc. - * Because -g flag would be added to mrbc runner. - * You can have better backtrace of mruby scripts with this.

      - -

      Cross-Compilation

      - -

      mruby can also be cross-compiled from one platform to another. To -achieve this the build_config.rb needs to contain an instance of -MRuby::CrossBuild. This instance defines the compilation -tools and flags for the target platform. An example could look -like this: -```ruby -MRuby::CrossBuild.new(‘32bit’) do |conf| - toolchain :gcc

      - -

      conf.cc.flags « “-m32” - conf.linker.flags « “-m32” -end -```

      - -

      All configuration options of MRuby::Build can also be used -in MRuby::CrossBuild.

      - -

      Mrbtest in Cross-Compilation

      - -

      In cross compilation, you can run mrbtest on emulator if -you have it by changing configuration of test runner. -```ruby -conf.test_runner do |t| - t.command = … # set emulator. this value must be non nil or false - t.flags = … # set flags of emulator

      - -

      def t.run(bin) # override run if you need to change the behavior of it - … # bin is the full path of mrbtest - end -end -```

      - -

      Build process

      - -

      During the build process the directory build will be created in the -root directory. The structure of this directory will look like this:

      - -
      +- build
      -   |
      -   +-  host
      -       |
      -       +- bin          <- Binaries (mirb, mrbc and mruby)
      -       |
      -       +- lib          <- Libraries (libmruby.a and libmruby_core.a)
      -       |
      -       +- mrblib
      -       |
      -       +- src
      -       |
      -       +- test         <- mrbtest tool
      -       |
      -       +- tools
      -          |
      -          +- mirb
      -          |
      -          +- mrbc
      -          |
      -          +- mruby
      -
      - -

      The compilation workflow will look like this: -* compile all files under src (object files will be stored -in build/host/src) -* generate parser grammar out of src/parse.y (generated -result will be stored in build/host/src/y.tab.c) -* compile build/host/src/y.tab.c to build/host/src/y.tab.o -* create build/host/lib/libmruby_core.a out of all object files (C only) -* create build/host/bin/mrbc by compiling tools/mrbc/mrbc.c and -linking with build/host/lib/libmruby_core.a -* create build/host/mrblib/mrblib.c by compiling all *.rb files -under mrblib with build/host/bin/mrbc -* compile build/host/mrblib/mrblib.c to build/host/mrblib/mrblib.o -* create build/host/lib/libmruby.a out of all object files (C and Ruby) -* create build/host/bin/mruby by compiling mrbgems/mruby-bin-mruby/tools/mruby/mruby.c and -linking with build/host/lib/libmruby.a -* create build/host/bin/mirb by compiling mrbgems/mruby-bin-mirb/tools/mirb/mirb.c and -linking with build/host/lib/libmruby.a

      - -

      - _____ _____ ______ ____ ____ _____ _____ ____ -| CC |->|GEN |->|AR |->|CC |->|CC |->|AR |->|CC |->|CC | -| *.c | |y.tab| |core.a| |mrbc| |*.rb| |lib.a| |mruby| |mirb| - ----- ----- ------ ---- ---- ----- ----- ---- -

      - -

      Cross-Compilation

      - -

      In case of a cross-compilation to i386 the build directory structure looks -like this:

      - -
      +- build
      -   |
      -   +-  host
      -   |   |
      -   |   +- bin           <- Native Binaries
      -   |   |
      -   |   +- lib           <- Native Libraries
      -   |   |
      -   |   +- mrblib
      -   |   |
      -   |   +- src
      -   |   |
      -   |   +- test          <- Native mrbtest tool
      -   |   |
      -   |   +- tools
      -   |      |
      -   |      +- mirb
      -   |      |
      -   |      +- mrbc
      -   |      |
      -   |      +- mruby
      -   +- i386
      -      |
      -      +- bin            <- Cross-compiled Binaries
      -      |
      -      +- lib            <- Cross-compiled Libraries
      -      |
      -      +- mrblib
      -      |
      -      +- src
      -      |
      -      +- test           <- Cross-compiled mrbtest tool
      -      |
      -      +- tools
      -         |
      -         +- mirb
      -         |
      -         +- mrbc
      -         |
      -         +- mruby
      -
      - -

      An extra directory is created for the target platform. In case you -compile for i386 a directory called i386 is created under the -build directory.

      - -

      The cross compilation workflow starts in the same way as the normal -compilation by compiling all native libraries and binaries. -Afterwards the cross compilation process proceeds like this: -* cross-compile all files under src (object files will be stored -in build/i386/src) -* generate parser grammar out of src/parse.y (generated -result will be stored in build/i386/src/y.tab.c) -* cross-compile build/i386/src/y.tab.c to build/i386/src/y.tab.o -* create build/i386/mrblib/mrblib.c by compiling all *.rb files -under mrblib with the native build/host/bin/mrbc -* cross-compile build/host/mrblib/mrblib.c to build/host/mrblib/mrblib.o -* create build/i386/lib/libmruby.a out of all object files (C and Ruby) -* create build/i386/bin/mruby by cross-compiling mrbgems/mruby-bin-mruby/tools/mruby/mruby.c and -linking with build/i386/lib/libmruby.a -* create build/i386/bin/mirb by cross-compiling mrbgems/mruby-bin-mirb/tools/mirb/mirb.c and -linking with build/i386/lib/libmruby.a -* create build/i386/lib/libmruby_core.a out of all object files (C only) -* create build/i386/bin/mrbc by cross-compiling tools/mrbc/mrbc.c and -linking with build/i386/lib/libmruby_core.a

      - -

      - _______________________________________________________________ -| Native Compilation for Host System | -| _____ ______ _____ ____ ____ _____ | -| | CC | -> |AR | -> |GEN | -> |CC | -> |CC | -> |AR | | -| | *.c | |core.a| |y.tab| |mrbc| |*.rb| |lib.a| | -| ----- ------ ----- ---- ---- ----- | - --------------------------------------------------------------- - || - \||/ - \/ - ________________________________________________________________ -| Cross Compilation for Target System | -| _____ _____ _____ ____ ______ _____ | -| | CC | -> |AR | -> |CC | -> |CC | -> |AR | -> |CC | | -| | *.c | |lib.a| |mruby| |mirb| |core.a| |mrbc | | -| ----- ----- ----- ---- ------ ----- | - ---------------------------------------------------------------- -

      - -

      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 (e.g. stdio) which -can’t be disabled for the main build.

      - -

      ```ruby -MRuby::CrossBuild.new(‘Minimal’) do |conf| - toolchain :gcc

      - -

      conf.cc.defines = %w(MRB_DISABLE_STDIO) - conf.bins = [] -end -```

      - -

      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 (e.g. mrbc).

      - -

      Test Environment

      - -

      mruby’s build process includes a test environment. In case you start the testing -of mruby, a native binary called mrbtest will be generated and executed. -This binary contains all test cases which are defined under test/t. In case -of a cross-compilation an additional cross-compiled mrbtest binary is -generated. You can copy this binary and run on your target system.

      -
      - - - -
      - - \ No newline at end of file diff --git a/docs/api/file.debugger.html b/docs/api/file.debugger.html deleted file mode 100644 index bf8c2b0..0000000 --- a/docs/api/file.debugger.html +++ /dev/null @@ -1,490 +0,0 @@ - - - - - - - File: debugger - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
      - - -

      How to Use the mruby Debugger

      - -

      copyright (c) 2014 Specified Non-Profit Corporation mruby Forum

      - -

      1. Summary

      - -

      This file documents the mruby debugger (‘mrdb’) methods.

      - -

      2 Debugging with mrdb

      - -

      2.1 Building mrdb

      - -

      The trunk of the mruby source tree, with the most recent mrdb, can be checked out with the following command:

      - -

      bash -$ git clone https://github.com/mruby/mruby.git -

      - -

      To run the make command:

      - -

      bash -$ cd mruby -$ make -

      - -

      By default, the make command will install the debugger files into mruby/bin.

      - -

      You can add the path for mrdb on your host environment with the following command:

      - -

      bash -$ echo "export PATH=\$PATH:MRUBY_ROOT/bin" >> ~/.bashrc -$ source ~/.bashrc -

      - -

      *MRUBY_ROOT is the directory in which mruby source code will be installed.

      - -

      To confirm mrdb was installed properly, run mrdb with the --version option:

      - -

      bash -$ mrdb --version -mruby 2.1.0 (2019-11-19) -

      - -

      2.2 Basic Operation

      - -

      2.2.1 Debugging mruby Script Files (rb file) with mrdb

      - -

      To invoke the mruby debugger, just type mrdb.

      - -

      To specify the script file:

      - -

      bash -$ mrdb [option] file name -

      - -

      For example: Debugging sample.rb

      - -

      bash -$ mrdb sample.rb -

      - -

      You can execute the shell commands listed below:

      - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    commanddescription
    runexecute programs
    stepexecute stepping
    continueexecute continuing program
    breakconfigure the breaking point
    deletedeleting the breaking points
    disabledisabling the breaking points
    enableenabling the breaking points
    info breakpointsshowing list of the breaking points
    printevaluating and printing the values of the mruby expressions in the script
    listdisplaying the source cords
    helpshowing help
    quitterminating the mruby debugger
    - -

    2.2.2 Debugging mruby Binary Files (mrb file) with mrdb

    - -

    You can debug the mruby binary files.

    - -

    2.2.2.1 Debugging the binary files

    - -
      -
    • notice -To debug mruby binary files, you need to compile mruby files with option -g.
    • -
    - -

    bash -$ mrbc -g sample.rb -

    - -

    You can debug the mruby binary files with following command and the option -b.

    - -

    bash -$ mrdb -b sample.mrb -

    - -

    Then you can execute all debugger shell commands.

    - -

    Break Command

    - -

    You can use any breakpoint to stop the program by specifying the line number and method name. -The breakpoint list will be displayed after you have set the breakpoint successfully.

    - -

    Usage:

    - -

    -break [file:]linenum -b [file:]linenum -break [class:]method -b [class:]method -

    - -

    The breakpoint will be ordered in serial from 1. -The number, which was given to the deleted breakpoint, will never be given to another breakpoint again.

    - -

    You can give multiple breakpoints to specified the line number and method. -Be ware that breakpoint command will not check the validity of the class name and method name.

    - -

    You can get the current breakpoint information by the following options.

    - -

    breakpoint breakpoint number : file name. line number

    - -

    breakpoint breakpoint number : [class name,] method name

    - -

    Continue Command

    - -

    Usage:

    - -

    -continue [N] -c [N] -

    - -

    N: the next breakpoint number

    - -

    When resuming the program, it will stop at breakpoint N (N-1 breakpoint will be ignored).

    - -

    When you run the continue command without specifying N, the program will be stopped at the next breakpoint.

    - -

    Example:

    - -

    -(foo.rb:1) continue 3 -

    - -

    This will resume the program and stop it at the third breakpoint.

    - -

    Delete Command

    - -

    This will delete the specified breakpoint.

    - -

    Usage:

    - -

    -delete [breakpoint-no] -d [breakpoint-no] -

    - -

    breakpoint-no: breakpoint number

    - -

    Example:

    - -

    -(foo.rb:1) delete -

    - -

    This will delete all of the breakpoints.

    - -

    -(foo.rb:1) delete 1 3 -

    - -

    This will delete the breakpoint at 1 and 3.

    - -

    Disable Command

    - -

    This will disable the specified breakpoint.

    - -

    Usage:

    - -

    -disable [breakpoint-no] -dis [breakpoint-no] -

    - -

    reappointing: breakpoint number

    - -

    Example:

    - -

    -(foo.rb:1) disable -

    - -

    Use disable if you would like to disable all of the breakpoints.

    - -

    -(foo.rb:1) disable 1 3 -

    - -

    This will disable the breakpoints at 1 and 3.

    - -

    Enable Command

    - -

    This will enable the specified breakpoints.

    - -

    Usage:

    - -

    -enable [breakpoint-no] -e [breakpoint-no] -

    - -

    breakpoint-no: breakpoint number

    - -

    Example:

    - -

    -(foo.rb:1) enable -

    - -

    Enabling all breakpoints - -(foo.rb:1) enable 1 3 -

    - -

    Enabling the breakpoint 1 and 3

    - -

    eval command

    - -

    Evaluating the string as source code and printing the value.

    - -

    Same as print command, please see print command.

    - -

    help command

    - -

    Displaying the help message.

    - -

    Usage:

    - -

    -help [command] -h [command] -

    - -

    Typing help without any options will display the command list.

    - -

    Info Breakpoints Command

    - -

    Displaying the specified breakpoint information.

    - -

    Usage:

    - -

    -info breakpoints [breakpoint-no] -i b [breakpoint-no] -

    - -

    breakpoint-no: breakpoint number

    - -

    Typing “info breakpoints” without ant option will display all breakpoint information. -Example:

    - -

    -(sample.rb:1) info breakpoints -Num Type Enb What -1 breakpoint y at sample.rb:3 -> file name,line number -2 breakpoint n in Sample_class:sample_class_method -> [class:]method name -3 breakpoint y in sample_global_method -

    - -

    Displaying the specified breakpoint number:

    - -

    -(foo.rb:1) info breakpoints 1 3 -Num Type Enb What -1 breakpoint y at sample.rb:3 -3 breakpoint y in sample_global_method -

    - -

    List Command

    - -

    To display the code of the source file.

    - -

    Usage:

    - -

    -list [filename:]first[,last] -l [filename]:first[,last] -

    - -

    first: the opening row number -last : the closing row number

    - -

    When you specify the first, but not the last option, you will receive 10 rows. -When you do not specify both the first and last options, you will receive the next 10 rows.

    - -

    Example:

    - -

    -Specifying file name and first row number -sample.rb:1) list sample2.rb:5 -

    - -

    Specifying the file name and the first and last row number:

    - -

    -(sample.rb:1) list sample2.rb:6,7 -

    - - - -

    Evaluating the string as source code and printing the value.

    - -

    Usage:

    - -

    -print [expr] -p [expr] -

    - -

    expr: expression

    - -

    The expression is mandatory. -The displayed expressions will be serially ordered from 1. -If an exception occurs, the exception information will be displayed and the debugging will be continued.

    - -

    Example:

    - -

    -(sample.rb:1) print 1+2 -$1 = 3 -(sample.rb:1) print self -$2 = main -

    - -

    Below is the case of the exception:

    - -

    -(sample.rb:1) print (1+2 -$1 = SyntaxError: line 1: syntax error, unexpected $end, expecting ')' -

    - -

    Quit Command

    - -

    Quitting the debugger.

    - -

    Usage:

    - -

    -quit -q -

    - -

    Run Command

    - -

    Running the program and stopping at the first breakpoint.

    - -

    Usage:

    - -

    -run -r -

    - -

    Step Command

    - -

    This will run the program step by step. -When the method and the block are invoked, the program will be stop at the first row. -The program, which is developed in C, will be ignored.

    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/file.gc-arena-howto.html b/docs/api/file.gc-arena-howto.html deleted file mode 100644 index 0776a58..0000000 --- a/docs/api/file.gc-arena-howto.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - File: gc-arena-howto - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    How to use mrb_gc_arena_save()/mrb_gc_arena_restore()/mrb_gc_protect()

    - -

    This is an English translation of [Matz’s blog post][matz blog post] -written in Japanese. -Some parts are updated to reflect recent changes. -[matz blog post]: http://www.rubyist.net/~matz/20130731.html

    - -

    When you are extending mruby using C language, you may encounter -mysterious “arena overflow error” or memory leak or very slow -execution speed. This is an error indicating overflow of “GC arena” -implementing “conservative GC”.

    - -

    GC (garbage collector) must ensure that object is “alive”, in other -words, that it is referenced by somewhere from program. This can be -determined by checking if the object can be directly or indirectly -referenced by root. The local variables, global variables and -constants etc are root.

    - -

    If program execution is performed inside mruby VM, there is nothing to -worry about because GC can access all roots owned by VM.

    - -

    The problem arises when executing C functions. The object referenced -by C variable is also “alive”, but mruby GC cannot aware of this, so -it might mistakenly recognize the objects referenced by only C -variables as dead.

    - -

    This can be a fatal bug if the GC tries to collect a live object.

    - -

    In CRuby, we scan C stack area, and use C variable as root to check -whether object is alive or not. Of course, because we are accessing C -stack just as memory region, we never know it is an integer or a -pointer. We workaround this by assuming that if it looks like a -pointer, then assume it as a pointer. We call it “conservative”.

    - -

    By the way, CRuby’s “conservative GC” has some problems.

    - -

    The biggest problem is we have no way to access to the stack area in -portable way. Therefore, we cannot use this method if we’d like to -implement highly portable runtime, like mruby.

    - -

    So we came up with an another plan to implement “conservative GC” in mruby.

    - -

    Again, the problem is when an object which was created in C function, becomes -no longer referenced in the Ruby world, and cannot be treated as garbage.

    - -

    In mruby, we recognize all objects created in C function are alive. -Then we have no problem such as confusing a live object as dead.

    - -

    This means that because we cannot collect truly dead object, we may -lose efficiency, but as a trade-off the GC itself is highly portable. -We can say goodbye to the problem that GC deletes live objects due to -optimization which sometimes occurs in CRuby.

    - -

    According to this idea, we have a table, called “GC arena”, which -remembers objects created in C function.

    - -

    The arena is stack structure, when C function execution is returned to mruby -VM, all objects registered in the arena are popped.

    - -

    This works very well, but can cause another problem: “arena overflow error” or -memory leak.

    - -

    As of this writing, mruby automatically extend arena to remember -objects (See MRB_GC_FIXED_ARENA and MRB_GC_ARENA_SIZE in -doc/guides/mrbconf.md).

    - -

    If you create many objects in C functions, memory usage will increase, since -GC never kick in. This memory usage may look like memory leak, but will also -make execution slower as more memory will need to be allocated.

    - -

    With the build time configuration, you can limit the maximum size of -arena (e.g., 100). Then if you create many objects, arena overflows, -thus you will get an “arena overflow error”.

    - -

    To workaround these problems, we have mrb_gc_arena_save() and -mrb_gc_arena_restore() functions.

    - -

    int mrb_gc_arena_save(mrb) returns the current position of the stack -top of GC arena, and void mrb_gc_arena_restore(mrb, idx) sets the -stack top position to back to given idx.

    - -

    We can use them like this:

    - -

    ```c -int arena_idx = mrb_gc_arena_save(mrb);

    - -

    // …create objects… -mrb_gc_arena_restore(mrb, arena_idx);

    - -

    ```

    - -

    In mruby, C function calls are surrounded by this save/restore, but we -can further optimize memory usage by surrounding save/restore, and can -avoid creating arena overflow bugs.

    - -

    Let’s take a real example. Here is the source code of Array#inspect:

    - -

    ```c -static mrb_value -inspect_ary(mrb_state *mrb, mrb_value ary, mrb_value list) -{ - mrb_int i; - mrb_value s, arystr; - char head[] = { ‘[’ }; - char sep[] = { ‘,’, ‘ ‘ }; - char tail[] = { ‘]’ };

    - -

    /* check recursive */ - for(i=0; i<RARRAY_LEN(list); i++) { - if (mrb_obj_equal(mrb, ary, RARRAY_PTR(list)[i])) { - return mrb_str_new(mrb, “[…]”, 5); - } - }

    - -

    mrb_ary_push(mrb, list, ary);

    - -

    arystr = mrb_str_new_capa(mrb, 64); - mrb_str_cat(mrb, arystr, head, sizeof(head));

    - -

    for(i=0; i<RARRAY_LEN(ary); i++) { - int ai = mrb_gc_arena_save(mrb);

    - -
    if (i > 0) {
    -  mrb_str_cat(mrb, arystr, sep, sizeof(sep));
    -}
    -if (mrb_array_p(RARRAY_PTR(ary)[i])) {
    -  s = inspect_ary(mrb, RARRAY_PTR(ary)[i], list);
    -}
    -else {
    -  s = mrb_inspect(mrb, RARRAY_PTR(ary)[i]);
    -}
    -mrb_str_cat(mrb, arystr, RSTRING_PTR(s), RSTRING_LEN(s));
    -mrb_gc_arena_restore(mrb, ai);   }
    -
    - -

    mrb_str_cat(mrb, arystr, tail, sizeof(tail)); - mrb_ary_pop(mrb, list);

    - -

    return arystr; -} -```

    - -

    This is a real example, so a little bit complicated, but bear with me. -The essence of Array#inspect is that after stringifying each element -of array using inspect method, we join them together so that we can -get inspect representation of the entire array.

    - -

    After the inspect representation is created, we no longer require the -individual string representation. This means that we don’t have to register -these temporal objects into GC arena.

    - -

    Therefore, in order to keep the arena size small; the ary_inspect() function -will do the following:

    - -
      -
    • save the position of the stack top using mrb_gc_arena_save().
    • -
    • get inspect representation of each element.
    • -
    • append it to the constructing entire inspect representation of array.
    • -
    • restore stack top position using mrb_gc_arena_restore().
    • -
    - -

    Please note that the final inspect representation of entire array -was created before the call of mrb_gc_arena_restore(). Otherwise, -required temporal object may be deleted by GC.

    - -

    We may have a usecase where after creating many temporal objects, we’d -like to keep some of them. In this case, we cannot use the same idea -in ary_inspect() like appending objects to existing one. -Instead, after mrb_gc_arena_restore(), we must re-register the objects we -want to keep in the arena using mrb_gc_protect(mrb, obj). -Use mrb_gc_protect() with caution because it could also lead to an “arena -overflow error”.

    - -

    We must also mention that when mrb_funcall is called in top level, the return -value is also registered to GC arena, so repeated use of mrb_funcall may -eventually lead to an “arena overflow error”.

    - -

    Use mrb_gc_arena_save() and mrb_gc_arena_restore() or possible use of -mrb_gc_protect() to workaround this.

    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/file.mrbconf.html b/docs/api/file.mrbconf.html deleted file mode 100644 index 52ab1f8..0000000 --- a/docs/api/file.mrbconf.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - - File: mrbconf - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    mruby configuration macros.

    - -

    How to use these macros.

    -

    You can use mrbconfs with following ways: -* Write them in mrbconf.h. - * Using compiler flags is preferred when building a cross binaries or multiple mruby binaries - since it’s easier to use different mrbconf per each MRuby::Build. - * Most flags can be enabled by just commenting in. -* Pass them as compiler flags. - * Make sure you pass the same flags to all compilers since some mrbconf(e.g., MRB_GC_FIXED_ARENA) - changes struct layout and cause memory access error when C and other language(e.g., C++) is mixed.

    - -

    stdio setting.

    -

    MRB_DISABLE_STDIO -* When defined <stdio.h> functions won’t be used. -* Some features will be disabled when this is enabled: - * mrb_irep load/dump from/to file. - * Compiling mruby script from file. - * Printing features in src/print.c.

    - -

    Debug macros.

    -

    MRB_ENABLE_DEBUG_HOOK -* When defined code fetch hook and debug OP hook will be enabled. -* When using any of the hook set function pointer code_fetch_hook and/or debug_op_hook of mrb_state. -* Fetch hook will be called before any OP. -* Debug OP hook will be called when dispatching OP_DEBUG.

    - -

    MRB_DEBUG -* When defined mrb_assert* macro will be defined with macros from <assert.h>. -* Could be enabled via enable_debug method of MRuby::Build.

    - -

    Stack configuration

    - -

    MRB_STACK_EXTEND_DOUBLING -* If defined doubles the stack size when extending it. -* Else extends stack with MRB_STACK_GROWTH.

    - -

    MRB_STACK_GROWTH -* Default value is 128. -* Used in stack extending. -* Ignored when MRB_STACK_EXTEND_DOUBLING is defined.

    - -

    MRB_STACK_MAX -* Default value is 0x40000 - MRB_STACK_GROWTH. -* Raises RuntimeError when stack size exceeds this value.

    - -

    Primitive type configuration.

    - -

    MRB_USE_FLOAT -* 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_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, 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.

    - -

    MRB_GC_STRESS -* When defined full GC is emitted per each RBasic allocation. -* Mainly used in memory manager debugging.

    - -

    MRB_GC_TURN_OFF_GENERATIONAL -* When defined turns generational GC by default.

    - -

    MRB_GC_FIXED_ARENA -* When defined used fixed size GC arena. -* Raises RuntimeError when this is defined and GC arena size exceeds MRB_GC_ARENA_SIZE. -* Useful tracking unnecessary mruby object allocation.

    - -

    MRB_GC_ARENA_SIZE -* Default value is 100. -* Ignored when MRB_GC_FIXED_ARENA isn’t defined. -* Defines fixed GC arena size.

    - -

    MRB_HEAP_PAGE_SIZE -* Defines value is 1024. -* Specifies number of RBasic per each heap page.

    - -

    Memory pool configuration.

    - -

    POOL_ALIGNMENT -* Default value is 4. -* If you’re allocating data types that requires alignment more than default value define the -largest value of required alignment.

    - -

    POOL_PAGE_SIZE -* Default value is 16000. -* Specifies page size of pool page. -* Smaller the value is increases memory overhead.

    - -

    State atexit configuration.

    - -

    MRB_FIXED_STATE_ATEXIT_STACK -* If defined enables fixed size mrb_state atexit stack. -* Raises RuntimeError when mrb_state_atexit call count to same mrb_state exceeds -MRB_FIXED_STATE_ATEXIT_STACK_SIZE’s value.

    - -

    MRB_FIXED_STATE_ATEXIT_STACK_SIZE -* Default value is 5. -* If MRB_FIXED_STATE_ATEXIT_STACK isn’t defined this macro is ignored.

    - -

    mrb_value configuration.

    - -

    MRB_ENDIAN_BIG -* If defined compiles mruby for big endian machines. -* Used in MRB_NAN_BOXING. -* Some mrbgem use this mrbconf.

    - -

    MRB_NAN_BOXING -* If defined represent mrb_value in boxed double. -* Conflicts with MRB_USE_FLOAT and MRB_WITHOUT_FLOAT.

    - -

    MRB_WORD_BOXING -* If defined represent mrb_value as a word. -* If defined Float will be a mruby object with RBasic.

    - -

    Instance variable configuration.

    -

    MRB_IV_SEGMENT_SIZE -* 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. -* If it isn’t defined, they only support the US-ASCII encoding.

    - -

    MRB_FUNCALL_ARGC_MAX -* Default value is 16. -* Specifies 4th argument(argc) max value of mrb_funcall. -* Raises ArgumentError when the argc argument is bigger then this value mrb_funcall.

    - -

    KHASH_DEFAULT_SIZE -* Default value is 32. -* Specifies default size of khash table bucket. -* Used in kh_init_ ## name function.

    - -

    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.

    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/file.mrbgems.html b/docs/api/file.mrbgems.html deleted file mode 100644 index 3f3bd9a..0000000 --- a/docs/api/file.mrbgems.html +++ /dev/null @@ -1,433 +0,0 @@ - - - - - - - File: mrbgems - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    mrbgems

    - -

    mrbgems is a library manager to integrate C and Ruby extension in an easy and -standardised way into mruby.

    - -

    Usage

    - -

    By default mrbgems is currently deactivated. As soon as you add a GEM to your -build configuration (i.e. build_config.rb), mrbgems will be activated and the -extension integrated.

    - -

    To add a GEM into the build_config.rb add the following line for example: -ruby -conf.gem '/path/to/your/gem/dir' -

    - -

    You can also use a relative path which would be relative from the mruby root: -ruby -conf.gem 'examples/mrbgems/ruby_extension_example' -

    - -

    A remote GIT repository location for a GEM is also supported: -ruby -conf.gem :git => 'https://github.com/masuidrive/mrbgems-example.git', :branch => 'master' -conf.gem :github => 'masuidrive/mrbgems-example', :branch => 'master' -conf.gem :bitbucket => 'mruby/mrbgems-example', :branch => 'master' -

    - -

    You can specify the sub directory of the repository with :path option: -ruby -conf.gem github: 'mruby/mruby', path: 'mrbgems/mruby-socket' -

    - -

    To use mrbgem from mgem-list use :mgem option: -ruby -conf.gem :mgem => 'mruby-yaml' -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.

    - -

    To pull all gems from remote GIT repository on build, call ./minirake -p, -or ./minirake --pull-gems.

    - -

    NOTE: :bitbucket option supports only git. Hg is unsupported in this version.

    - -

    GemBox

    - -

    There are instances when you wish to add a collection of mrbgems into mruby at -once, or be able to substitute mrbgems based on configuration, without having to -add each gem to the build_config.rb file. A packaged collection of mrbgems -is called a GemBox. A GemBox is a file that contains a list of mrbgems to load -into mruby, in the same format as if you were adding them to build_config.rb -via config.gem, but wrapped in an MRuby::GemBox object. GemBoxes are -loaded into mruby via config.gembox 'boxname'.

    - -

    Below we have created a GemBox containing mruby-time and mrbgems-example: -ruby -MRuby::GemBox.new do |conf| - conf.gem "#{root}/mrbgems/mruby-time" - conf.gem :github => 'masuidrive/mrbgems-example' -end -

    - -

    As mentioned, the GemBox uses the same conventions as MRuby::Build. The GemBox -must be saved with a .gembox extension inside the mrbgems directory to to be -picked up by mruby.

    - -

    To use this example GemBox, we save it as custom.gembox inside the mrbgems -directory in mruby, and add the following to our build_config.rb file inside -the build block: -ruby -conf.gembox 'custom' - -This will cause the custom GemBox to be read in during the build process, -adding mruby-time and mrbgems-example to the build.

    - -

    If you want, you can put GemBox outside of mruby directory. In that case you must -specify an absolute path like below. -ruby -conf.gembox "#{ENV["HOME"]}/mygemboxes/custom" -

    - -

    There are two GemBoxes that ship with mruby: default -and full-core. The default GemBox -contains several core components of mruby, and full-core -contains every gem found in the mrbgems directory.

    - -

    GEM Structure

    - -

    The maximal GEM structure looks like this:

    - -
    +- GEM_NAME         <- Name of GEM
    -   |
    -   +- include/      <- Header for Ruby extension (will exported)
    -   |
    -   +- mrblib/       <- Source for Ruby extension
    -   |
    -   +- src/          <- Source for C extension
    -   |
    -   +- test/         <- Test code (Ruby)
    -   |
    -   +- mrbgem.rake   <- GEM Specification
    -   |
    -   +- README.md     <- Readme for GEM
    -
    - -

    The folder mrblib contains pure Ruby files to extend mruby. The folder src -contains C/C++ files to extend mruby. The folder include contains C/C++ header -files. The folder test contains C/C++ and pure Ruby files for testing purposes -which will be used by mrbtest. mrbgem.rake contains the specification -to compile C and Ruby files. README.md is a short description of your GEM.

    - -

    Build process

    - -

    mrbgems expects a specification file called mrbgem.rake inside of your -GEM directory. A typical GEM specification could look like this for example: -ruby -MRuby::Gem::Specification.new('c_and_ruby_extension_example') do |spec| - spec.license = 'MIT' - spec.author = 'mruby developers' - spec.summary = 'Example mrbgem using C and ruby' -end -

    - -

    The mrbgems build process will use this specification to compile Object and Ruby -files. The compilation results will be added to lib/libmruby.a. This file exposes -the GEM functionality to tools like mruby and mirb.

    - -

    The following properties can be set inside of your MRuby::Gem::Specification for -information purpose:

    - -
      -
    • spec.license or spec.licenses (A single license or a list of them under which this GEM is licensed)
    • -
    • spec.author or spec.authors (Developer name or a list of them)
    • -
    • spec.version (Current version)
    • -
    • spec.description (Detailed description)
    • -
    • spec.summary -
        -
      • One line short description of mrbgem.
      • -
      • Printed in build summary of rake when set.
      • -
      -
    • -
    • spec.homepage (Homepage)
    • -
    • spec.requirements (External requirements as information for user)
    • -
    - -

    The license and author properties are required in every GEM!

    - -

    In case your GEM is depending on other GEMs please use -spec.add_dependency(gem, *requirements[, default_get_info]) like: -```ruby -MRuby::Gem::Specification.new(‘c_and_ruby_extension_example’) do |spec| - spec.license = ‘MIT’ - spec.author = ‘mruby developers’

    - -

    # Add GEM dependency mruby-parser. - # The version must be between 1.0.0 and 1.5.2 . - spec.add_dependency(‘mruby-parser’, ‘>= 1.0.0’, ‘<= 1.5.2’)

    - -

    # Use any version of mruby-uv from github. - spec.add_dependency(‘mruby-uv’, ‘>= 0.0.0’, :github => ‘mattn/mruby-uv’)

    - -

    # Use latest mruby-onig-regexp from github. (version requirements can be omitted) - spec.add_dependency(‘mruby-onig-regexp’, :github => ‘mattn/mruby-onig-regexp’)

    - -

    # You can add extra mgems active only on test - spec.add_test_dependency(‘mruby-process’, :github => ‘iij/mruby-process’) -end -```

    - -

    The version requirements and default gem information are optional.

    - -

    Version requirement supports following operators: -* ‘=’: is equal -* ‘!=’: is not equal -* ‘>’: is greater -* ‘<’: is lesser -* ‘>=’: is equal or greater -* ‘<=’: is equal or lesser -* ‘~>’: is equal or greater and is lesser than the next major version - * example 1: ‘~> 2.2.2’ means ‘>= 2.2.2’ and ‘< 2.3.0’ - * example 2: ‘~> 2.2’ means ‘>= 2.2.0’ and ‘< 3.0.0’

    - -

    When more than one version requirements is passed, the dependency must satisfy all of it.

    - -

    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 dependency is required, -use MRuby::Build#gem in build_config.rb to override default gem.

    - -

    If you have conflicting GEMs use the following method: -* spec.add_conflict(gem, *requirements) - * The requirements argument is same as in add_dependency method.

    - -

    like following code: -```ruby -MRuby::Gem::Specification.new ‘some-regexp-binding’ do |spec| - spec.license = ‘BSD’ - spec.author = ‘John Doe’

    - -

    spec.add_conflict ‘mruby-onig-regexp’, ‘> 0.0.0’ - spec.add_conflict ‘mruby-hs-regexp’ - spec.add_conflict ‘mruby-pcre-regexp’ - spec.add_conflict ‘mruby-regexp-pcre’ -end -```

    - -

    In case your GEM has more complex build requirements you can use -the following options additionally inside of your GEM specification:

    - -
      -
    • spec.cc.flags (C compiler flags)
    • -
    • spec.cc.defines (C compiler defines)
    • -
    • spec.cc.include_paths (C compiler include paths)
    • -
    • spec.linker.flags (Linker flags)
    • -
    • spec.linker.libraries (Linker libraries)
    • -
    • spec.linker.library_paths (Linker additional library path)
    • -
    • spec.bins (Generate binary file)
    • -
    • spec.rbfiles (Ruby files to compile)
    • -
    • spec.objs (Object files to compile)
    • -
    • spec.test_rbfiles (Ruby test files for integration into mrbtest)
    • -
    • spec.test_objs (Object test files for integration into mrbtest)
    • -
    • spec.test_preload (Initialization files for mrbtest)
    • -
    - -

    You also can use spec.mruby.cc and spec.mruby.linker to add extra global parameters for compiler and linker.

    - -

    include_paths and dependency

    - -

    Your GEM can export include paths to another GEMs that depends on your GEM. -By default, /...absolute path.../{GEM_NAME}/include will be exported. -So it is recommended not to put GEM’s local header files on include/.

    - -

    These exports are retroactive. -For example: when B depends to C and A depends to B, A will get include paths exported by C.

    - -

    Exported include_paths are automatically appended to GEM local include_paths by Minirake. -You can use spec.export_include_paths accessor if you want more complex build.

    - -

    C Extension

    - -

    mruby can be extended with C. This is possible by using the C API to -integrate C libraries into mruby.

    - -

    Preconditions

    - -

    mrbgems expects that you have implemented a C method called -mrb_YOURGEMNAME_gem_init(mrb_state). YOURGEMNAME will be replaced -by the name of your GEM. If you call your GEM c_extension_example, your -initialisation method could look like this: -C -void -mrb_c_extension_example_gem_init(mrb_state* mrb) { - struct RClass *class_cextension = mrb_define_module(mrb, "CExtension"); - mrb_define_class_method(mrb, class_cextension, "c_method", mrb_c_method, MRB_ARGS_NONE()); -} -

    - -

    Finalize

    - -

    mrbgems expects that you have implemented a C method called -mrb_YOURGEMNAME_gem_final(mrb_state). YOURGEMNAME will be replaced -by the name of your GEM. If you call your GEM c_extension_example, your -finalizer method could look like this:

    - -

    C -void -mrb_c_extension_example_gem_final(mrb_state* mrb) { - free(someone); -} -

    - -

    Example

    - -
    +- c_extension_example/
    -   |
    -   +- src/
    -   |  |
    -   |  +- example.c         <- C extension source
    -   |
    -   +- test/
    -   |  |
    -   |  +- example.rb        <- Test code for C extension
    -   |
    -   +- mrbgem.rake          <- GEM specification
    -   |
    -   +- README.md
    -
    - -

    Ruby Extension

    - -

    mruby can be extended with pure Ruby. It is possible to override existing -classes or add new ones in this way. Put all Ruby files into the mrblib -folder.

    - -

    Pre-Conditions

    - -

    none

    - -

    Example

    - -
    +- ruby_extension_example/
    -   |
    -   +- mrblib/
    -   |  |
    -   |  +- example.rb        <- Ruby extension source
    -   |
    -   +- test/
    -   |  |
    -   |  +- example.rb        <- Test code for Ruby extension
    -   |
    -   +- mrbgem.rake          <- GEM specification
    -   |
    -   +- README.md
    -
    - -

    C and Ruby Extension

    - -

    mruby can be extended with C and Ruby at the same time. It is possible to -override existing classes or add new ones in this way. Put all Ruby files -into the mrblib folder and all C files into the src folder.

    - -

    mruby codes under mrblib directory would be executed after gem init C -function is called. Make sure mruby script depends on C code and -C code doesn’t depend on mruby script.

    - -

    Pre-Conditions

    - -

    See C and Ruby example.

    - -

    Example

    - -
    +- c_and_ruby_extension_example/
    -   |
    -   +- mrblib/
    -   |  |
    -   |  +- example.rb        <- Ruby extension source
    -   |
    -   +- src/
    -   |  |
    -   |  +- example.c         <- C extension source
    -   |
    -   +- test/
    -   |  |
    -   |  +- example.rb        <- Test code for C and Ruby extension
    -   |
    -   +- mrbgem.rake          <- GEM specification
    -   |
    -   +- README.md
    -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/file_list.html b/docs/api/file_list.html deleted file mode 100644 index 41dc94a..0000000 --- a/docs/api/file_list.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - File List - - - -
    -
    -

    File List

    - - - -
    - - -
    - - diff --git a/docs/api/frames.html b/docs/api/frames.html deleted file mode 100644 index 60223fe..0000000 --- a/docs/api/frames.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Documentation by YARD 0.9.20 - - - - diff --git a/docs/api/function_list.html b/docs/api/function_list.html deleted file mode 100644 index b78ad30..0000000 --- a/docs/api/function_list.html +++ /dev/null @@ -1,2627 +0,0 @@ - - - - - - - - - - - - - - - - - - Functions List - - - -
    -
    -

    Functions List

    - - - -
    - - -
    - - diff --git a/docs/api/header_list.html b/docs/api/header_list.html deleted file mode 100644 index 970b30f..0000000 --- a/docs/api/header_list.html +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - - - - - - - - - - - Headers List - - - -
    -
    -

    Headers List

    - - - -
    - - -
    - - diff --git a/docs/api/headers.html b/docs/api/headers.html deleted file mode 100644 index 0b06e4b..0000000 --- a/docs/api/headers.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - Headersroot: headers - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mrbconf.h.html b/docs/api/headers/mrbconf.h.html deleted file mode 100644 index 7d2d0ae..0000000 --- a/docs/api/headers/mrbconf.h.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - Header: mrbconf.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mrbconf.h

    - - - -

    Define Summary

    -
    - -
    #define MRUBYCONF_H - -
    -
    - -
    #define MRB_64BIT - -
    -
    - -
    #define MRB_32BIT - -
    -
    - -
    #define MRB_INT64 -
    -
    -

    Use 64bit integers on 64bit architecture (without MRB_NAN_BOXING)

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_INT32 -
    -
    -

    Otherwise use 32bit integers

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_COMPLEX_NUMBERS - -
    -
    - -
    #define MRB_RATIONAL_NUMBERS - -
    -
    - -
    #define MRB_ENDIAN_BIG - -
    -
    - -
    #define MRB_DISABLE_STDIO - -
    -
    - -
    #define MRB_ENABLE_DEBUG_HOOK - -
    -
    - -
    #define FALSE - -
    -
    - -
    #define TRUE - -
    -
    - -
    #define KHASH_DEFAULT_SIZE - -
    -
    - -
    #define MRB_STR_BUF_MIN_SIZE - -
    -
    - -
    #define MRB_HEAP_PAGE_SIZE - -
    -
    - -
    #define MRB_IV_SEGMENT_SIZE - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby.h.html b/docs/api/headers/mruby.h.html deleted file mode 100644 index 740472c..0000000 --- a/docs/api/headers/mruby.h.html +++ /dev/null @@ -1,7615 +0,0 @@ - - - - - - - Header: mruby.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby.h

    -

    Overview

    -
    -
    -

    MRuby C API entry point

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

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_H - -
    -
    - -
    #define __STDC_LIMIT_MACROS - -
    -
    - -
    #define __STDC_CONSTANT_MACROS - -
    -
    - -
    #define __STDC_FORMAT_MACROS - -
    -
    - -
    #define SIZE_MAX - -
    -
    - -
    #define mrb_assert - -
    -
    - -
    #define mrb_assert_int_fit - -
    -
    - -
    #define mrb_static_assert - -
    -
    - -
    #define FLT_EPSILON - -
    -
    - -
    #define DBL_EPSILON - -
    -
    - -
    #define LDBL_EPSILON - -
    -
    - -
    #define MRB_FLOAT_EPSILON - -
    -
    - -
    #define MRB_FIXED_STATE_ATEXIT_STACK_SIZE - -
    -
    - -
    #define MRB_METHOD_CACHE - -
    -
    - -
    #define MRB_METHOD_CACHE_SIZE -
    -
    -

    cache size needs to be power of 2

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_ARGS_REQ -
    -
    -

    Function requires n arguments.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_ARGS_OPT -
    -
    -

    Function takes n optional arguments

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_ARGS_ARG -
    -
    -

    Function takes n1 mandatory arguments and n2 optional arguments

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_ARGS_REST -
    -
    -

    rest argument

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_ARGS_POST -
    -
    -

    required arguments after rest

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_ARGS_KEY -
    -
    -

    keyword arguments (n of keys, kdict)

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_ARGS_BLOCK -
    -
    -

    Function takes a block argument

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_ARGS_ANY -
    -
    -

    Function accepts any number of arguments

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_ARGS_NONE -
    -
    -

    Function accepts no arguments

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define mrb_strlen_lit -
    -
    -

    strlen for character string literals (use with caution or strlen instead) - Adjacent string literals are concatenated in C/C++ in translation phase 6. - If lit is not one, the compiler will report a syntax error: - MSVC: “error C2143: syntax error : missing ‘)’ before ‘string’” - GCC: “error: expected ‘)’ before string constant”

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define mrb_intern_lit - -
    -
    - -
    #define mrb_sym2name - -
    -
    - -
    #define mrb_sym2name_len - -
    -
    - -
    #define mrb_sym2str - -
    -
    - -
    #define mrb_str_new_lit - -
    -
    - -
    #define mrb_str_new_frozen - -
    -
    - -
    #define mrb_str_new_cstr_frozen - -
    -
    - -
    #define mrb_str_new_static_frozen - -
    -
    - -
    #define mrb_str_new_lit_frozen - -
    -
    - -
    #define mrb_locale_free - -
    -
    - -
    #define mrb_utf8_free - -
    -
    - -
    #define mrb_utf8_from_locale - -
    -
    - -
    #define mrb_locale_from_utf8 - -
    -
    - -
    #define mrb_toplevel_run_keep -
    -
    -

    compatibility macros

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define mrb_toplevel_run - -
    -
    - -
    #define mrb_context_run - -
    -
    - -
    #define mrb_gc_mark_value - -
    -
    - -
    #define mrb_field_write_barrier_value - -
    -
    - -
    #define ISASCII - -
    -
    - -
    #define ISPRINT - -
    -
    - -
    #define ISSPACE - -
    -
    - -
    #define ISLOWER - -
    -
    - -
    #define ISALPHA - -
    -
    - -
    #define ISDIGIT - -
    -
    - -
    #define ISXDIGIT - -
    -
    - -
    #define ISALNUM - -
    -
    - -
    #define ISBLANK - -
    -
    - -
    #define TOUPPER - -
    -
    - -
    #define TOLOWER - -
    -
    - -
    #define E_RUNTIME_ERROR -
    -
    -

    macros to get typical exception objects - note: - + those E_* macros requires mrb_state* variable named mrb. - + exception objects obtained from those macros are local to mrb

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define E_TYPE_ERROR - -
    -
    - -
    #define E_ARGUMENT_ERROR - -
    -
    - -
    #define E_INDEX_ERROR - -
    -
    - -
    #define E_RANGE_ERROR - -
    -
    - -
    #define E_NAME_ERROR - -
    -
    - -
    #define E_NOMETHOD_ERROR - -
    -
    - -
    #define E_SCRIPT_ERROR - -
    -
    - -
    #define E_SYNTAX_ERROR - -
    -
    - -
    #define E_LOCALJUMP_ERROR - -
    -
    - -
    #define E_REGEXP_ERROR - -
    -
    - -
    #define E_FROZEN_ERROR - -
    -
    - -
    #define E_NOTIMP_ERROR - -
    -
    - -
    #define E_FLOATDOMAIN_ERROR - -
    -
    - -
    #define E_KEY_ERROR - -
    -
    - -
    #define mrb_int - -
    -
    - -
    #define E_FIBER_ERROR -
    -
    -

    FiberError reference

    - -

    Implemented in mruby-fiber

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define memcpy - -
    -
    - -
    #define memset - -
    -
    - -
    - - -

    Typedef Summary

    -
    - -
    typedef mrb_code -
    -
    -

    MRuby C API entry point

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    typedef mrb_aspec -
    -
    -

    \class mrb_aspec

    - -

    Specifies the number of arguments a function takes

    - -

    Example: MRB_ARGS_REQ(2) | MRB_ARGS_OPT(1) for a method that expects 2..3 arguments

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    typedef mrb_method_t - -
    -
    - -
    typedef mrb_args_format -
    -
    -

    Format specifiers for mrb_get_args function

    - -

    Must be a C string composed of the following format specifiers:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    charRuby typeC typesNotes
    oObjectmrb_valueCould be used to retrieve any type of argument
    CClass/Modulemrb_value 
    SStringmrb_valuewhen ! follows, the value may be nil
    AArraymrb_valuewhen ! follows, the value may be nil
    HHashmrb_valuewhen ! follows, the value may be nil
    sStringchar *, mrb_intReceive two arguments; s! gives (NULL,0) for nil
    zStringchar *NULL terminated string; z! gives NULL for nil
    aArraymrb_value *, mrb_intReceive two arguments; a! gives (NULL,0) for nil
    fFixnum/Floatmrb_float 
    iFixnum/Floatmrb_int 
    bbooleanmrb_bool 
    nString/Symbolmrb_sym 
    ddatavoid *, mruby.h.mrb_data_type const2nd argument will be used to check data type so it won’t be modified; when ! follows, the value may be nil
    Iinline structvoid * 
    &blockmrb_value&! raises exception if no block given.
    *rest argumentsmrb_value *, mrb_intReceive the rest of arguments as an array; *! avoid copy of the stack.
    \|optional After this spec following specs would be optional.
    ?optional givenmrb_boolTRUE if preceding argument is given. Used to check optional argument is given.
    :keyword argsmrb_kwargs constGet keyword arguments. @see mrb_kwargs
    - - -
    -
    -
    - - -

    See Also:

    - - -
    - - -
    -
    - -
    typedef mrb_kwargs -
    -
    -

    Get keyword arguments by mrb_get_args() with : specifier.

    - -

    mrb_kwargs::num indicates that the number of keyword values.

    - -

    mrb_kwargs::values is an object array, and the keyword argument corresponding to the string array is assigned. -Note that undef is assigned if there is no keyword argument corresponding to mrb_kwargs::optional.

    - -

    mrb_kwargs::table accepts a string array.

    - -

    mrb_kwargs::required indicates that the specified number of keywords starting from the beginning of the string array are required.

    - -

    mrb_kwargs::rest is the remaining keyword argument that can be accepted as **rest in Ruby. -If NULL is specified, ArgumentError is raised when there is an undefined keyword.

    - -

    Examples:

    - -
     // def method(a: 1, b: 2)
    -
    - uint32_t kw_num = 2;
    - const char *kw_names[kw_num] = { "a", "b" };
    - uint32_t kw_required = 0;
    - mrb_value kw_values[kw_num];
    - const mrb_kwargs kwargs = { kw_num, kw_values, kw_names, kw_required, NULL };
    -
    - mrb_get_args(mrb, ":", &kwargs);
    - if (mrb_undef_p(kw_values[0])) { kw_values[0] = mrb_fixnum_value(1); }
    - if (mrb_undef_p(kw_values[1])) { kw_values[1] = mrb_fixnum_value(2); }
    -
    -
    - // def method(str, x:, y: 2, z: "default string", **opts)
    -
    - mrb_value str, kw_rest;
    - uint32_t kw_num = 3;
    - const char *kw_names[kw_num] = { "x", "y", "z" };
    - uint32_t kw_required = 1;
    - mrb_value kw_values[kw_num];
    - const mrb_kwargs kwargs = { kw_num, kw_values, kw_names, kw_required, &kw_rest };
    -
    - mrb_get_args(mrb, "S:", &str, &kwargs);
    - // or: mrb_get_args(mrb, ":S", &kwargs, &str);
    - if (mrb_undef_p(kw_values[1])) { kw_values[1] = mrb_fixnum_value(2); }
    - if (mrb_undef_p(kw_values[2])) { kw_values[2] = mrb_str_new_cstr(mrb, "default string"); }
    -
    - - -
    -
    -
    - - -
    - - -
    -
    - -
    typedef mrb_pool -
    -
    -

    memory pool implementation

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

    Function Details

    - - -
    -

    - struct RClass * mrb_define_class(mrb_state * mrb, const char * name, struct RClass * super) - - -

    -
    -
    -

    Defines a new class.

    - -

    If you’re creating a gem it may look something like this:

    - -
     void mrb_example_gem_init(mrb_state* mrb) {
    -     struct RClass *example_class;
    -     example_class = mrb_define_class(mrb, "Example_Class", mrb->object_class);
    - }
    -
    - void mrb_example_gem_final(mrb_state* mrb) {
    -     //free(TheAnimals);
    - }
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the defined class.

      -
      - -
    • - -
    • - - super - - - - - - - — -

      The new class parent.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (struct RClass *) - - - - — -

      Reference to the newly defined class.

      -
      - -
    • - -
    - -

    See Also:

    - - -
    - - -
    - - -
    -

    - struct RClass * mrb_define_module(mrb_state * mrb, const char * name) - - -

    -
    -
    -

    Defines a new module.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the module.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (struct RClass *) - - - - — -

      Reference to the newly defined module.

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

    - mrb_value mrb_singleton_class(mrb_state * mrb, mrb_value val) - - -

    - -
    - - -
    -

    - void mrb_include_module(mrb_state * mrb, struct RClass * cla, struct RClass * included) - - -

    -
    -
    -

    Include a module in another class or module. -Equivalent to:

    - -

    module B - include A - end

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - cla - - - - - - - — -

      A reference to module or a class.

      -
      - -
    • - -
    • - - included - - - - - - - — -

      A reference to the module to be included.

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

    - void mrb_prepend_module(mrb_state * mrb, struct RClass * cla, struct RClass * prepended) - - -

    -
    -
    -

    Prepends a module in another class or module.

    - -

    Equivalent to: - module B - prepend A - end

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - cla - - - - - - - — -

      A reference to module or a class.

      -
      - -
    • - -
    • - - prepended - - - - - - - — -

      A reference to the module to be prepended.

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

    - void mrb_define_method(mrb_state * mrb, struct RClass * cla, const char * name, mrb_func_t func, mrb_aspec aspec) - - -

    -
    -
    -

    Defines a global function in ruby.

    - -

    If you’re creating a gem it may look something like this

    - -

    Example:

    - -
    mrb_value example_method(mrb_state* mrb, mrb_value self)
    -{
    -     puts("Executing example command!");
    -     return self;
    -}
    -
    -void mrb_example_gem_init(mrb_state* mrb)
    -{
    -      mrb_define_method(mrb, mrb->kernel_module, "example_method", example_method, MRB_ARGS_NONE());
    -}
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The MRuby state reference.

      -
      - -
    • - -
    • - - cla - - - - - - - — -

      The class pointer where the method will be defined.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the method being defined.

      -
      - -
    • - -
    • - - func - - - - - - - — -

      The function pointer to the method definition.

      -
      - -
    • - -
    • - - aspec - - - - - - - — -

      The method parameters declaration.

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

    - void mrb_define_class_method(mrb_state * mrb, struct RClass * cla, const char * name, mrb_func_t fun, mrb_aspec aspec) - - -

    -
    -
    -

    Defines a class method.

    - -

    Example:

    - -
    # Ruby style
    -class Foo
    -  def Foo.bar
    -  end
    -end
    -// C style
    -mrb_value bar_method(mrb_state* mrb, mrb_value self){
    -  return mrb_nil_value();
    -}
    -void mrb_example_gem_init(mrb_state* mrb){
    -  struct RClass *foo;
    -  foo = mrb_define_class(mrb, "Foo", mrb->object_class);
    -  mrb_define_class_method(mrb, foo, "bar", bar_method, MRB_ARGS_NONE());
    -}
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The MRuby state reference.

      -
      - -
    • - -
    • - - cla - - - - - - - — -

      The class where the class method will be defined.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the class method being defined.

      -
      - -
    • - -
    • - - fun - - - - - - - — -

      The function pointer to the class method definition.

      -
      - -
    • - -
    • - - aspec - - - - - - - — -

      The method parameters declaration.

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

    - void mrb_define_singleton_method(mrb_state * mrb, struct RObject * cla, const char * name, mrb_func_t fun, mrb_aspec aspec) - - -

    -
    -
    -

    Defines a singleton method

    - - -
    -
    -
    - - -

    See Also:

    - - -
    - - -
    - - -
    -

    - void mrb_define_module_function(mrb_state * mrb, struct RClass * cla, const char * name, mrb_func_t fun, mrb_aspec aspec) - - -

    -
    -
    -

    Defines a module function.

    - -

    Example:

    - -
      # Ruby style
    -  module Foo
    -    def Foo.bar
    -    end
    -  end
    -  // C style
    -  mrb_value bar_method(mrb_state* mrb, mrb_value self){
    -    return mrb_nil_value();
    -  }
    -  void mrb_example_gem_init(mrb_state* mrb){
    -    struct RClass *foo;
    -    foo = mrb_define_module(mrb, "Foo");
    -    mrb_define_module_function(mrb, foo, "bar", bar_method, MRB_ARGS_NONE());
    -  }
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The MRuby state reference.

      -
      - -
    • - -
    • - - cla - - - - - - - — -

      The module where the module function will be defined.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the module function being defined.

      -
      - -
    • - -
    • - - fun - - - - - - - — -

      The function pointer to the module function definition.

      -
      - -
    • - -
    • - - aspec - - - - - - - — -

      The method parameters declaration.

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

    - void mrb_define_const(mrb_state* mrb, struct RClass* cla, const char * name, mrb_value val) - - -

    -
    -
    -

    Defines a constant.

    - -

    Example:

    - -
        # Ruby style
    -    class ExampleClass
    -      AGE = 22
    -    end
    -    // C style
    -    #include <stdio.h>
    -    #include <mruby.h>
    -
    -    void
    -    mrb_example_gem_init(mrb_state* mrb){
    -      mrb_define_const(mrb, mrb->kernel_module, "AGE", mrb_fixnum_value(22));
    -    }
    -
    -    mrb_value
    -    mrb_example_gem_final(mrb_state* mrb){
    -    }
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The MRuby state reference.

      -
      - -
    • - -
    • - - cla - - - - - - - — -

      A class or module the constant is defined in.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the constant being defined.

      -
      - -
    • - -
    • - - val - - - - - - - — -

      The value for the constant.

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

    - void mrb_undef_method(mrb_state * mrb, struct RClass * cla, const char * name) - - -

    -
    -
    -

    Undefines a method.

    - -

    Example:

    - -
    # Ruby style
    -
    -class ExampleClassA
    -  def example_method
    -    "example"
    -  end
    -end
    -ExampleClassA.new.example_method # => example
    -
    -class ExampleClassB < ExampleClassA
    -  undef_method :example_method
    -end
    -
    -ExampleClassB.new.example_method # => undefined method 'example_method' for ExampleClassB (NoMethodError)
    -
    -// C style
    -#include <stdio.h>
    -#include <mruby.h>
    -
    -mrb_value
    -mrb_example_method(mrb_state *mrb){
    -  return mrb_str_new_lit(mrb, "example");
    -}
    -
    -void
    -mrb_example_gem_init(mrb_state* mrb){
    -  struct RClass *example_class_a;
    -  struct RClass *example_class_b;
    -  struct RClass *example_class_c;
    -
    -  example_class_a = mrb_define_class(mrb, "ExampleClassA", mrb->object_class);
    -  mrb_define_method(mrb, example_class_a, "example_method", mrb_example_method, MRB_ARGS_NONE());
    -  example_class_b = mrb_define_class(mrb, "ExampleClassB", example_class_a);
    -  example_class_c = mrb_define_class(mrb, "ExampleClassC", example_class_b);
    -  mrb_undef_method(mrb, example_class_c, "example_method");
    -}
    -
    -mrb_example_gem_final(mrb_state* mrb){
    -}
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - cla - - - - - - - — -

      The class the method will be undefined from.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the method to be undefined.

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

    - void mrb_undef_method_id(mrb_state* , struct RClass* , mrb_sym ) - - -

    - -
    - - -
    -

    - void mrb_undef_class_method(mrb_state * mrb, struct RClass * cls, const char * name) - - -

    -
    -
    -

    Undefine a class method. -Example:

    - -
     # Ruby style
    - class ExampleClass
    -   def self.example_method
    -     "example"
    -   end
    - end
    -
    -ExampleClass.example_method
    -
    -// C style
    -#include <stdio.h>
    -#include <mruby.h>
    -
    -mrb_value
    -mrb_example_method(mrb_state *mrb){
    -  return mrb_str_new_lit(mrb, "example");
    -}
    -
    -void
    -mrb_example_gem_init(mrb_state* mrb){
    -  struct RClass *example_class;
    -  example_class = mrb_define_class(mrb, "ExampleClass", mrb->object_class);
    -  mrb_define_class_method(mrb, example_class, "example_method", mrb_example_method, MRB_ARGS_NONE());
    -  mrb_undef_class_method(mrb, example_class, "example_method");
    - }
    -
    - void
    - mrb_example_gem_final(mrb_state* mrb){
    - }
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - cls - - - - - - - — -

      A class the class method will be undefined from.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the class method to be undefined.

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

    - mrb_value mrb_obj_new(mrb_state * mrb, struct RClass * c, mrb_int argc, const mrb_value * argv) - - -

    -
    -
    -

    Initialize a new object instance of c class.

    - -

    Example:

    - -
    # Ruby style
    -class ExampleClass
    -end
    -
    -p ExampleClass # => #<ExampleClass:0x9958588>
    -// C style
    -#include <stdio.h>
    -#include <mruby.h>
    -
    -void
    -mrb_example_gem_init(mrb_state* mrb) {
    -  struct RClass *example_class;
    -  mrb_value obj;
    -  example_class = mrb_define_class(mrb, "ExampleClass", mrb->object_class); # => class ExampleClass; end
    -  obj = mrb_obj_new(mrb, example_class, 0, NULL); # => ExampleClass.new
    -  mrb_p(mrb, obj); // => Kernel#p
    - }
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - c - - - - - - - — -

      Reference to the class of the new object.

      -
      - -
    • - -
    • - - argc - - - - - - - — -

      Number of arguments in argv

      -
      - -
    • - -
    • - - argv - - - - - - - — -

      Array of mrb_value to initialize the object

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      The newly initialized object

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

    - mrb_value mrb_class_new_instance(mrb_state * mrb, mrb_int argc, const mrb_value * argv, struct RClass * c) - - -

    -
    -
    - - - -
    -
    -
    - - -

    See Also:

    - - -
    - - -
    - - -
    -

    - struct RClass * mrb_class_new(mrb_state * mrb, struct RClass * super) - - -

    -
    -
    -

    Creates a new instance of Class, Class.

    - -

    Example:

    - -
     void
    - mrb_example_gem_init(mrb_state* mrb) {
    -   struct RClass *example_class;
    -
    -   mrb_value obj;
    -   example_class = mrb_class_new(mrb, mrb->object_class);
    -   obj = mrb_obj_new(mrb, example_class, 0, NULL); // => #<#<Class:0x9a945b8>:0x9a94588>
    -   mrb_p(mrb, obj); // => Kernel#p
    -  }
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - super - - - - - - - — -

      The super class or parent.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (struct RClass *) - - - - — -

      Reference to the new class.

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

    - struct RClass * mrb_module_new(mrb_state * mrb) - - -

    -
    -
    -

    Creates a new module, Module.

    - -

    Example: - void - mrb_example_gem_init(mrb_state* mrb) { - struct RClass *example_module;

    - -
       example_module = mrb_module_new(mrb);
    - }
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (struct RClass *) - - - - — -

      Reference to the new module.

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

    - mrb_bool mrb_class_defined(mrb_state * mrb, const char * name) - - -

    -
    -
    -

    Returns an mrb_bool. True if class was defined, and false if the class was not defined.

    - -

    Example: - void - mrb_example_gem_init(mrb_state* mrb) { - struct RClass *example_class; - mrb_bool cd;

    - -
      example_class = mrb_define_class(mrb, "ExampleClass", mrb->object_class);
    -  cd = mrb_class_defined(mrb, "ExampleClass");
    -
    -  // If mrb_class_defined returns 1 then puts "True"
    -  // If mrb_class_defined returns 0 then puts "False"
    -  if (cd == 1){
    -    puts("True");
    -  }
    -  else {
    -    puts("False");
    -  }
    - }
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      A string representing the name of the class.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_bool) - - - - — -

      A boolean value.

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

    - struct RClass * mrb_class_get(mrb_state * mrb, const char * name) - - -

    -
    -
    -

    Gets a class.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the class.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (struct RClass *) - - - - — -

      A reference to the class.

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

    - struct RClass * mrb_exc_get(mrb_state * mrb, const char * name) - - -

    -
    -
    -

    Gets a exception class.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the class.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (struct RClass *) - - - - — -

      A reference to the class.

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

    - mrb_bool mrb_class_defined_under(mrb_state * mrb, struct RClass * outer, const char * name) - - -

    -
    -
    -

    Returns an mrb_bool. True if inner class was defined, and false if the inner class was not defined.

    - -

    Example: - void - mrb_example_gem_init(mrb_state* mrb) { - struct RClass *example_outer, *example_inner; - mrb_bool cd;

    - -
      example_outer = mrb_define_module(mrb, "ExampleOuter");
    -
    -  example_inner = mrb_define_class_under(mrb, example_outer, "ExampleInner", mrb->object_class);
    -  cd = mrb_class_defined_under(mrb, example_outer, "ExampleInner");
    -
    -  // If mrb_class_defined_under returns 1 then puts "True"
    -  // If mrb_class_defined_under returns 0 then puts "False"
    -  if (cd == 1){
    -    puts("True");
    -  }
    -  else {
    -    puts("False");
    -  }
    - }
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - outer - - - - - - - — -

      The name of the outer class.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      A string representing the name of the inner class.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_bool) - - - - — -

      A boolean value.

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

    - struct RClass * mrb_class_get_under(mrb_state * mrb, struct RClass * outer, const char * name) - - -

    -
    -
    -

    Gets a child class.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - outer - - - - - - - — -

      The name of the parent class.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the class.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (struct RClass *) - - - - — -

      A reference to the class.

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

    - struct RClass * mrb_module_get(mrb_state * mrb, const char * name) - - -

    -
    -
    -

    Gets a module.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the module.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (struct RClass *) - - - - — -

      A reference to the module.

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

    - struct RClass * mrb_module_get_under(mrb_state * mrb, struct RClass * outer, const char * name) - - -

    -
    -
    -

    Gets a module defined under another module.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - outer - - - - - - - — -

      The name of the outer module.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the module.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (struct RClass *) - - - - — -

      A reference to the module.

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

    - void mrb_notimplement(mrb_state* ) - - -

    -
    -
    -

    a function to raise NotImplementedError with current method name

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

    - mrb_value mrb_notimplement_m(mrb_state* , mrb_value ) - - -

    -
    -
    -

    a function to be replacement of unimplemented method

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

    - mrb_value mrb_obj_dup(mrb_state * mrb, mrb_value obj) - - -

    -
    -
    -

    Duplicate an object.

    - -

    Equivalent to: - Object#dup

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - obj - - - - - - - — -

      Object to be duplicate.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      The newly duplicated object.

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

    - mrb_bool mrb_obj_respond_to(mrb_state * mrb, struct RClass* c, mrb_sym mid) - - -

    -
    -
    -

    Returns true if obj responds to the given method. If the method was defined for that -class it returns true, it returns false otherwise.

    - -
     Example:
    - # Ruby style
    - class ExampleClass
    -   def example_method
    -   end
    - end
    -
    - ExampleClass.new.respond_to?(:example_method) # => true
    -
    - // C style
    - void
    - mrb_example_gem_init(mrb_state* mrb) {
    -   struct RClass *example_class;
    -   mrb_sym mid;
    -   mrb_bool obj_resp;
    -
    -   example_class = mrb_define_class(mrb, "ExampleClass", mrb->object_class);
    -   mrb_define_method(mrb, example_class, "example_method", exampleMethod, MRB_ARGS_NONE());
    -   mid = mrb_intern_str(mrb, mrb_str_new_lit(mrb, "example_method" ));
    -   obj_resp = mrb_obj_respond_to(mrb, example_class, mid); // => 1(true in Ruby world)
    -
    -   // If mrb_obj_respond_to returns 1 then puts "True"
    -   // If mrb_obj_respond_to returns 0 then puts "False"
    -   if (obj_resp == 1) {
    -     puts("True");
    -   }
    -   else if (obj_resp == 0) {
    -     puts("False");
    -   }
    - }
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - c - - - - - - - — -

      A reference to a class.

      -
      - -
    • - -
    • - - mid - - - - - - - — -

      A symbol referencing a method id.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_bool) - - - - — -

      A boolean value.

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

    - struct RClass * mrb_define_class_under(mrb_state * mrb, struct RClass * outer, const char * name, struct RClass * super) - - -

    -
    -
    -

    Defines a new class under a given module

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - outer - - - - - - - — -

      Reference to the module under which the new class will be defined

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the defined class

      -
      - -
    • - -
    • - - super - - - - - - - — -

      The new class parent

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (struct RClass *) - - - - — -

      Reference to the newly defined class

      -
      - -
    • - -
    - -

    See Also:

    - - -
    - - -
    - - -
    -

    - struct RClass * mrb_define_module_under(mrb_state * mrb, struct RClass * outer, const char * name) - - -

    - -
    - - -
    -

    - mrb_int mrb_get_args(mrb_state * mrb, mrb_args_format format, ... ) - - -

    -
    -
    -

    Retrieve arguments from mrb_state.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current MRuby state.

      -
      - -
    • - -
    • - - format - - - - - - - — -

      is a list of format specifiers

      -
      - -
    • - -
    • - - ... - - - - - - - — -

      The passing variadic arguments must be a pointer of retrieving type.

      -
      - -
    • - -
    - -

    Returns:

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

      the number of arguments retrieved.

      -
      - -
    • - -
    - -

    See Also:

    - - -
    - - -
    - - -
    -

    - mrb_sym mrb_get_mid(mrb_state * mrb) - - -

    -
    -
    -

    get method symbol

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

    - mrb_int mrb_get_argc(mrb_state * mrb) - - -

    -
    -
    -

    Retrieve number of arguments from mrb_state.

    - -

    Correctly handles *splat arguments.

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

    - mrb_value* mrb_get_argv(mrb_state * mrb) - - -

    - -
    - - -
    -

    - mrb_value mrb_funcall(mrb_state * mrb, mrb_value val, const char * name, mrb_int argc, ... ) - - -

    -
    -
    -

    Call existing ruby functions.

    - -

    Example:

    - -
     #include <stdio.h>
    - #include <mruby.h>
    - #include "mruby/compile.h"
    -
    - int
    - main()
    - {
    -   mrb_int i = 99;
    -   mrb_state *mrb = mrb_open();
    -
    -   if (!mrb) { }
    -   FILE *fp = fopen("test.rb","r");
    -   mrb_value obj = mrb_load_file(mrb,fp);
    -   mrb_funcall(mrb, obj, "method_name", 1, mrb_fixnum_value(i));
    -   fclose(fp);
    -   mrb_close(mrb);
    - }
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - val - - - - - - - — -

      A reference to an mruby value.

      -
      - -
    • - -
    • - - name - - - - - - - — -

      The name of the method.

      -
      - -
    • - -
    • - - argc - - - - - - - — -

      The number of arguments the method has.

      -
      - -
    • - -
    • - - ... - - - - - - - — -

      Variadic values(not type safe!).

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      mruby function value.

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

    - mrb_value mrb_funcall_argv(mrb_state * mrb, mrb_value val, mrb_sym name, mrb_int argc, const mrb_value * argv) - - -

    -
    -
    -

    Call existing ruby functions. This is basically the type safe version of mrb_funcall.

    - -
     #include <stdio.h>
    - #include <mruby.h>
    - #include "mruby/compile.h"
    - int
    - main()
    - {
    -   mrb_int i = 99;
    -   mrb_state *mrb = mrb_open();
    -
    -   if (!mrb) { }
    -   mrb_sym m_sym = mrb_intern_lit(mrb, "method_name"); // Symbol for method.
    -
    -   FILE *fp = fopen("test.rb","r");
    -   mrb_value obj = mrb_load_file(mrb,fp);
    -   mrb_funcall_argv(mrb, obj, m_sym, 1, &obj); // Calling ruby function from test.rb.
    -   fclose(fp);
    -   mrb_close(mrb);
    -  }
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - val - - - - - - - — -

      A reference to an mruby value.

      -
      - -
    • - -
    • - - name_sym - - - - - - - — -

      The symbol representing the method.

      -
      - -
    • - -
    • - - argc - - - - - - - — -

      The number of arguments the method has.

      -
      - -
    • - -
    • - - obj - - - - - - - — -

      Pointer to the object.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      mrb_value mruby function value.

      -
      - -
    • - -
    - -

    See Also:

    - - -
    - - -
    - - -
    -

    - mrb_value mrb_funcall_with_block(mrb_state * mrb, mrb_value val, mrb_sym name, mrb_int argc, const mrb_value * argv, mrb_value block) - - -

    -
    -
    -

    Call existing ruby functions with a block.

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

    - mrb_sym mrb_intern_cstr(mrb_state * mrb, const char* str) - - -

    -
    -
    -

    Create a symbol

    - -

    Example:

    - -
    # Ruby style:
    -:pizza # => :pizza
    -
    -// C style:
    -mrb_sym m_sym = mrb_intern_lit(mrb, "pizza"); //  => :pizza
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - str - - - - - - - — -

      The string to be symbolized

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_sym) - - - - — -

      mrb_sym A symbol.

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

    - mrb_sym mrb_intern(mrb_state* , const char* , size_t ) - - -

    - -
    - - -
    -

    - mrb_sym mrb_intern_static(mrb_state* , const char* , size_t ) - - -

    - -
    - - -
    -

    - mrb_sym mrb_intern_str(mrb_state* , mrb_value ) - - -

    - -
    - - -
    -

    - mrb_value mrb_check_intern_cstr(mrb_state* , const char* ) - - -

    - -
    - - -
    -

    - mrb_value mrb_check_intern(mrb_state* , const char* , size_t ) - - -

    - -
    - - -
    -

    - mrb_value mrb_check_intern_str(mrb_state* , mrb_value ) - - -

    - -
    - - -
    -

    - mrb_value mrb_sym_str(mrb_state* , mrb_sym ) - - -

    - -
    - - -
    -

    - void * mrb_malloc(mrb_state* , size_t ) - - -

    -
    -
    -

    raise RuntimeError if no mem

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

    - void * mrb_calloc(mrb_state* , size_t , size_t ) - - -

    -
    -
    -

    ditto

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

    - void * mrb_realloc(mrb_state* , void* , size_t ) - - -

    -
    -
    -

    ditto

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

    - void * mrb_realloc_simple(mrb_state* , void* , size_t ) - - -

    -
    -
    -

    return NULL if no memory available

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

    - void * mrb_malloc_simple(mrb_state* , size_t ) - - -

    -
    -
    -

    return NULL if no memory available

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

    - struct RBasic * mrb_obj_alloc(mrb_state* , enum mrb_vtype, struct RClass* ) - - -

    -
    -
    -

    return NULL if no memory available

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

    - void mrb_free(mrb_state* , void* ) - - -

    - -
    - - -
    -

    - mrb_value mrb_str_new(mrb_state * mrb, const char * p, size_t len) - - -

    - -
    - - -
    -

    - mrb_value mrb_str_new_cstr(mrb_state* , const char* ) - - -

    -
    -
    -

    Turns a C string into a Ruby string value.

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

    - mrb_value mrb_str_new_static(mrb_state * mrb, const char * p, size_t len) - - -

    - -
    - - -
    -

    - mrb_value mrb_obj_freeze(mrb_state* , mrb_value ) - - -

    - -
    - - -
    -

    - mrb_state* mrb_open(void) - - -

    -
    -
    -

    Creates new mrb_state.

    - - -
    -
    -
    - -

    Returns:

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

      Pointer to the newly created mrb_state.

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

    - mrb_state* mrb_open_allocf(mrb_allocf f, void * ud) - - -

    -
    -
    -

    Create new mrb_state with custom allocators.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - f - - - - - - - — -

      Reference to the allocation function.

      -
      - -
    • - -
    • - - ud - - - - - - - — -

      User data will be passed to custom allocator f. -If user data isn’t required just pass NULL.

      -
      - -
    • - -
    - -

    Returns:

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

      Pointer to the newly created mrb_state.

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

    - mrb_state* mrb_open_core(mrb_allocf f, void * ud) - - -

    -
    -
    -

    Create new mrb_state with just the MRuby core

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - f - - - - - - - — -

      Reference to the allocation function. -Use mrb_default_allocf for the default

      -
      - -
    • - -
    • - - ud - - - - - - - — -

      User data will be passed to custom allocator f. -If user data isn’t required just pass NULL.

      -
      - -
    • - -
    - -

    Returns:

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

      Pointer to the newly created mrb_state.

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

    - void mrb_close(mrb_state * mrb) - - -

    -
    -
    -

    Closes and frees a mrb_state.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      Pointer to the mrb_state to be closed.

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

    - void* mrb_default_allocf(mrb_state* , void* , size_t , void* ) - - -

    -
    -
    -

    The default allocation function.

    - - -
    -
    -
    - - -

    See Also:

    -
      - -
    • mruby.h.mrb_allocf
    • - -
    - -
    - - -
    - - -
    -

    - mrb_value mrb_top_self(mrb_state * mrb) - - -

    - -
    - - -
    -

    - mrb_value mrb_run(mrb_state * mrb, struct RProc* proc, mrb_value self) - - -

    - -
    - - -
    -

    - mrb_value mrb_top_run(mrb_state * mrb, struct RProc * proc, mrb_value self, unsigned int, stack_keep ) - - -

    - -
    - - -
    -

    - mrb_value mrb_vm_run(mrb_state * mrb, struct RProc * proc, mrb_value self, unsigned int, stack_keep ) - - -

    - -
    - - -
    -

    - mrb_value mrb_vm_exec(mrb_state * mrb, struct RProc * proc, const mrb_code * iseq) - - -

    - -
    - - -
    -

    - void mrb_p(mrb_state* , mrb_value ) - - -

    - -
    - - -
    -

    - mrb_int mrb_obj_id(mrb_value obj) - - -

    - -
    - - -
    -

    - mrb_sym mrb_obj_to_sym(mrb_state * mrb, mrb_value name) - - -

    - -
    - - -
    -

    - mrb_bool mrb_obj_eq(mrb_state * mrb, mrb_value a, mrb_value b) - - -

    - -
    - - -
    -

    - mrb_bool mrb_obj_equal(mrb_state * mrb, mrb_value a, mrb_value b) - - -

    - -
    - - -
    -

    - mrb_bool mrb_equal(mrb_state * mrb, mrb_value obj1, mrb_value obj2) - - -

    - -
    - - -
    -

    - mrb_value mrb_convert_to_integer(mrb_state * mrb, mrb_value val, mrb_int base) - - -

    - -
    - - -
    -

    - mrb_value mrb_Integer(mrb_state * mrb, mrb_value val) - - -

    - -
    - - -
    -

    - mrb_value mrb_Float(mrb_state * mrb, mrb_value val) - - -

    - -
    - - -
    -

    - mrb_value mrb_inspect(mrb_state * mrb, mrb_value obj) - - -

    - -
    - - -
    -

    - mrb_bool mrb_eql(mrb_state * mrb, mrb_value obj1, mrb_value obj2) - - -

    - -
    - - -
    -

    - mrb_int mrb_cmp(mrb_state * mrb, mrb_value obj1, mrb_value obj2) - - -

    -
    -
    -

    mrb_cmp(mrb, obj1, obj2): 1:0:-1; -2 for error

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

    - int mrb_gc_arena_save(mrb_state * mrb) - - -

    - -
    - - -
    -

    - void mrb_gc_arena_restore(mrb_state * mrb, int idx) - - -

    - -
    - - -
    -

    - void mrb_garbage_collect(mrb_state* ) - - -

    - -
    - - -
    -

    - void mrb_full_gc(mrb_state* ) - - -

    - -
    - - -
    -

    - void mrb_incremental_gc(mrb_state * ) - - -

    - -
    - - -
    -

    - void mrb_gc_mark(mrb_state* , struct RBasic* ) - - -

    - -
    - - -
    -

    - void mrb_field_write_barrier(mrb_state * , struct RBasic* , struct RBasic* ) - - -

    - -
    - - -
    -

    - void mrb_write_barrier(mrb_state * , struct RBasic* ) - - -

    - -
    - - -
    -

    - mrb_value mrb_check_convert_type(mrb_state * mrb, mrb_value val, enum mrb_vtype, type , const char * tname, const char * method) - - -

    - -
    - - -
    -

    - mrb_value mrb_any_to_s(mrb_state * mrb, mrb_value obj) - - -

    - -
    - - -
    -

    - struct RClass* mrb_obj_class(mrb_state * mrb, mrb_value obj) - - -

    - -
    - - -
    -

    - mrb_value mrb_class_path(mrb_state * mrb, struct RClass * c) - - -

    - -
    - - -
    -

    - mrb_value mrb_convert_type(mrb_state * mrb, mrb_value val, enum mrb_vtype, type , const char * tname, const char * method) - - -

    - -
    - - -
    -

    - mrb_bool mrb_obj_is_kind_of(mrb_state * mrb, mrb_value obj, struct RClass * c) - - -

    - -
    - - -
    -

    - mrb_value mrb_obj_inspect(mrb_state * mrb, mrb_value self) - - -

    - -
    - - -
    -

    - mrb_value mrb_obj_clone(mrb_state * mrb, mrb_value self) - - -

    - -
    - - -
    -

    - mrb_value mrb_exc_new(mrb_state * mrb, struct RClass * c, const char * ptr, size_t len) - - -

    - -
    - - -
    -

    - mrb_noreturn mrb_exc_raise(mrb_state * mrb, mrb_value exc) - - -

    - -
    - - -
    -

    - mrb_noreturn mrb_raise(mrb_state * mrb, struct RClass * c, const char * msg) - - -

    - -
    - - -
    -

    - mrb_noreturn mrb_raisef(mrb_state * mrb, struct RClass * c, const char * fmt, ... ) - - -

    - -
    - - -
    -

    - mrb_noreturn mrb_name_error(mrb_state * mrb, mrb_sym id, const char * fmt, ... ) - - -

    - -
    - - -
    -

    - mrb_noreturn mrb_frozen_error(mrb_state * mrb, void * frozen_obj) - - -

    - -
    - - -
    -

    - void mrb_warn(mrb_state * mrb, const char * fmt, ... ) - - -

    - -
    - - -
    -

    - mrb_noreturn mrb_bug(mrb_state * mrb, const char * fmt, ... ) - - -

    - -
    - - -
    -

    - void mrb_print_backtrace(mrb_state * mrb) - - -

    - -
    - - -
    -

    - void mrb_print_error(mrb_state * mrb) - - -

    - -
    - - -
    -

    - mrb_value mrb_vformat(mrb_state * mrb, const char * format, va_list ap) - - -

    -
    -
    -

    function for raisef formatting

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

    - mrb_value mrb_yield(mrb_state * mrb, mrb_value b, mrb_value arg) - - -

    - -
    - - -
    -

    - mrb_value mrb_yield_argv(mrb_state * mrb, mrb_value b, mrb_int argc, const mrb_value * argv) - - -

    - -
    - - -
    -

    - mrb_value mrb_yield_with_class(mrb_state * mrb, mrb_value b, mrb_int argc, const mrb_value * argv, mrb_value self, struct RClass * c) - - -

    - -
    - - -
    -

    - void mrb_gc_protect(mrb_state * mrb, mrb_value obj) - - -

    -
    -
    -

    mrb_gc_protect() leaves the object in the arena

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

    - void mrb_gc_register(mrb_state * mrb, mrb_value obj) - - -

    -
    -
    -

    mrb_gc_register() keeps the object from GC.

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

    - void mrb_gc_unregister(mrb_state * mrb, mrb_value obj) - - -

    -
    -
    -

    mrb_gc_unregister() removes the object from GC root.

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

    - mrb_value mrb_to_int(mrb_state * mrb, mrb_value val) - - -

    - -
    - - -
    -

    - mrb_value mrb_to_str(mrb_state * mrb, mrb_value val) - - -

    -
    -
    -

    string type checking (contrary to the name, it doesn’t convert)

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

    - void mrb_check_type(mrb_state * mrb, mrb_value x, enum mrb_vtype, t ) - - -

    - -
    - - -
    -

    - void mrb_check_frozen(mrb_state * mrb, void * o) - - -

    - -
    - - -
    -

    - void mrb_define_alias(mrb_state * mrb, struct RClass * c, const char * a, const char * b) - - -

    - -
    - - -
    -

    - void mrb_define_global_const(mrb_state * mrb, const char * name, mrb_value val) - - -

    - -
    - - -
    -

    - mrb_value mrb_attr_get(mrb_state * mrb, mrb_value obj, mrb_sym id) - - -

    - -
    - - -
    -

    - mrb_bool mrb_respond_to(mrb_state * mrb, mrb_value obj, mrb_sym mid) - - -

    - -
    - - -
    -

    - mrb_bool mrb_obj_is_instance_of(mrb_state * mrb, mrb_value obj, struct RClass* c) - - -

    - -
    - - -
    -

    - mrb_bool mrb_func_basic_p(mrb_state * mrb, mrb_value obj, mrb_sym mid, mrb_func_t func) - - -

    - -
    - - -
    -

    - mrb_value mrb_fiber_resume(mrb_state * mrb, mrb_value fib, mrb_int argc, const mrb_value * argv) - - -

    -
    -
    -

    Resume a Fiber

    - -

    Implemented in mruby-fiber

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

    - mrb_value mrb_fiber_yield(mrb_state * mrb, mrb_int argc, const mrb_value * argv) - - -

    -
    -
    -

    Yield a Fiber

    - -

    Implemented in mruby-fiber

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

    - mrb_value mrb_fiber_alive_p(mrb_state * mrb, mrb_value fib) - - -

    -
    -
    -

    Check if a Fiber is alive

    - -

    Implemented in mruby-fiber

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

    - void mrb_stack_extend(mrb_state* , mrb_int ) - - -

    - -
    - - -
    -

    - struct mrb_pool* mrb_pool_open(mrb_state* ) - - -

    - -
    - - -
    -

    - void mrb_pool_close(struct mrb_pool* ) - - -

    - -
    - - -
    -

    - void* mrb_pool_alloc(struct mrb_pool* , size_t ) - - -

    - -
    - - -
    -

    - void* mrb_pool_realloc(struct mrb_pool* , void* , size_t oldlen, size_t newlen) - - -

    - -
    - - -
    -

    - mrb_bool mrb_pool_can_realloc(struct mrb_pool* , void* , size_t ) - - -

    - -
    - - -
    -

    - void* mrb_alloca(mrb_state * mrb, size_t ) - - -

    -
    -
    -

    temporary memory allocation, only effective while GC arena is kept

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

    - void mrb_state_atexit(mrb_state * mrb, mrb_atexit_func func) - - -

    - -
    - - -
    -

    - void mrb_show_version(mrb_state * mrb) - - -

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

    - mrb_value mrb_format(mrb_state * mrb, const char * format, ... ) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Farray.h.html b/docs/api/headers/mruby_2Farray.h.html deleted file mode 100644 index 7a80dbc..0000000 --- a/docs/api/headers/mruby_2Farray.h.html +++ /dev/null @@ -1,2011 +0,0 @@ - - - - - - - Header: mruby/array.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/array.h

    -

    Overview

    -
    -
    -

    Array class

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

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_ARRAY_H - -
    -
    - -
    #define MRB_ARY_EMBED_LEN_MAX - -
    -
    - -
    #define mrb_ary_ptr - -
    -
    - -
    #define mrb_ary_value - -
    -
    - -
    #define RARRAY - -
    -
    - -
    #define MRB_ARY_EMBED_MASK - -
    -
    - -
    #define ARY_EMBED_P - -
    -
    - -
    #define ARY_UNSET_EMBED_FLAG - -
    -
    - -
    #define ARY_EMBED_LEN - -
    -
    - -
    #define ARY_SET_EMBED_LEN - -
    -
    - -
    #define ARY_EMBED_PTR - -
    -
    - -
    #define ARY_LEN - -
    -
    - -
    #define ARY_PTR - -
    -
    - -
    #define RARRAY_LEN - -
    -
    - -
    #define RARRAY_PTR - -
    -
    - -
    #define ARY_SET_LEN - -
    -
    - -
    #define ARY_CAPA - -
    -
    - -
    #define MRB_ARY_SHARED - -
    -
    - -
    #define ARY_SHARED_P - -
    -
    - -
    #define ARY_SET_SHARED_FLAG - -
    -
    - -
    #define ARY_UNSET_SHARED_FLAG - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - void mrb_ary_modify(mrb_state* , struct RArray* ) - - -

    - -
    - - -
    -

    - mrb_value mrb_ary_new_capa(mrb_state* , mrb_int ) - - -

    - -
    - - -
    -

    - mrb_value mrb_ary_new(mrb_state * mrb) - - -

    -
    -
    -

    Initializes a new array.

    - -

    Equivalent to:

    - -
     Array.new
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    - -

    Returns:

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

      The initialized array.

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

    - mrb_value mrb_ary_new_from_values(mrb_state * mrb, mrb_int size, const mrb_value * vals) - - -

    -
    -
    -

    Initializes a new array with initial values

    - -

    Equivalent to:

    - -
     Array[value1, value2, ...]
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - size - - - - - - - — -

      The numer of values.

      -
      - -
    • - -
    • - - vals - - - - - - - — -

      The actual values.

      -
      - -
    • - -
    - -

    Returns:

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

      The initialized array.

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

    - mrb_value mrb_assoc_new(mrb_state * mrb, mrb_value car, mrb_value cdr) - - -

    -
    -
    -

    Initializes a new array with two initial values

    - -

    Equivalent to:

    - -
     Array[car, cdr]
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - car - - - - - - - — -

      The first value.

      -
      - -
    • - -
    • - - cdr - - - - - - - — -

      The second value.

      -
      - -
    • - -
    - -

    Returns:

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

      The initialized array.

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

    - void mrb_ary_concat(mrb_state * mrb, mrb_value self, mrb_value other) - - -

    -
    -
    -

    Concatenate two arrays. The target array will be modified

    - -

    Equivalent to: - ary.concat(other)

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - self - - - - - - - — -

      The target array.

      -
      - -
    • - -
    • - - other - - - - - - - — -

      The array that will be concatenated to self.

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

    - mrb_value mrb_ary_splat(mrb_state * mrb, mrb_value value) - - -

    -
    -
    -

    Create an array from the input. It tries calling to_a on the -value. If value does not respond to that, it creates a new -array with just this value.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - value - - - - - - - — -

      The value to change into an array.

      -
      - -
    • - -
    - -

    Returns:

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

      An array representation of value.

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

    - void mrb_ary_push(mrb_state * mrb, mrb_value array, mrb_value value) - - -

    -
    -
    -

    Pushes value into array.

    - -

    Equivalent to:

    - -
     ary << value
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - ary - - - - - - - — -

      The array in which the value will be pushed

      -
      - -
    • - -
    • - - value - - - - - - - — -

      The value to be pushed into array

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

    - mrb_value mrb_ary_pop(mrb_state * mrb, mrb_value ary) - - -

    -
    -
    -

    Pops the last element from the array.

    - -

    Equivalent to:

    - -
     ary.pop
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - ary - - - - - - - — -

      The array from which the value will be popped.

      -
      - -
    • - -
    - -

    Returns:

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

      The popped value.

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

    - mrb_value mrb_ary_ref(mrb_state * mrb, mrb_value ary, mrb_int n) - - -

    -
    -
    -

    Returns a reference to an element of the array on the given index.

    - -

    Equivalent to:

    - -
     ary[n]
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - ary - - - - - - - — -

      The target array.

      -
      - -
    • - -
    • - - n - - - - - - - — -

      The array index being referenced

      -
      - -
    • - -
    - -

    Returns:

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

      The referenced value.

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

    - void mrb_ary_set(mrb_state * mrb, mrb_value ary, mrb_int n, mrb_value val) - - -

    -
    -
    -

    Sets a value on an array at the given index

    - -

    Equivalent to:

    - -
     ary[n] = val
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - ary - - - - - - - — -

      The target array.

      -
      - -
    • - -
    • - - n - - - - - - - — -

      The array index being referenced.

      -
      - -
    • - -
    • - - val - - - - - - - — -

      The value being setted.

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

    - void mrb_ary_replace(mrb_state * mrb, mrb_value self, mrb_value other) - - -

    -
    -
    -

    Replace the array with another array

    - -

    Equivalent to:

    - -
     ary.replace(other)
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference

      -
      - -
    • - -
    • - - self - - - - - - - — -

      The target array.

      -
      - -
    • - -
    • - - other - - - - - - - — -

      The array to replace it with.

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

    - mrb_value mrb_ensure_array_type(mrb_state * mrb, mrb_value self) - - -

    - -
    - - -
    -

    - mrb_value mrb_check_array_type(mrb_state * mrb, mrb_value self) - - -

    - -
    - - -
    -

    - mrb_value mrb_ary_unshift(mrb_state * mrb, mrb_value self, mrb_value item) - - -

    -
    -
    -

    Unshift an element into the array

    - -

    Equivalent to:

    - -
    ary.unshift(item)
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - self - - - - - - - — -

      The target array.

      -
      - -
    • - -
    • - - item - - - - - - - — -

      The item to unshift.

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

    - mrb_value mrb_ary_entry(mrb_value ary, mrb_int offset) - - -

    -
    -
    -

    Get nth element in the array

    - -

    Equivalent to:

    - -
    ary[offset]
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - ary - - - - - - - — -

      The target array.

      -
      - -
    • - -
    • - - offset - - - - - - - — -

      The element position (negative counts from the tail).

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

    - mrb_value mrb_ary_splice(mrb_state * mrb, mrb_value self, mrb_int head, mrb_int len, mrb_value rpl) - - -

    -
    -
    -

    Replace subsequence of an array.

    - -

    Equivalent to:

    - -
     ary.shift
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - self - - - - - - - — -

      The array from which the value will be shifted.

      -
      - -
    • - -
    • - - head - - - - - - - — -

      Beginning position of a replacement subsequence.

      -
      - -
    • - -
    • - - len - - - - - - - — -

      Length of a replacement subsequence.

      -
      - -
    • - -
    • - - rpl - - - - - - - — -

      The array of replacement elements.

      -
      - -
    • - -
    - -

    Returns:

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

      The receiver array.

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

    - mrb_value mrb_ary_shift(mrb_state * mrb, mrb_value self) - - -

    -
    -
    -

    Shifts the first element from the array.

    - -

    Equivalent to:

    - -
     ary.shift
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - self - - - - - - - — -

      The array from which the value will be shifted.

      -
      - -
    • - -
    - -

    Returns:

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

      The shifted value.

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

    - mrb_value mrb_ary_clear(mrb_state * mrb, mrb_value self) - - -

    -
    -
    -

    Removes all elements from the array

    - -

    Equivalent to:

    - -
     ary.clear
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - self - - - - - - - — -

      The target array.

      -
      - -
    • - -
    - -

    Returns:

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

      self

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

    - mrb_value mrb_ary_join(mrb_state * mrb, mrb_value ary, mrb_value sep) - - -

    -
    -
    -

    Join the array elements together in a string

    - -

    Equivalent to:

    - -
     ary.join(sep="")
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - ary - - - - - - - — -

      The target array

      -
      - -
    • - -
    • - - sep - - - - - - - — -

      The separater, can be NULL

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

    - mrb_value mrb_ary_resize(mrb_state * mrb, mrb_value ary, mrb_int new_len) - - -

    -
    -
    -

    Update the capacity of the array

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - ary - - - - - - - — -

      The target array.

      -
      - -
    • - -
    • - - new_len - - - - - - - — -

      The new capacity of the array

      -
      - -
    • - -
    - - -
    - - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fboxing_nan.h.html b/docs/api/headers/mruby_2Fboxing_nan.h.html deleted file mode 100644 index fa0f693..0000000 --- a/docs/api/headers/mruby_2Fboxing_nan.h.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - Header: mruby/boxing_nan.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/boxing_nan.h

    - - - -

    Define Summary

    -
    - -
    #define MRUBY_BOXING_NAN_H - -
    -
    - -
    #define mrb_tt - -
    -
    - -
    #define BOXNAN_SHIFT_LONG_POINTER - -
    -
    - -
    #define BOXNAN_SET_VALUE - -
    -
    - -
    #define BOXNAN_SET_OBJ_VALUE - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fboxing_no.h.html b/docs/api/headers/mruby_2Fboxing_no.h.html deleted file mode 100644 index 3c08e5a..0000000 --- a/docs/api/headers/mruby_2Fboxing_no.h.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - Header: mruby/boxing_no.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/boxing_no.h

    - - - -

    Define Summary

    -
    - -
    #define MRUBY_BOXING_NO_H - -
    -
    - -
    #define MRB_FIXNUM_SHIFT - -
    -
    - -
    #define mrb_float_pool - -
    -
    - -
    #define mrb_ptr - -
    -
    - -
    #define mrb_cptr - -
    -
    - -
    #define mrb_float - -
    -
    - -
    #define mrb_fixnum - -
    -
    - -
    #define mrb_symbol - -
    -
    - -
    #define mrb_type - -
    -
    - -
    #define BOXNIX_SET_VALUE - -
    -
    - -
    #define SET_NIL_VALUE - -
    -
    - -
    #define SET_FALSE_VALUE - -
    -
    - -
    #define SET_TRUE_VALUE - -
    -
    - -
    #define SET_BOOL_VALUE - -
    -
    - -
    #define SET_INT_VALUE - -
    -
    - -
    #define SET_FLOAT_VALUE - -
    -
    - -
    #define SET_SYM_VALUE - -
    -
    - -
    #define SET_OBJ_VALUE - -
    -
    - -
    #define SET_CPTR_VALUE - -
    -
    - -
    #define SET_UNDEF_VALUE - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fboxing_word.h.html b/docs/api/headers/mruby_2Fboxing_word.h.html deleted file mode 100644 index 54a5f1e..0000000 --- a/docs/api/headers/mruby_2Fboxing_word.h.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - - Header: mruby/boxing_word.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/boxing_word.h

    - - -

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_BOXING_WORD_H - -
    -
    - -
    #define MRB_SYMBOL_SHIFT - -
    -
    - -
    #define MRB_FIXNUM_FLAG - -
    -
    - -
    #define MRB_SYMBOL_FLAG - -
    -
    - -
    #define MRB_FIXNUM_MASK - -
    -
    - -
    #define MRB_SYMBOL_MASK - -
    -
    - -
    #define MRB_IMMEDIATE_MASK - -
    -
    - -
    #define BOXWORD_SHIFT_VALUE - -
    -
    - -
    #define BOXWORD_SET_SHIFT_VALUE - -
    -
    - -
    #define BOXWORD_SHIFT_VALUE_P - -
    -
    - -
    #define BOXWORD_OBJ_TYPE_P - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - mrb_value mrb_word_boxing_cptr_value(struct mrb_state* , void* ) - - -

    - -
    - - -
    -

    - mrb_value mrb_word_boxing_float_value(struct mrb_state* , mrb_float ) - - -

    - -
    - - -
    -

    - mrb_value mrb_word_boxing_float_pool(struct mrb_state* , mrb_float ) - - -

    - -
    - - -
    -

    - enum mrb_type(mrb_value o) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fclass.h.html b/docs/api/headers/mruby_2Fclass.h.html deleted file mode 100644 index 8737daa..0000000 --- a/docs/api/headers/mruby_2Fclass.h.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - - - - Header: mruby/class.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/class.h

    -

    Overview

    -
    -
    -

    Class class

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

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_CLASS_H - -
    -
    - -
    #define mrb_class_ptr - -
    -
    - -
    #define MRB_FL_CLASS_IS_PREPENDED -
    -
    -

    flags: - 20: frozen - 19: is_prepended - 18: is_origin - 17: is_inherited (used by method cache) - 16: unused - 0-15: instance type

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_FL_CLASS_IS_ORIGIN - -
    -
    - -
    #define MRB_CLASS_ORIGIN - -
    -
    - -
    #define MRB_FL_CLASS_IS_INHERITED - -
    -
    - -
    #define MRB_INSTANCE_TT_MASK - -
    -
    - -
    #define MRB_SET_INSTANCE_TT - -
    -
    - -
    #define MRB_INSTANCE_TT - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - struct RClass* mrb_class(mrb_state * mrb, mrb_value v) - - -

    - -
    - - -
    -

    - struct RClass* mrb_define_class_id(mrb_state* , mrb_sym , struct RClass* ) - - -

    - -
    - - -
    -

    - struct RClass* mrb_define_module_id(mrb_state* , mrb_sym ) - - -

    - -
    - - -
    -

    - void mrb_define_method_raw(mrb_state* , struct RClass* , mrb_sym , mrb_method_t ) - - -

    - -
    - - -
    -

    - void mrb_define_method_id(mrb_state * mrb, struct RClass * c, mrb_sym mid, mrb_func_t func, mrb_aspec aspec) - - -

    - -
    - - -
    -

    - void mrb_alias_method(mrb_state* , struct RClass * c, mrb_sym a, mrb_sym b) - - -

    - -
    - - -
    -

    - mrb_method_t mrb_method_search_vm(mrb_state* , struct RClass* , mrb_sym ) - - -

    - -
    - - -
    -

    - mrb_method_t mrb_method_search(mrb_state* , struct RClass* , mrb_sym ) - - -

    - -
    - - -
    -

    - struct RClass* mrb_class_real(struct RClass* cl) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fcommon.h.html b/docs/api/headers/mruby_2Fcommon.h.html deleted file mode 100644 index ff3c266..0000000 --- a/docs/api/headers/mruby_2Fcommon.h.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - Header: mruby/common.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/common.h

    - - -

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_COMMON_H - -
    -
    - -
    #define MRB_BEGIN_DECL -
    -
    -

    Start declarations in C mode

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_END_DECL -
    -
    -

    End declarations in C mode

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define mrb_noreturn - -
    -
    - -
    #define mrb_deprecated - -
    -
    - -
    #define inline - -
    -
    - -
    #define MRB_INLINE - -
    -
    - -
    #define MRB_API - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - __declspe c(dllimport ) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fcompile.h.html b/docs/api/headers/mruby_2Fcompile.h.html deleted file mode 100644 index e9e1160..0000000 --- a/docs/api/headers/mruby_2Fcompile.h.html +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - Header: mruby/compile.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/compile.h

    - - -

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_COMPILE_H - -
    -
    - -
    #define STR_FUNC_PARSING - -
    -
    - -
    #define STR_FUNC_EXPAND - -
    -
    - -
    #define STR_FUNC_REGEXP - -
    -
    - -
    #define STR_FUNC_WORD - -
    -
    - -
    #define STR_FUNC_SYMBOL - -
    -
    - -
    #define STR_FUNC_ARRAY - -
    -
    - -
    #define STR_FUNC_HEREDOC - -
    -
    - -
    #define STR_FUNC_XQUOTE - -
    -
    - -
    #define MRB_PARSER_TOKBUF_MAX - -
    -
    - -
    #define MRB_PARSER_TOKBUF_SIZE - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - mrbc_context* mrbc_context_new(mrb_state * mrb) - - -

    - -
    - - -
    -

    - void mrbc_context_free(mrb_state * mrb, mrbc_context * cxt) - - -

    - -
    - - -
    -

    - struct mrb_parser_state* mrb_parser_new(mrb_state* ) - - -

    - -
    - - -
    -

    - void mrb_parser_free(struct mrb_parser_state* ) - - -

    - -
    - - -
    -

    - void mrb_parser_parse(struct mrb_parser_state* , mrbc_context* ) - - -

    - -
    - - -
    -

    - void mrb_parser_set_filename(struct mrb_parser_state* , char const) - - -

    - -
    - - -
    -

    - mrb_sym mrb_parser_get_filename(struct mrb_parser_state* , uint16_t idx) - - -

    - -
    - - -
    -

    - struct mrb_parser_state* mrb_parse_file(mrb_state* , FILE* , mrbc_context* ) - - -

    - -
    - - -
    -

    - struct mrb_parser_state* mrb_parse_string(mrb_state* , const char* , mrbc_context* ) - - -

    - -
    - - -
    -

    - struct mrb_parser_state* mrb_parse_nstring(mrb_state* , const char* , size_t , mrbc_context* ) - - -

    - -
    - - -
    -

    - struct RProc* mrb_generate_code(mrb_state* , struct mrb_parser_state* ) - - -

    - -
    - - -
    -

    - mrb_value mrb_load_exec(mrb_state * mrb, struct mrb_parser_state * p, mrbc_context * c) - - -

    - -
    - - -
    -

    - mrb_value mrb_load_file(mrb_state* , FILE* ) - - -

    - -
    - - -
    -

    - mrb_value mrb_load_file_cxt(mrb_state* , FILE* , mrbc_context * cxt) - - -

    - -
    - - -
    -

    - mrb_value mrb_load_string(mrb_state * mrb, const char * s) - - -

    - -
    - - -
    -

    - mrb_value mrb_load_nstring(mrb_state * mrb, const char * s, size_t len) - - -

    - -
    - - -
    -

    - mrb_value mrb_load_string_cxt(mrb_state * mrb, const char * s, mrbc_context * cxt) - - -

    - -
    - - -
    -

    - mrb_value mrb_load_nstring_cxt(mrb_state * mrb, const char * s, size_t len, mrbc_context * cxt) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fdata.h.html b/docs/api/headers/mruby_2Fdata.h.html deleted file mode 100644 index 7246366..0000000 --- a/docs/api/headers/mruby_2Fdata.h.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - - Header: mruby/data.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/data.h

    -

    Overview

    -
    -
    -

    Custom data type description.

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

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_DATA_H - -
    -
    - -
    #define Data_Wrap_Struct - -
    -
    - -
    #define Data_Make_Struct - -
    -
    - -
    #define RDATA - -
    -
    - -
    #define DATA_PTR - -
    -
    - -
    #define DATA_TYPE - -
    -
    - -
    #define DATA_GET_PTR - -
    -
    - -
    #define DATA_CHECK_GET_PTR - -
    -
    - -
    #define mrb_data_check_and_get -
    -
    -

    obsolete functions and macros

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define mrb_get_datatype - -
    -
    - -
    #define mrb_check_datatype - -
    -
    - -
    #define Data_Get_Struct - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - struct RData * mrb_data_object_alloc(mrb_state * mrb, struct RClass* klass, void * datap, const mrb_data_type * type) - - -

    - -
    - - -
    -

    - void mrb_data_check_type(mrb_state * mrb, mrb_value , const mrb_data_type* ) - - -

    - -
    - - -
    -

    - void * mrb_data_get_ptr(mrb_state * mrb, mrb_value , const mrb_data_type* ) - - -

    - -
    - - -
    -

    - void * mrb_data_check_get_ptr(mrb_state * mrb, mrb_value , const mrb_data_type* ) - - -

    - -
    - - -
    -

    - void mrb_data_init(mrb_value v, void * ptr, const mrb_data_type * type) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fdebug.h.html b/docs/api/headers/mruby_2Fdebug.h.html deleted file mode 100644 index 802dcd9..0000000 --- a/docs/api/headers/mruby_2Fdebug.h.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - - Header: mruby/debug.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/debug.h

    -

    Overview

    -
    -
    -

    MRuby Debugging.

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

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_DEBUG_H - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - int32_t mrb_debug_get_line(mrb_state * mrb, mrb_irep * irep, ptrdiff_t pc) - - -

    -
    -
    -

    get line from irep’s debug info and program counter

    - - -
    -
    -
    - -

    Returns:

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

      returns -1 if not found

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

    - mrb_irep_debug_info * mrb_debug_info_alloc(mrb_state * mrb, mrb_irep * irep) - - -

    - -
    - - -
    -

    - mrb_irep_debug_info_file * mrb_debug_info_append_file(mrb_state * mrb, mrb_irep_debug_info * info, const char * filename, uint16_t * lines, uint32_t start_pos, uint32_t end_pos) - - -

    - -
    - - -
    -

    - void mrb_debug_info_free(mrb_state * mrb, mrb_irep_debug_info * d) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fdump.h.html b/docs/api/headers/mruby_2Fdump.h.html deleted file mode 100644 index 9917619..0000000 --- a/docs/api/headers/mruby_2Fdump.h.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - - - - Header: mruby/dump.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/dump.h

    - - -

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_DUMP_H - -
    -
    - -
    #define DUMP_DEBUG_INFO -
    -
    -

    Dumping compiled mruby script.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define DUMP_ENDIAN_BIG - -
    -
    - -
    #define DUMP_ENDIAN_LIL - -
    -
    - -
    #define DUMP_ENDIAN_NAT - -
    -
    - -
    #define DUMP_ENDIAN_MASK - -
    -
    - -
    #define MRB_DUMP_OK -
    -
    -

    dump/load error code

    - -

    NOTE: MRB_DUMP_GENERAL_FAILURE is caused by -unspecified issues like malloc failed.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_DUMP_GENERAL_FAILURE - -
    -
    - -
    #define MRB_DUMP_WRITE_FAULT - -
    -
    - -
    #define MRB_DUMP_READ_FAULT - -
    -
    - -
    #define MRB_DUMP_CRC_ERROR - -
    -
    - -
    #define MRB_DUMP_INVALID_FILE_HEADER - -
    -
    - -
    #define MRB_DUMP_INVALID_IREP - -
    -
    - -
    #define MRB_DUMP_INVALID_ARGUMENT - -
    -
    - -
    #define MRB_DUMP_NULL_SYM_LEN -
    -
    -

    null symbol length

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define RITE_BINARY_IDENT -
    -
    -

    Rite Binary File header

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define RITE_BINARY_IDENT_LIL - -
    -
    - -
    #define RITE_BINARY_FORMAT_VER - -
    -
    - -
    #define RITE_COMPILER_NAME - -
    -
    - -
    #define RITE_COMPILER_VERSION - -
    -
    - -
    #define RITE_VM_VER - -
    -
    - -
    #define RITE_BINARY_EOF - -
    -
    - -
    #define RITE_SECTION_DEBUG_IDENT - -
    -
    - -
    #define MRB_DUMP_DEFAULT_STR_LEN - -
    -
    - -
    #define MRB_DUMP_ALIGNMENT - -
    -
    - -
    #define RITE_SECTION_HEADER -
    -
    -

    section header

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define RITE_LV_NULL_MARK - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - mrb_value mrb_load_irep_file(mrb_state* , FILE* ) - - -

    - -
    - - -
    -

    - mrb_value mrb_load_irep_file_cxt(mrb_state* , FILE* , mrbc_context* ) - - -

    - -
    - - -
    -

    - mrb_irep * mrb_read_irep(mrb_state* , const uint8_t* ) - - -

    - -
    - - -
    -

    - mrb_irep * mrb_read_irep_buf(mrb_state* , const void* , size_t ) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Ferror.h.html b/docs/api/headers/mruby_2Ferror.h.html deleted file mode 100644 index b8bfb7f..0000000 --- a/docs/api/headers/mruby_2Ferror.h.html +++ /dev/null @@ -1,529 +0,0 @@ - - - - - - - Header: mruby/error.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/error.h

    -

    Overview

    -
    -
    -

    MRuby error handling.

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

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_ERROR_H - -
    -
    - -
    #define mrb_exc_ptr - -
    -
    - -
    #define mrb_exc_new_str_lit - -
    -
    - -
    #define mrb_break_value_get - -
    -
    - -
    #define mrb_break_value_set - -
    -
    - -
    #define RBREAK_VALUE_TT_MASK - -
    -
    - -
    #define mrb_break_proc_get - -
    -
    - -
    #define mrb_break_proc_set - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - void mrb_sys_fail(mrb_state * mrb, const char * mesg) - - -

    - -
    - - -
    -

    - mrb_value mrb_exc_new_str(mrb_state * mrb, struct RClass* c, mrb_value str) - - -

    - -
    - - -
    -

    - mrb_value mrb_make_exception(mrb_state * mrb, mrb_int argc, const mrb_value * argv) - - -

    - -
    - - -
    -

    - mrb_value mrb_exc_backtrace(mrb_state * mrb, mrb_value exc) - - -

    - -
    - - -
    -

    - mrb_value mrb_get_backtrace(mrb_state * mrb) - - -

    - -
    - - -
    -

    - mrb_noreturn mrb_no_method_error(mrb_state * mrb, mrb_sym id, mrb_value args, const char * fmt, ... ) - - -

    - -
    - - -
    -

    - mrb_value mrb_f_raise(mrb_state* , mrb_value ) - - -

    -
    -
    -

    declaration for fail method

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

    - mrb_value mrb_protect(mrb_state * mrb, mrb_func_t body, mrb_value data, mrb_bool * state) - - -

    -
    -
    -

    Protect

    - -

    Implemented in the mruby-error mrbgem

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

    - mrb_value mrb_ensure(mrb_state * mrb, mrb_func_t body, mrb_value b_data, mrb_func_t ensure, mrb_value e_data) - - -

    -
    -
    -

    Ensure

    - -

    Implemented in the mruby-error mrbgem

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

    - mrb_value mrb_rescue(mrb_state * mrb, mrb_func_t body, mrb_value b_data, mrb_func_t rescue, mrb_value r_data) - - -

    -
    -
    -

    Rescue

    - -

    Implemented in the mruby-error mrbgem

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

    - mrb_value mrb_rescue_exceptions(mrb_state * mrb, mrb_func_t body, mrb_value b_data, mrb_func_t rescue, mrb_value r_data, mrb_int len, struct RClass * , classes ) - - -

    -
    -
    -

    Rescue exception

    - -

    Implemented in the mruby-error mrbgem

    - - -
    -
    -
    - - -
    - - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fext_2Fio.h.html b/docs/api/headers/mruby_2Fext_2Fio.h.html deleted file mode 100644 index 2cd1618..0000000 --- a/docs/api/headers/mruby_2Fext_2Fio.h.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - Header: mruby/ext/io.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/ext/io.h

    - - - -

    Define Summary

    -
    - -
    #define MRUBY_IO_H - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fgc.h.html b/docs/api/headers/mruby_2Fgc.h.html deleted file mode 100644 index cf93522..0000000 --- a/docs/api/headers/mruby_2Fgc.h.html +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - Header: mruby/gc.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/gc.h

    -

    Overview

    -
    -
    -

    Uncommon memory management stuffs.

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

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_GC_H - -
    -
    - -
    #define MRB_EACH_OBJ_OK - -
    -
    - -
    #define MRB_EACH_OBJ_BREAK - -
    -
    - -
    #define MRB_GC_ARENA_SIZE - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - void mrb_free_context(struct mrb_state * mrb, struct mrb_context * c) - - -

    - -
    - - -
    -

    - mrb_bool mrb_object_dead_p(struct mrb_state * mrb, struct RBasic * object) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fhash.h.html b/docs/api/headers/mruby_2Fhash.h.html deleted file mode 100644 index f56fe68..0000000 --- a/docs/api/headers/mruby_2Fhash.h.html +++ /dev/null @@ -1,1621 +0,0 @@ - - - - - - - Header: mruby/hash.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/hash.h

    -

    Overview

    -
    -
    -

    Hash class

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

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_HASH_H - -
    -
    - -
    #define mrb_hash_ptr - -
    -
    - -
    #define mrb_hash_value - -
    -
    - -
    #define RHASH -
    -
    -

    RHASH_TBL allocates st_table if not available.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define RHASH_TBL - -
    -
    - -
    #define RHASH_IFNONE - -
    -
    - -
    #define RHASH_PROCDEFAULT - -
    -
    - -
    #define MRB_HASH_DEFAULT - -
    -
    - -
    #define MRB_HASH_PROC_DEFAULT - -
    -
    - -
    #define MRB_RHASH_DEFAULT_P - -
    -
    - -
    #define MRB_RHASH_PROCDEFAULT_P - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - mrb_value mrb_hash_new_capa(mrb_state * mrb, mrb_int capa) - - -

    - -
    - - -
    -

    - mrb_value mrb_ensure_hash_type(mrb_state * mrb, mrb_value hash) - - -

    - -
    - - -
    -

    - mrb_value mrb_check_hash_type(mrb_state * mrb, mrb_value hash) - - -

    - -
    - - -
    -

    - mrb_value mrb_hash_new(mrb_state * mrb) - - -

    -
    -
    -

    Initializes a new hash.

    - -

    Equivalent to:

    - -
     Hash.new
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    - -

    Returns:

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

      The initialized hash.

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

    - void mrb_hash_set(mrb_state * mrb, mrb_value hash, mrb_value key, mrb_value val) - - -

    -
    -
    -

    Sets a keys and values to hashes.

    - -

    Equivalent to:

    - -
     hash[key] = val
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - hash - - - - - - - — -

      The target hash.

      -
      - -
    • - -
    • - - key - - - - - - - — -

      The key to set.

      -
      - -
    • - -
    • - - val - - - - - - - — -

      The value to set.

      -
      - -
    • - -
    - -

    Returns:

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

      The value.

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

    - mrb_value mrb_hash_get(mrb_state * mrb, mrb_value hash, mrb_value key) - - -

    -
    -
    -

    Gets a value from a key. If the key is not found, the default of the -hash is used.

    - -

    Equivalent to:

    - -
    hash[key]
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - hash - - - - - - - — -

      The target hash.

      -
      - -
    • - -
    • - - key - - - - - - - — -

      The key to get.

      -
      - -
    • - -
    - -

    Returns:

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

      The found value.

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

    - mrb_value mrb_hash_fetch(mrb_state * mrb, mrb_value hash, mrb_value key, mrb_value def) - - -

    -
    -
    -

    Gets a value from a key. If the key is not found, the default parameter is -used.

    - -

    Equivalent to:

    - -
    hash.key?(key) ? hash[key] : def
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - hash - - - - - - - — -

      The target hash.

      -
      - -
    • - -
    • - - key - - - - - - - — -

      The key to get.

      -
      - -
    • - -
    • - - def - - - - - - - — -

      The default value.

      -
      - -
    • - -
    - -

    Returns:

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

      The found value.

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

    - mrb_value mrb_hash_delete_key(mrb_state * mrb, mrb_value hash, mrb_value key) - - -

    -
    -
    -

    Deletes hash key and value pair.

    - -

    Equivalent to:

    - -
    hash.delete(key)
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - hash - - - - - - - — -

      The target hash.

      -
      - -
    • - -
    • - - key - - - - - - - — -

      The key to delete.

      -
      - -
    • - -
    - -

    Returns:

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

      The deleted value. This value is not protected from GC. Use mrb_gc_protect() if necessary.

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

    - mrb_value mrb_hash_keys(mrb_state * mrb, mrb_value hash) - - -

    -
    -
    -

    Gets an array of keys.

    - -

    Equivalent to:

    - -
    hash.keys
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - hash - - - - - - - — -

      The target hash.

      -
      - -
    • - -
    - -

    Returns:

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

      An array with the keys of the hash.

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

    - mrb_bool mrb_hash_key_p(mrb_state * mrb, mrb_value hash, mrb_value key) - - -

    -
    -
    -

    Check if the hash has the key.

    - -

    Equivalent to:

    - -
    hash.key?(key)
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - hash - - - - - - - — -

      The target hash.

      -
      - -
    • - -
    • - - key - - - - - - - — -

      The key to check existence.

      -
      - -
    • - -
    - -

    Returns:

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

      True if the hash has the key

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

    - mrb_bool mrb_hash_empty_p(mrb_state * mrb, mrb_value self) - - -

    -
    -
    -

    Check if the hash is empty

    - -

    Equivalent to:

    - -
    hash.empty?
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - self - - - - - - - — -

      The target hash.

      -
      - -
    • - -
    - -

    Returns:

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

      True if the hash is empty, false otherwise.

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

    - mrb_value mrb_hash_values(mrb_state * mrb, mrb_value hash) - - -

    -
    -
    -

    Gets an array of values.

    - -

    Equivalent to:

    - -
    hash.values
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - hash - - - - - - - — -

      The target hash.

      -
      - -
    • - -
    - -

    Returns:

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

      An array with the values of the hash.

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

    - mrb_value mrb_hash_clear(mrb_state * mrb, mrb_value hash) - - -

    -
    -
    -

    Clears the hash.

    - -

    Equivalent to:

    - -
    hash.clear
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - hash - - - - - - - — -

      The target hash.

      -
      - -
    • - -
    - -

    Returns:

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

      The hash

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

    - mrb_int mrb_hash_size(mrb_state * mrb, mrb_value hash) - - -

    -
    -
    -

    Get hash size.

    - -

    Equivalent to:

    - -
     hash.size
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - hash - - - - - - - — -

      The target hash.

      -
      - -
    • - -
    - -

    Returns:

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

      The hash size.

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

    - mrb_value mrb_hash_dup(mrb_state * mrb, mrb_value hash) - - -

    -
    -
    -

    Copies the hash.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - hash - - - - - - - — -

      The target hash.

      -
      - -
    • - -
    - -

    Returns:

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

      The copy of the hash

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

    - void mrb_hash_merge(mrb_state * mrb, mrb_value hash1, mrb_value hash2) - - -

    -
    -
    -

    Merges two hashes. The first hash will be modified by the -second hash.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference.

      -
      - -
    • - -
    • - - hash1 - - - - - - - — -

      The target hash.

      -
      - -
    • - -
    • - - hash2 - - - - - - - — -

      Updating hash

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

    - void mrb_hash_foreach(mrb_state * mrb, struct RHash * hash, mrb_hash_foreach_func * func, void * p) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Firep.h.html b/docs/api/headers/mruby_2Firep.h.html deleted file mode 100644 index 5de9bfb..0000000 --- a/docs/api/headers/mruby_2Firep.h.html +++ /dev/null @@ -1,417 +0,0 @@ - - - - - - - Header: mruby/irep.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/irep.h

    -

    Overview

    -
    -
    -

    Compiled mruby scripts.

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

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_IREP_H - -
    -
    - -
    #define MRB_ISEQ_NO_FREE - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - mrb_irep * mrb_add_irep(mrb_state * mrb) - - -

    - -
    - - -
    -

    - mrb_value mrb_load_irep(mrb_state* , const uint8_t* ) - - -

    -
    -
    - - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - irep - - - (const uint8_t*) - - - - — -

      code, expected as a literal

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

    - mrb_value mrb_load_irep_buf(mrb_state* , const void* , size_t ) - - -

    -
    -
    - - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - irep - - - (const void*) - - - - — -

      code

      -
      - -
    • - -
    • - - size - - - (size_t) - - - - — -

      of irep buffer. If -1 is given, it is considered unrestricted.

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

    - mrb_value mrb_load_irep_cxt(mrb_state* , const uint8_t* , mrbc_context* ) - - -

    -
    -
    - - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - irep - - - (const uint8_t*) - - - - — -

      code, expected as a literal

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

    - mrb_value mrb_load_irep_buf_cxt(mrb_state* , const void* , size_t , mrbc_context* ) - - -

    -
    -
    - - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - irep - - - (const void*) - - - - — -

      code

      -
      - -
    • - -
    • - - size - - - (size_t) - - - - — -

      of irep buffer. If -1 is given, it is considered unrestricted.

      -
      - -
    • - -
    - - -
    - - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fistruct.h.html b/docs/api/headers/mruby_2Fistruct.h.html deleted file mode 100644 index 24e7bac..0000000 --- a/docs/api/headers/mruby_2Fistruct.h.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - - Header: mruby/istruct.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/istruct.h

    - - -

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_ISTRUCT_H - -
    -
    - -
    #define ISTRUCT_DATA_SIZE -
    -
    -

    Inline structures that fit in RVALUE

    - -

    They cannot have finalizer, and cannot have instance variables.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define RISTRUCT - -
    -
    - -
    #define ISTRUCT_PTR - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - mrb_int mrb_istruct_size(void) - - -

    - -
    - - -
    -

    - void* mrb_istruct_ptr(mrb_value object) - - -

    - -
    - - -
    -

    - void mrb_istruct_copy(mrb_value dest, mrb_value src) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fkhash.h.html b/docs/api/headers/mruby_2Fkhash.h.html deleted file mode 100644 index 5b95311..0000000 --- a/docs/api/headers/mruby_2Fkhash.h.html +++ /dev/null @@ -1,352 +0,0 @@ - - - - - - - Header: mruby/khash.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/khash.h

    -

    Overview

    -
    -
    -

    khash definitions used in mruby’s hash table.

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

    Define Summary

    -
    - -
    #define MRUBY_KHASH_H - -
    -
    - -
    #define KHASH_MIN_SIZE - -
    -
    - -
    #define UPPER_BOUND - -
    -
    - -
    #define __ac_isempty - -
    -
    - -
    #define __ac_isdel - -
    -
    - -
    #define __ac_iseither - -
    -
    - -
    #define khash_power2 - -
    -
    - -
    #define khash_mask - -
    -
    - -
    #define khash_upper_bound - -
    -
    - -
    #define KHASH_DECLARE -
    -
    -

    declare struct kh_xxx and kh_xxx_funcs

    - -

    name: hash name - khkey_t: key data type - khval_t: value data type - kh_is_map: (0: hash set / 1: hash map)

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define KHASH_DEFINE -
    -
    -

    define kh_xxx_funcs

    - -

    name: hash name - khkey_t: key data type - khval_t: value data type - kh_is_map: (0: hash set / 1: hash map) - __hash_func: hash function - __hash_equal: hash comparation function

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define khash_t - -
    -
    - -
    #define kh_init_size - -
    -
    - -
    #define kh_init - -
    -
    - -
    #define kh_destroy - -
    -
    - -
    #define kh_clear - -
    -
    - -
    #define kh_resize - -
    -
    - -
    #define kh_put - -
    -
    - -
    #define kh_put2 - -
    -
    - -
    #define kh_get - -
    -
    - -
    #define kh_del - -
    -
    - -
    #define kh_copy - -
    -
    - -
    #define kh_exist - -
    -
    - -
    #define kh_key - -
    -
    - -
    #define kh_val - -
    -
    - -
    #define kh_value - -
    -
    - -
    #define kh_begin - -
    -
    - -
    #define kh_end - -
    -
    - -
    #define kh_size - -
    -
    - -
    #define kh_n_buckets - -
    -
    - -
    #define kh_int_hash_func - -
    -
    - -
    #define kh_int_hash_equal - -
    -
    - -
    #define kh_int64_hash_func - -
    -
    - -
    #define kh_int64_hash_equal - -
    -
    - -
    #define kh_str_hash_func - -
    -
    - -
    #define kh_str_hash_equal - -
    -
    - -
    - - -

    Typedef Summary

    -
    - -
    typedef khint_t -
    -
    -

    khash definitions used in mruby’s hash table.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    typedef khiter_t - -
    -
    - -
    typedef kh_cstr_t - -
    -
    - -
    - -
    -

    Function Details

    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fnumeric.h.html b/docs/api/headers/mruby_2Fnumeric.h.html deleted file mode 100644 index d49009b..0000000 --- a/docs/api/headers/mruby_2Fnumeric.h.html +++ /dev/null @@ -1,463 +0,0 @@ - - - - - - - Header: mruby/numeric.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/numeric.h

    - - -

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_NUMERIC_H - -
    -
    - -
    #define TYPED_POSFIXABLE -
    -
    -

    Numeric class and it’s sub-classes.

    - -

    Integer, Float and Fixnum

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define TYPED_NEGFIXABLE - -
    -
    - -
    #define TYPED_FIXABLE - -
    -
    - -
    #define POSFIXABLE - -
    -
    - -
    #define NEGFIXABLE - -
    -
    - -
    #define FIXABLE - -
    -
    - -
    #define FIXABLE_FLOAT - -
    -
    - -
    #define __has_builtin - -
    -
    - -
    #define MRB_HAVE_TYPE_GENERIC_CHECKED_ARITHMETIC_BUILTINS - -
    -
    - -
    #define WBCHK - -
    -
    - -
    #define MRB_UINT_MAKE2 - -
    -
    - -
    #define MRB_UINT_MAKE - -
    -
    - -
    #define mrb_uint - -
    -
    - -
    #define MRB_INT_OVERFLOW_MASK - -
    -
    - -
    #define MRB_FLT_RADIX - -
    -
    - -
    #define MRB_FLT_MANT_DIG - -
    -
    - -
    #define MRB_FLT_EPSILON - -
    -
    - -
    #define MRB_FLT_DIG - -
    -
    - -
    #define MRB_FLT_MIN_EXP - -
    -
    - -
    #define MRB_FLT_MIN - -
    -
    - -
    #define MRB_FLT_MIN_10_EXP - -
    -
    - -
    #define MRB_FLT_MAX_EXP - -
    -
    - -
    #define MRB_FLT_MAX - -
    -
    - -
    #define MRB_FLT_MAX_10_EXP - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - mrb_value mrb_flo_to_fixnum(mrb_state * mrb, mrb_value val) - - -

    - -
    - - -
    -

    - mrb_value mrb_fixnum_to_str(mrb_state * mrb, mrb_value x, mrb_int base) - - -

    - -
    - - -
    -

    - mrb_value mrb_float_to_str(mrb_state * mrb, mrb_value x, const char * fmt) - - -

    - -
    - - -
    -

    - mrb_float mrb_to_flo(mrb_state * mrb, mrb_value x) - - -

    - -
    - - -
    -

    - mrb_value mrb_int_value(mrb_state * mrb, mrb_float f) - - -

    - -
    - - -
    -

    - mrb_value mrb_num_plus(mrb_state * mrb, mrb_value x, mrb_value y) - - -

    - -
    - - -
    -

    - mrb_value mrb_num_minus(mrb_state * mrb, mrb_value x, mrb_value y) - - -

    - -
    - - -
    -

    - mrb_value mrb_num_mul(mrb_state * mrb, mrb_value x, mrb_value y) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fobject.h.html b/docs/api/headers/mruby_2Fobject.h.html deleted file mode 100644 index 9cd1e12..0000000 --- a/docs/api/headers/mruby_2Fobject.h.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - Header: mruby/object.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/object.h

    - - - -

    Define Summary

    -
    - -
    #define MRUBY_OBJECT_H - -
    -
    - -
    #define MRB_OBJECT_HEADER - -
    -
    - -
    #define MRB_FLAG_TEST - -
    -
    - -
    #define mrb_basic_ptr - -
    -
    - -
    #define MRB_FL_OBJ_IS_FROZEN - -
    -
    - -
    #define MRB_FROZEN_P - -
    -
    - -
    #define MRB_SET_FROZEN_FLAG - -
    -
    - -
    #define MRB_UNSET_FROZEN_FLAG - -
    -
    - -
    #define mrb_frozen_p - -
    -
    - -
    #define mrb_obj_ptr - -
    -
    - -
    #define mrb_special_const_p - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fopcode.h.html b/docs/api/headers/mruby_2Fopcode.h.html deleted file mode 100644 index b2fa90e..0000000 --- a/docs/api/headers/mruby_2Fopcode.h.html +++ /dev/null @@ -1,342 +0,0 @@ - - - - - - - Header: mruby/opcode.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/opcode.h

    - - - -

    Define Summary

    -
    - -
    #define MRUBY_OPCODE_H - -
    -
    - -
    #define OP_L_STRICT - -
    -
    - -
    #define OP_L_CAPTURE - -
    -
    - -
    #define OP_L_METHOD - -
    -
    - -
    #define OP_L_LAMBDA - -
    -
    - -
    #define OP_L_BLOCK - -
    -
    - -
    #define OP_R_NORMAL - -
    -
    - -
    #define OP_R_BREAK - -
    -
    - -
    #define OP_R_RETURN - -
    -
    - -
    #define PEEK_B - -
    -
    - -
    #define PEEK_S - -
    -
    - -
    #define PEEK_W - -
    -
    - -
    #define READ_B - -
    -
    - -
    #define READ_S - -
    -
    - -
    #define READ_W - -
    -
    - -
    #define FETCH_Z - -
    -
    - -
    #define FETCH_B - -
    -
    - -
    #define FETCH_BB - -
    -
    - -
    #define FETCH_BBB - -
    -
    - -
    #define FETCH_BS - -
    -
    - -
    #define FETCH_S - -
    -
    - -
    #define FETCH_W - -
    -
    - -
    #define FETCH_Z_1 -
    -
    -

    with OP_EXT1 (1st 16bit)

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define FETCH_B_1 - -
    -
    - -
    #define FETCH_BB_1 - -
    -
    - -
    #define FETCH_BBB_1 - -
    -
    - -
    #define FETCH_BS_1 - -
    -
    - -
    #define FETCH_S_1 - -
    -
    - -
    #define FETCH_W_1 - -
    -
    - -
    #define FETCH_Z_2 -
    -
    -

    with OP_EXT2 (2nd 16bit)

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define FETCH_B_2 - -
    -
    - -
    #define FETCH_BB_2 - -
    -
    - -
    #define FETCH_BBB_2 - -
    -
    - -
    #define FETCH_BS_2 - -
    -
    - -
    #define FETCH_S_2 - -
    -
    - -
    #define FETCH_W_2 - -
    -
    - -
    #define FETCH_Z_3 -
    -
    -

    with OP_EXT3 (1st & 2nd 16bit)

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define FETCH_B_3 - -
    -
    - -
    #define FETCH_BB_3 - -
    -
    - -
    #define FETCH_BBB_3 - -
    -
    - -
    #define FETCH_BS_3 - -
    -
    - -
    #define FETCH_S_3 - -
    -
    - -
    #define FETCH_W_3 - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fproc.h.html b/docs/api/headers/mruby_2Fproc.h.html deleted file mode 100644 index 476e3ca..0000000 --- a/docs/api/headers/mruby_2Fproc.h.html +++ /dev/null @@ -1,493 +0,0 @@ - - - - - - - Header: mruby/proc.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/proc.h

    -

    Overview

    -
    -
    -

    Proc class

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

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_PROC_H - -
    -
    - -
    #define MRB_ENV_SET_STACK_LEN -
    -
    -

    flags (21bits): 1(shared flag):10(cioff/bidx):10(stack_len)

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_ENV_STACK_LEN - -
    -
    - -
    #define MRB_ENV_STACK_UNSHARED - -
    -
    - -
    #define MRB_ENV_UNSHARE_STACK - -
    -
    - -
    #define MRB_ENV_STACK_SHARED_P - -
    -
    - -
    #define MRB_ENV_BIDX - -
    -
    - -
    #define MRB_ENV_SET_BIDX - -
    -
    - -
    #define MRB_ASPEC_REQ -
    -
    -

    aspec access

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_ASPEC_OPT - -
    -
    - -
    #define MRB_ASPEC_REST - -
    -
    - -
    #define MRB_ASPEC_POST - -
    -
    - -
    #define MRB_ASPEC_KEY - -
    -
    - -
    #define MRB_ASPEC_KDICT - -
    -
    - -
    #define MRB_ASPEC_BLOCK - -
    -
    - -
    #define MRB_PROC_CFUNC_FL - -
    -
    - -
    #define MRB_PROC_CFUNC_P - -
    -
    - -
    #define MRB_PROC_CFUNC - -
    -
    - -
    #define MRB_PROC_STRICT - -
    -
    - -
    #define MRB_PROC_STRICT_P - -
    -
    - -
    #define MRB_PROC_ORPHAN - -
    -
    - -
    #define MRB_PROC_ORPHAN_P - -
    -
    - -
    #define MRB_PROC_ENVSET - -
    -
    - -
    #define MRB_PROC_ENV_P - -
    -
    - -
    #define MRB_PROC_ENV - -
    -
    - -
    #define MRB_PROC_TARGET_CLASS - -
    -
    - -
    #define MRB_PROC_SET_TARGET_CLASS - -
    -
    - -
    #define MRB_PROC_SCOPE - -
    -
    - -
    #define MRB_PROC_SCOPE_P - -
    -
    - -
    #define mrb_proc_ptr - -
    -
    - -
    #define mrb_cfunc_env_get -
    -
    -

    old name

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_METHOD_FUNC_FL - -
    -
    - -
    #define MRB_METHOD_NOARG_FL - -
    -
    - -
    #define MRB_METHOD_FUNC_P - -
    -
    - -
    #define MRB_METHOD_NOARG_P - -
    -
    - -
    #define MRB_METHOD_NOARG_SET - -
    -
    - -
    #define MRB_METHOD_FUNC - -
    -
    - -
    #define MRB_METHOD_FROM_FUNC - -
    -
    - -
    #define MRB_METHOD_FROM_PROC - -
    -
    - -
    #define MRB_METHOD_PROC_P - -
    -
    - -
    #define MRB_METHOD_PROC - -
    -
    - -
    #define MRB_METHOD_UNDEF_P - -
    -
    - -
    #define MRB_METHOD_CFUNC_P - -
    -
    - -
    #define MRB_METHOD_CFUNC - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - struct RProc * mrb_proc_new_cfunc(mrb_state* , mrb_func_t ) - - -

    - -
    - - -
    -

    - struct RProc * mrb_closure_new_cfunc(mrb_state * mrb, mrb_func_t func, int nlocals) - - -

    - -
    - - -
    -

    - struct RProc * mrb_proc_new_cfunc_with_env(mrb_state * mrb, mrb_func_t func, mrb_int argc, const mrb_value * argv) - - -

    -
    -
    -

    following functions are defined in mruby-proc-ext so please include it when using

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

    - mrb_value mrb_proc_cfunc_env_get(mrb_state * mrb, mrb_int idx) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Frange.h.html b/docs/api/headers/mruby_2Frange.h.html deleted file mode 100644 index 9fb6ba2..0000000 --- a/docs/api/headers/mruby_2Frange.h.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - - Header: mruby/range.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/range.h

    - - -

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_RANGE_H - -
    -
    - -
    #define MRB_RANGE_EMBED - -
    -
    - -
    #define mrb_gc_free_range - -
    -
    - -
    #define RANGE_BEG - -
    -
    - -
    #define RANGE_END - -
    -
    - -
    #define mrb_range_beg - -
    -
    - -
    #define mrb_range_end - -
    -
    - -
    #define mrb_range_excl_p - -
    -
    - -
    #define mrb_range_raw_ptr - -
    -
    - -
    #define mrb_range_value - -
    -
    - -
    #define RANGE_EXCL - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - struct RRange* mrb_range_ptr(mrb_state * mrb, mrb_value range) - - -

    - -
    - - -
    -

    - mrb_value mrb_range_new(mrb_state * mrb, mrb_value start, mrb_value end, mrb_bool exclude) - - -

    -
    -
    -

    Initializes a Range.

    - -

    If the third parameter is FALSE then it includes the last value in the range. -If the third parameter is TRUE then it excludes the last value in the range.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - start - - - - - - - — -

      the beginning value.

      -
      - -
    • - -
    • - - end - - - - - - - — -

      the ending value.

      -
      - -
    • - -
    • - - exclude - - - - - - - — -

      represents the inclusion or exclusion of the last value.

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

    - enum mrb_range_beg_len(mrb_state * mrb, mrb_value range, mrb_int * begp, mrb_int * lenp, mrb_int len, mrb_bool trunc) - - -

    -
    -
    -

    (failure) out of range

    - - -
    -
    -
    - - -
    - - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fre.h.html b/docs/api/headers/mruby_2Fre.h.html deleted file mode 100644 index 56fad37..0000000 --- a/docs/api/headers/mruby_2Fre.h.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - Header: mruby/re.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/re.h

    - - - -

    Define Summary

    -
    - -
    #define MRUBY_RE_H - -
    -
    - -
    #define REGEXP_CLASS - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fstring.h.html b/docs/api/headers/mruby_2Fstring.h.html deleted file mode 100644 index 21ae71e..0000000 --- a/docs/api/headers/mruby_2Fstring.h.html +++ /dev/null @@ -1,2453 +0,0 @@ - - - - - - - Header: mruby/string.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/string.h

    -

    Overview

    -
    -
    -

    String class

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

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_STRING_H - -
    -
    - -
    #define RSTRING_EMBED_LEN_MAX - -
    -
    - -
    #define RSTR_SET_TYPE_FLAG - -
    -
    - -
    #define RSTR_UNSET_TYPE_FLAG - -
    -
    - -
    #define RSTR_EMBED_P - -
    -
    - -
    #define RSTR_SET_EMBED_FLAG - -
    -
    - -
    #define RSTR_UNSET_EMBED_FLAG - -
    -
    - -
    #define RSTR_SET_EMBED_LEN - -
    -
    - -
    #define RSTR_SET_LEN - -
    -
    - -
    #define RSTR_EMBED_PTR - -
    -
    - -
    #define RSTR_EMBED_LEN - -
    -
    - -
    #define RSTR_EMBEDDABLE_P - -
    -
    - -
    #define RSTR_PTR - -
    -
    - -
    #define RSTR_LEN - -
    -
    - -
    #define RSTR_CAPA - -
    -
    - -
    #define RSTR_SHARED_P - -
    -
    - -
    #define RSTR_SET_SHARED_FLAG - -
    -
    - -
    #define RSTR_UNSET_SHARED_FLAG - -
    -
    - -
    #define RSTR_FSHARED_P - -
    -
    - -
    #define RSTR_SET_FSHARED_FLAG - -
    -
    - -
    #define RSTR_UNSET_FSHARED_FLAG - -
    -
    - -
    #define RSTR_NOFREE_P - -
    -
    - -
    #define RSTR_SET_NOFREE_FLAG - -
    -
    - -
    #define RSTR_UNSET_NOFREE_FLAG - -
    -
    - -
    #define RSTR_ASCII_P - -
    -
    - -
    #define RSTR_SET_ASCII_FLAG - -
    -
    - -
    #define RSTR_UNSET_ASCII_FLAG - -
    -
    - -
    #define RSTR_WRITE_ASCII_FLAG - -
    -
    - -
    #define RSTR_COPY_ASCII_FLAG - -
    -
    - -
    #define RSTR_POOL_P - -
    -
    - -
    #define RSTR_SET_POOL_FLAG - -
    -
    - -
    #define mrb_str_ptr -
    -
    -

    Returns a pointer from a Ruby string

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define RSTRING - -
    -
    - -
    #define RSTRING_PTR - -
    -
    - -
    #define RSTRING_EMBED_LEN - -
    -
    - -
    #define RSTRING_LEN - -
    -
    - -
    #define RSTRING_CAPA - -
    -
    - -
    #define RSTRING_END - -
    -
    - -
    #define RSTRING_CSTR - -
    -
    - -
    #define MRB_STR_SHARED - -
    -
    - -
    #define MRB_STR_FSHARED - -
    -
    - -
    #define MRB_STR_NOFREE - -
    -
    - -
    #define MRB_STR_EMBED - -
    -
    - -
    #define MRB_STR_POOL - -
    -
    - -
    #define MRB_STR_ASCII - -
    -
    - -
    #define MRB_STR_EMBED_LEN_SHIFT - -
    -
    - -
    #define MRB_STR_EMBED_LEN_BITSIZE - -
    -
    - -
    #define MRB_STR_EMBED_LEN_MASK - -
    -
    - -
    #define MRB_STR_TYPE_MASK - -
    -
    - -
    #define mrb_str_index_lit - -
    -
    - -
    #define mrb_str_cat_lit - -
    -
    - -
    #define mrb_str_cat2 -
    -
    -

    For backward compatibility

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define mrb_str_buf_cat - -
    -
    - -
    #define mrb_str_buf_append - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - mrb_int mrb_str_strlen(mrb_state* , struct RString* ) - - -

    - -
    - - -
    -

    - void mrb_str_modify(mrb_state * mrb, struct RString * s) - - -

    - -
    - - -
    -

    - void mrb_str_modify_keep_ascii(mrb_state * mrb, struct RString * s) - - -

    -
    -
    -

    mrb_str_modify() with keeping ASCII flag if set

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

    - mrb_int mrb_str_index(mrb_state * mrb, mrb_value str, const char * p, mrb_int len, mrb_int offset) - - -

    -
    -
    -

    Finds the index of a substring in a string

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

    - void mrb_str_concat(mrb_state * mrb, mrb_value self, mrb_value other) - - -

    -
    -
    -

    Appends self to other. Returns self as a concatenated string.

    - -

    Example:

    - -
    int
    -main(int argc,
    -     char **argv)
    -{
    -  // Variable declarations.
    -  mrb_value str1;
    -  mrb_value str2;
    -
    -  mrb_state *mrb = mrb_open();
    -  if (!mrb)
    -  {
    -     // handle error
    -  }
    -
    -  // Creates new Ruby strings.
    -  str1 = mrb_str_new_lit(mrb, "abc");
    -  str2 = mrb_str_new_lit(mrb, "def");
    -
    -  // Concatenates str2 to str1.
    -  mrb_str_concat(mrb, str1, str2);
    -
    -  // Prints new Concatenated Ruby string.
    -  mrb_p(mrb, str1);
    -
    -  mrb_close(mrb);
    -  return 0;
    -}
    -
    - -

    Result:

    - -
    => "abcdef"
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - self - - - - - - - — -

      String to concatenate.

      -
      - -
    • - -
    • - - other - - - - - - - — -

      String to append to self.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      Returns a new String appending other to self.

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

    - mrb_value mrb_str_plus(mrb_state * mrb, mrb_value a, mrb_value b) - - -

    -
    -
    -

    Adds two strings together.

    - -

    Example:

    - -
    int
    -main(int argc,
    -     char **argv)
    -{
    -  // Variable declarations.
    -  mrb_value a;
    -  mrb_value b;
    -  mrb_value c;
    -
    -  mrb_state *mrb = mrb_open();
    -  if (!mrb)
    -  {
    -     // handle error
    -  }
    -
    -  // Creates two Ruby strings from the passed in C strings.
    -  a = mrb_str_new_lit(mrb, "abc");
    -  b = mrb_str_new_lit(mrb, "def");
    -
    -  // Prints both C strings.
    -  mrb_p(mrb, a);
    -  mrb_p(mrb, b);
    -
    -  // Concatenates both Ruby strings.
    -  c = mrb_str_plus(mrb, a, b);
    -
    -  // Prints new Concatenated Ruby string.
    -  mrb_p(mrb, c);
    -
    -  mrb_close(mrb);
    -  return 0;
    -}
    -
    - -

    Result:

    - -
    => "abc"  # First string
    -=> "def"  # Second string
    -=> "abcdef" # First & Second concatenated.
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - a - - - - - - - — -

      First string to concatenate.

      -
      - -
    • - -
    • - - b - - - - - - - — -

      Second string to concatenate.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      Returns a new String containing a concatenated to b.

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

    - mrb_value mrb_ptr_to_str(mrb_state * mrb, void * p) - - -

    -
    -
    -

    Converts pointer into a Ruby string.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - p - - - - - - - — -

      The pointer to convert to Ruby string.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      Returns a new Ruby String.

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

    - mrb_value mrb_obj_as_string(mrb_state * mrb, mrb_value obj) - - -

    -
    -
    -

    Returns an object as a Ruby string.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - obj - - - - - - - — -

      An object to return as a Ruby string.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      An object as a Ruby string.

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

    - mrb_value mrb_str_resize(mrb_state * mrb, mrb_value str, mrb_int len) - - -

    -
    -
    -

    Resizes the string’s length. Returns the amount of characters -in the specified by len.

    - -

    Example:

    - -
    int
    -main(int argc,
    -     char **argv)
    -{
    -    // Variable declaration.
    -    mrb_value str;
    -
    -    mrb_state *mrb = mrb_open();
    -    if (!mrb)
    -    {
    -       // handle error
    -    }
    -    // Creates a new string.
    -    str = mrb_str_new_lit(mrb, "Hello, world!");
    -    // Returns 5 characters of
    -    mrb_str_resize(mrb, str, 5);
    -    mrb_p(mrb, str);
    -
    -    mrb_close(mrb);
    -    return 0;
    - }
    -
    - -

    Result:

    - -
     => "Hello"
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - str - - - - - - - — -

      The Ruby string to resize.

      -
      - -
    • - -
    • - - len - - - - - - - — -

      The length.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      An object as a Ruby string.

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

    - mrb_value mrb_str_substr(mrb_state * mrb, mrb_value str, mrb_int beg, mrb_int len) - - -

    -
    -
    -

    Returns a sub string.

    - -

    Example:

    - -
    int
    -main(int argc,
    -char const **argv)
    -{
    -  // Variable declarations.
    -  mrb_value str1;
    -  mrb_value str2;
    -
    -  mrb_state *mrb = mrb_open();
    -  if (!mrb)
    -  {
    -    // handle error
    -  }
    -  // Creates new string.
    -  str1 = mrb_str_new_lit(mrb, "Hello, world!");
    -  // Returns a sub-string within the range of 0..2
    -  str2 = mrb_str_substr(mrb, str1, 0, 2);
    -
    -  // Prints sub-string.
    -  mrb_p(mrb, str2);
    -
    -  mrb_close(mrb);
    -  return 0;
    -}
    -
    - -

    Result:

    - -
    => "He"
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - str - - - - - - - — -

      Ruby string.

      -
      - -
    • - -
    • - - beg - - - - - - - — -

      The beginning point of the sub-string.

      -
      - -
    • - -
    • - - len - - - - - - - — -

      The end point of the sub-string.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      An object as a Ruby sub-string.

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

    - mrb_value mrb_ensure_string_type(mrb_state * mrb, mrb_value str) - - -

    -
    -
    -

    Returns a Ruby string type.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - str - - - - - - - — -

      Ruby string.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      A Ruby string.

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

    - mrb_value mrb_check_string_type(mrb_state * mrb, mrb_value str) - - -

    - -
    - - -
    -

    - mrb_value mrb_string_type(mrb_state * mrb, mrb_value str) - - -

    -
    -
    -

    obsolete: use mrb_ensure_string_type() instead

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

    - mrb_value mrb_str_new_capa(mrb_state * mrb, size_t capa) - - -

    - -
    - - -
    -

    - mrb_value mrb_str_buf_new(mrb_state * mrb, size_t capa) - - -

    - -
    - - -
    -

    - mrb_int mrb_string_value_len(mrb_state * mrb, mrb_value str) - - -

    -
    -
    -

    obslete: use RSTRING_LEN()

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

    - mrb_value mrb_str_dup(mrb_state * mrb, mrb_value str) - - -

    -
    -
    -

    Duplicates a string object.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - str - - - - - - - — -

      Ruby string.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      Duplicated Ruby string.

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

    - mrb_value mrb_str_intern(mrb_state * mrb, mrb_value self) - - -

    -
    -
    -

    Returns a symbol from a passed in Ruby string.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - self - - - - - - - — -

      Ruby string.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      A symbol.

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

    - mrb_value mrb_str_to_inum(mrb_state * mrb, mrb_value str, mrb_int base, mrb_bool badcheck) - - -

    - -
    - - -
    -

    - mrb_value mrb_cstr_to_inum(mrb_state * mrb, const char * s, mrb_int base, mrb_bool badcheck) - - -

    - -
    - - -
    -

    - double mrb_str_to_dbl(mrb_state * mrb, mrb_value str, mrb_bool badcheck) - - -

    - -
    - - -
    -

    - double mrb_cstr_to_dbl(mrb_state * mrb, const char * s, mrb_bool badcheck) - - -

    - -
    - - -
    -

    - mrb_value mrb_str_to_str(mrb_state * mrb, mrb_value str) - - -

    -
    -
    -

    Returns a converted string type. -For type checking, non converting mrb_to_str is recommended.

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

    - mrb_bool mrb_str_equal(mrb_state * mrb, mrb_value str1, mrb_value str2) - - -

    -
    -
    -

    Returns true if the strings match and false if the strings don’t match.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - str1 - - - - - - - — -

      Ruby string to compare.

      -
      - -
    • - -
    • - - str2 - - - - - - - — -

      Ruby string to compare.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      boolean value.

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

    - mrb_value mrb_str_cat(mrb_state * mrb, mrb_value str, const char * ptr, size_t len) - - -

    -
    -
    -

    Returns a concatenated string comprised of a Ruby string and a C string.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - str - - - - - - - — -

      Ruby string.

      -
      - -
    • - -
    • - - ptr - - - - - - - — -

      A C string.

      -
      - -
    • - -
    • - - len - - - - - - - — -

      length of C string.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      A Ruby string.

      -
      - -
    • - -
    - -

    See Also:

    - - -
    - - -
    - - -
    -

    - mrb_value mrb_str_cat_cstr(mrb_state * mrb, mrb_value str, const char * ptr) - - -

    -
    -
    -

    Returns a concatenated string comprised of a Ruby string and a C string.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - str - - - - - - - — -

      Ruby string.

      -
      - -
    • - -
    • - - ptr - - - - - - - — -

      A C string.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (mrb_value) - - - - — -

      A Ruby string.

      -
      - -
    • - -
    - -

    See Also:

    - - -
    - - -
    - - -
    -

    - mrb_value mrb_str_cat_str(mrb_state * mrb, mrb_value str, mrb_value str2) - - -

    - -
    - - -
    -

    - mrb_value mrb_str_append(mrb_state * mrb, mrb_value str, mrb_value str2) - - -

    -
    -
    -

    Adds str2 to the end of str1.

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

    - int mrb_str_cmp(mrb_state * mrb, mrb_value str1, mrb_value str2) - - -

    -
    -
    -

    Returns 0 if both Ruby strings are equal. Returns a value < 0 if Ruby str1 is less than Ruby str2. Returns a value > 0 if Ruby str2 is greater than Ruby str1.

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

    - char * mrb_str_to_cstr(mrb_state * mrb, mrb_value str) - - -

    -
    -
    -

    Returns a newly allocated C string from a Ruby string. -This is an utility function to pass a Ruby string to C library functions.

    - -
      -
    • Returned string does not contain any NUL characters (but terminator).
    • -
    • It raises an ArgumentError exception if Ruby string contains -NUL characters.
    • -
    • Retured string will be freed automatically on next GC.
    • -
    • Caller can modify returned string without affecting Ruby string -(e.g. it can be used for mkstemp(3)).
    • -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The current mruby state.

      -
      - -
    • - -
    • - - str - - - - - - - — -

      Ruby string. Must be an instance of String.

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (char *) - - - - — -

      A newly allocated C string.

      -
      - -
    • - -
    - -
    - - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fthrow.h.html b/docs/api/headers/mruby_2Fthrow.h.html deleted file mode 100644 index 5b4478c..0000000 --- a/docs/api/headers/mruby_2Fthrow.h.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - Header: mruby/throw.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/throw.h

    - - - -

    Define Summary

    -
    - -
    #define MRB_THROW_H - -
    -
    - -
    #define MRB_TRY - -
    -
    - -
    #define MRB_CATCH - -
    -
    - -
    #define MRB_END_EXC - -
    -
    - -
    #define MRB_THROW - -
    -
    - -
    #define MRB_SETJMP - -
    -
    - -
    #define MRB_LONGJMP - -
    -
    - -
    #define mrb_jmpbuf_impl - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Ftime.h.html b/docs/api/headers/mruby_2Ftime.h.html deleted file mode 100644 index a8694fc..0000000 --- a/docs/api/headers/mruby_2Ftime.h.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - Header: mruby/time.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/time.h

    - - -

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_TIME_H - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - mrb_value mrb_time_at(mrb_state * mrb, time_t sec, time_t 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 deleted file mode 100644 index 16ea01d..0000000 --- a/docs/api/headers/mruby_2Fvalue.h.html +++ /dev/null @@ -1,918 +0,0 @@ - - - - - - - Header: mruby/value.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/value.h

    -

    Overview

    -
    -
    -

    mruby Symbol. -You can create an mrb_sym by simply using mrb_str_intern() or mrb_intern_cstr()

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

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_VALUE_H - -
    -
    - -
    #define PRIo64 - -
    -
    - -
    #define PRId64 - -
    -
    - -
    #define PRIu64 - -
    -
    - -
    #define PRIx64 - -
    -
    - -
    #define PRIo16 - -
    -
    - -
    #define PRId16 - -
    -
    - -
    #define PRIu16 - -
    -
    - -
    #define PRIx16 - -
    -
    - -
    #define PRIo32 - -
    -
    - -
    #define PRId32 - -
    -
    - -
    #define PRIu32 - -
    -
    - -
    #define PRIx32 - -
    -
    - -
    #define MRB_INT_BIT - -
    -
    - -
    #define MRB_INT_MIN - -
    -
    - -
    #define MRB_INT_MAX - -
    -
    - -
    #define MRB_PRIo - -
    -
    - -
    #define MRB_PRId - -
    -
    - -
    #define MRB_PRIx - -
    -
    - -
    #define MRB_ENDIAN_LOHI - -
    -
    - -
    #define vsnprintf - -
    -
    - -
    #define snprintf - -
    -
    - -
    #define isfinite - -
    -
    - -
    #define isnan - -
    -
    - -
    #define isinf - -
    -
    - -
    #define signbit - -
    -
    - -
    #define INFINITY - -
    -
    - -
    #define NAN - -
    -
    - -
    #define MRB_SYMBOL_BITSIZE - -
    -
    - -
    #define MRB_SYMBOL_MAX - -
    -
    - -
    #define mrb_immediate_p - -
    -
    - -
    #define mrb_fixnum_p - -
    -
    - -
    #define mrb_symbol_p - -
    -
    - -
    #define mrb_undef_p - -
    -
    - -
    #define mrb_nil_p - -
    -
    - -
    #define mrb_false_p - -
    -
    - -
    #define mrb_true_p - -
    -
    - -
    #define mrb_float_p - -
    -
    - -
    #define mrb_array_p - -
    -
    - -
    #define mrb_string_p - -
    -
    - -
    #define mrb_hash_p - -
    -
    - -
    #define mrb_cptr_p - -
    -
    - -
    #define mrb_exception_p - -
    -
    - -
    #define mrb_free_p - -
    -
    - -
    #define mrb_object_p - -
    -
    - -
    #define mrb_class_p - -
    -
    - -
    #define mrb_module_p - -
    -
    - -
    #define mrb_iclass_p - -
    -
    - -
    #define mrb_sclass_p - -
    -
    - -
    #define mrb_proc_p - -
    -
    - -
    #define mrb_range_p - -
    -
    - -
    #define mrb_file_p - -
    -
    - -
    #define mrb_env_p - -
    -
    - -
    #define mrb_data_p - -
    -
    - -
    #define mrb_fiber_p - -
    -
    - -
    #define mrb_istruct_p - -
    -
    - -
    #define mrb_break_p - -
    -
    - -
    #define mrb_bool - -
    -
    - -
    #define mrb_test - -
    -
    - - -
    - -
    #define mrb_ro_data_p - -
    -
    - -
    - - -

    Typedef Summary

    -
    - -
    typedef mrb_sym -
    -
    -

    mruby Symbol. -You can create an mrb_sym by simply using mrb_str_intern() or mrb_intern_cstr()

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    typedef mrb_int - -
    -
    - -
    typedef mrb_float - -
    -
    - -
    typedef mrb_value -
    -
    -
    - This typedef is abstract. -
    -
    -
    -

    MRuby value boxing.

    - -

    Actual implementation depends on configured boxing type.

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

    Function Details

    - - -
    -

    - double mrb_float_read(const char* , char* ) - - -

    - -
    - - -
    -

    - int mrb_msvc_vsnprintf(char * s, size_t n, const char * format, va_list arg) - - -

    - -
    - - -
    -

    - int mrb_msvc_snprintf(char * s, size_t n, const char * format, ... ) - - -

    - -
    - - -
    -

    - mrb_value mrb_float_value(struct mrb_state * mrb, mrb_float f) - - -

    - -
    - - -
    -

    - mrb_value mrb_cptr_value(struct mrb_state * mrb, void * p) - - -

    - -
    - - -
    -

    - mrb_value mrb_fixnum_value(mrb_int i) - - -

    -
    -
    -

    Returns a fixnum in Ruby.

    - -

    Takes an integer and boxes it into an mrb_value

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

    - mrb_value mrb_symbol_value(mrb_sym i) - - -

    - -
    - - -
    -

    - mrb_value mrb_obj_value(void * p) - - -

    - -
    - - -
    -

    - mrb_value mrb_nil_value(void) - - -

    -
    -
    -

    Get a nil mrb_value object.

    - - -
    -
    -
    - -

    Returns:

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

      nil mrb_value object reference.

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

    - mrb_value mrb_false_value(void) - - -

    -
    -
    -

    Returns false in Ruby.

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

    - mrb_value mrb_true_value(void) - - -

    -
    -
    -

    Returns true in Ruby.

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

    - mrb_value mrb_bool_value(mrb_bool boolean) - - -

    - -
    - - -
    -

    - mrb_value mrb_undef_value(void) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fvariable.h.html b/docs/api/headers/mruby_2Fvariable.h.html deleted file mode 100644 index ae6a8ad..0000000 --- a/docs/api/headers/mruby_2Fvariable.h.html +++ /dev/null @@ -1,964 +0,0 @@ - - - - - - - Header: mruby/variable.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/variable.h

    -

    Overview

    -
    -
    -

    Functions to access mruby variables.

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

    - Function Summary - collapse -

    - - - - -

    Define Summary

    -
    - -
    #define MRUBY_VARIABLE_H - -
    -
    - -
    - - -
    -

    Function Details

    - - -
    -

    - mrb_value mrb_const_get(mrb_state* , mrb_value , mrb_sym ) - - -

    - -
    - - -
    -

    - void mrb_const_set(mrb_state* , mrb_value , mrb_sym , mrb_value ) - - -

    - -
    - - -
    -

    - mrb_bool mrb_const_defined(mrb_state* , mrb_value , mrb_sym ) - - -

    - -
    - - -
    -

    - void mrb_const_remove(mrb_state* , mrb_value , mrb_sym ) - - -

    - -
    - - -
    -

    - mrb_bool mrb_iv_name_sym_p(mrb_state * mrb, mrb_sym sym) - - -

    - -
    - - -
    -

    - void mrb_iv_name_sym_check(mrb_state * mrb, mrb_sym sym) - - -

    - -
    - - -
    -

    - mrb_value mrb_obj_iv_get(mrb_state * mrb, struct RObject * obj, mrb_sym sym) - - -

    - -
    - - -
    -

    - void mrb_obj_iv_set(mrb_state * mrb, struct RObject * obj, mrb_sym sym, mrb_value v) - - -

    - -
    - - -
    -

    - mrb_bool mrb_obj_iv_defined(mrb_state * mrb, struct RObject * obj, mrb_sym sym) - - -

    - -
    - - -
    -

    - mrb_value mrb_iv_get(mrb_state * mrb, mrb_value obj, mrb_sym sym) - - -

    - -
    - - -
    -

    - void mrb_iv_set(mrb_state * mrb, mrb_value obj, mrb_sym sym, mrb_value v) - - -

    - -
    - - -
    -

    - mrb_bool mrb_iv_defined(mrb_state* , mrb_value , mrb_sym ) - - -

    - -
    - - -
    -

    - mrb_value mrb_iv_remove(mrb_state * mrb, mrb_value obj, mrb_sym sym) - - -

    - -
    - - -
    -

    - void mrb_iv_copy(mrb_state * mrb, mrb_value dst, mrb_value src) - - -

    - -
    - - -
    -

    - mrb_bool mrb_const_defined_at(mrb_state * mrb, mrb_value mod, mrb_sym id) - - -

    - -
    - - -
    -

    - mrb_value mrb_gv_get(mrb_state * mrb, mrb_sym sym) - - -

    -
    -
    -

    Get a global variable. Will return nil if the var does not exist

    - -

    Example:

    - -
    # Ruby style
    -var = $value
    -
    -!!!c
    -// C style
    -mrb_sym sym = mrb_intern_lit(mrb, "$value");
    -mrb_value var = mrb_gv_get(mrb, sym);
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference

      -
      - -
    • - -
    • - - sym - - - - - - - — -

      The name of the global variable

      -
      - -
    • - -
    - -

    Returns:

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

      The value of that global variable. May be nil

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

    - void mrb_gv_set(mrb_state * mrb, mrb_sym sym, mrb_value val) - - -

    -
    -
    -

    Set a global variable

    - -

    Example:

    - -
    # Ruby style
    -$value = "foo"
    -
    -!!!c
    -// C style
    -mrb_sym sym = mrb_intern_lit(mrb, "$value");
    -mrb_gv_set(mrb, sym, mrb_str_new_lit("foo"));
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference

      -
      - -
    • - -
    • - - sym - - - - - - - — -

      The name of the global variable

      -
      - -
    • - -
    • - - val - - - - - - - — -

      The value of the global variable

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

    - void mrb_gv_remove(mrb_state * mrb, mrb_sym sym) - - -

    -
    -
    -

    Remove a global variable.

    - -

    Example:

    - -
    # Ruby style
    -$value = nil
    -
    -// C style
    -mrb_sym sym = mrb_intern_lit(mrb, "$value");
    -mrb_gv_remove(mrb, sym);
    -
    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - mrb - - - - - - - — -

      The mruby state reference

      -
      - -
    • - -
    • - - sym - - - - - - - — -

      The name of the global variable

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

    - mrb_value mrb_cv_get(mrb_state * mrb, mrb_value mod, mrb_sym sym) - - -

    - -
    - - -
    -

    - void mrb_mod_cv_set(mrb_state * mrb, struct RClass * c, mrb_sym sym, mrb_value v) - - -

    - -
    - - -
    -

    - void mrb_cv_set(mrb_state * mrb, mrb_value mod, mrb_sym sym, mrb_value v) - - -

    - -
    - - -
    -

    - 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) - - -

    - -
    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/headers/mruby_2Fversion.h.html b/docs/api/headers/mruby_2Fversion.h.html deleted file mode 100644 index 9cc8894..0000000 --- a/docs/api/headers/mruby_2Fversion.h.html +++ /dev/null @@ -1,383 +0,0 @@ - - - - - - - Header: mruby/version.h - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Header: mruby/version.h

    - - - -

    Define Summary

    -
    - -
    #define MRUBY_VERSION_H - -
    -
    - -
    #define MRB_STRINGIZE0 -
    -
    -

    A passed in expression.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRB_STRINGIZE -
    -
    -

    Passes in an expression to MRB_STRINGIZE0.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRUBY_RUBY_VERSION -
    -
    -

    The version of Ruby used by mruby.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRUBY_RUBY_ENGINE -
    -
    -

    Ruby engine.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRUBY_RELEASE_MAJOR -
    -
    -

    Major release version number.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRUBY_RELEASE_MINOR -
    -
    -

    Minor release version number.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRUBY_RELEASE_TEENY -
    -
    -

    Tiny release version number.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRUBY_VERSION -
    -
    -

    The mruby version.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRUBY_RELEASE_NO -
    -
    -

    Release number.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRUBY_RELEASE_YEAR -
    -
    -

    Release year.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRUBY_RELEASE_MONTH -
    -
    -

    Release month.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRUBY_RELEASE_DAY -
    -
    -

    Release day.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRUBY_RELEASE_DATE -
    -
    -

    Release date as a string.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRUBY_RELEASE_YEAR_STR - -
    -
    - -
    #define MRUBY_RELEASE_MONTH_STR - -
    -
    - -
    #define MRUBY_RELEASE_DAY_STR - -
    -
    - -
    #define MRUBY_BIRTH_YEAR -
    -
    -

    The year mruby was first created.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRUBY_AUTHOR -
    -
    -

    MRuby’s authors.

    - - -
    -
    -
    - - -
    - - -
    -
    - -
    #define MRUBY_DESCRIPTION -
    -
    -

    mruby’s version, and release date.

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

    Function Details

    - - -
    -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/index.html b/docs/api/index.html deleted file mode 100644 index 88424f6..0000000 --- a/docs/api/index.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - File: README - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
    - - -

    Build Status

    - -

    What is mruby

    - -

    mruby is the lightweight implementation of the Ruby language complying to (part -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. -You can also compile Ruby programs into compiled byte code using the mruby -compiler “mrbc”. All those tools reside in the “bin” directory. “mrbc” is -also able to generate compiled byte code in a C source file, see the “mrbtest” -program under the “test” directory for an example.

    - -

    This achievement was sponsored by the Regional Innovation Creation R&D Programs -of the Ministry of Economy, Trade and Industry of Japan.

    - -

    How to get mruby

    - -

    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

    - -

    The trunk of the mruby source tree can be checked out with the -following command:

    - -
    $ git clone https://github.com/mruby/mruby.git
    -
    - -

    You can also install and compile mruby using ruby-install, ruby-build or rvm.

    - -

    mruby home-page

    - -

    The URL of the mruby home-page is: http://www.mruby.org.

    - -

    Mailing list

    - -

    We don’t have a mailing list, but you can use GitHub issues.

    - -

    How to compile and install (mruby and gems)

    - -

    See the compile.md file.

    - -

    Running Tests

    - -

    To run the tests, execute the following from the project’s root directory.

    - -
    $ make test
    -
    - -

    Or

    - -
    $ 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 mrbgems.md. -For example code of how to use mrbgems look into the folder examples/mrbgems/.

    - -

    License

    - -

    mruby is released under the MIT License.

    - -

    Note for License

    - -

    mruby has chosen a MIT License due to its permissive license allowing -developers to target various environments such as embedded systems. -However, the license requires the display of the copyright notice and license -information in manuals for instance. Doing so for big projects can be -complicated or troublesome. This is why mruby has decided to display “mruby -developers” as the copyright name to make it simple conventionally. -In the future, mruby might ask you to distribute your new code -(that you will commit,) under the MIT License as a member of -“mruby developers” but contributors will keep their copyright. -(We did not intend for contributors to transfer or waive their copyrights, -Actual copyright holder name (contributors) will be listed in the AUTHORS -file.)

    - -

    Please ask us if you want to distribute your code under another license.

    - -

    How to Contribute

    - -

    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 -file in your pull request.

    - -
    - - - -
    - - \ No newline at end of file diff --git a/docs/api/js/app.js b/docs/api/js/app.js deleted file mode 100644 index 368f44a..0000000 --- a/docs/api/js/app.js +++ /dev/null @@ -1,303 +0,0 @@ -(function() { - -var localStorage = {}, sessionStorage = {}; -try { localStorage = window.localStorage; } catch (e) { } -try { sessionStorage = window.sessionStorage; } catch (e) { } - -function createSourceLinks() { - $('.method_details_list .source_code'). - before("[View source]"); - $('.toggleSource').toggle(function() { - $(this).parent().nextAll('.source_code').slideDown(100); - $(this).text("Hide source"); - }, - function() { - $(this).parent().nextAll('.source_code').slideUp(100); - $(this).text("View source"); - }); -} - -function createDefineLinks() { - var tHeight = 0; - $('.defines').after(" more..."); - $('.toggleDefines').toggle(function() { - tHeight = $(this).parent().prev().height(); - $(this).prev().css('display', 'inline'); - $(this).parent().prev().height($(this).parent().height()); - $(this).text("(less)"); - }, - function() { - $(this).prev().hide(); - $(this).parent().prev().height(tHeight); - $(this).text("more..."); - }); -} - -function createFullTreeLinks() { - var tHeight = 0; - $('.inheritanceTree').toggle(function() { - tHeight = $(this).parent().prev().height(); - $(this).parent().toggleClass('showAll'); - $(this).text("(hide)"); - $(this).parent().prev().height($(this).parent().height()); - }, - function() { - $(this).parent().toggleClass('showAll'); - $(this).parent().prev().height(tHeight); - $(this).text("show all"); - }); -} - -function searchFrameButtons() { - $('.full_list_link').click(function() { - toggleSearchFrame(this, $(this).attr('href')); - return false; - }); - window.addEventListener('message', function(e) { - if (e.data === 'navEscape') { - $('#nav').slideUp(100); - $('#search a').removeClass('active inactive'); - $(window).focus(); - } - }); - - $(window).resize(function() { - if ($('#search:visible').length === 0) { - $('#nav').removeAttr('style'); - $('#search a').removeClass('active inactive'); - $(window).focus(); - } - }); -} - -function toggleSearchFrame(id, link) { - var frame = $('#nav'); - $('#search a').removeClass('active').addClass('inactive'); - if (frame.attr('src') === link && frame.css('display') !== "none") { - frame.slideUp(100); - $('#search a').removeClass('active inactive'); - } - else { - $(id).addClass('active').removeClass('inactive'); - if (frame.attr('src') !== link) frame.attr('src', link); - frame.slideDown(100); - } -} - -function linkSummaries() { - $('.summary_signature').click(function() { - document.location = $(this).find('a').attr('href'); - }); -} - -function summaryToggle() { - $('.summary_toggle').click(function(e) { - e.preventDefault(); - localStorage.summaryCollapsed = $(this).text(); - $('.summary_toggle').each(function() { - $(this).text($(this).text() == "collapse" ? "expand" : "collapse"); - var next = $(this).parent().parent().nextAll('ul.summary').first(); - if (next.hasClass('compact')) { - next.toggle(); - next.nextAll('ul.summary').first().toggle(); - } - else if (next.hasClass('summary')) { - var list = $('
      '); - list.html(next.html()); - list.find('.summary_desc, .note').remove(); - list.find('a').each(function() { - $(this).html($(this).find('strong').html()); - $(this).parent().html($(this)[0].outerHTML); - }); - next.before(list); - next.toggle(); - } - }); - return false; - }); - if (localStorage.summaryCollapsed == "collapse") { - $('.summary_toggle').first().click(); - } 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 = $('
        '); - var show = false; - var toc = _toc; - var counter = 0; - var tags = ['h2', 'h3', 'h4', 'h5', 'h6']; - var i; - if ($('#filecontents h1').length > 1) tags.unshift('h1'); - for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; } - var lastTag = parseInt(tags[0][1], 10); - $(tags.join(', ')).each(function() { - if ($(this).parents('.method_details .docstring').length != 0) return; - if (this.id == "filecontents") return; - show = true; - var thisTag = parseInt(this.tagName[1], 10); - if (this.id.length === 0) { - var proposedId = $(this).attr('toc-id'); - if (typeof(proposedId) != "undefined") this.id = proposedId; - else { - var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_'); - if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; } - this.id = proposedId; - } - } - if (thisTag > lastTag) { - for (i = 0; i < thisTag - lastTag; i++) { - var tmp = $('
          '); toc.append(tmp); toc = tmp; - } - } - if (thisTag < lastTag) { - for (i = 0; i < lastTag - thisTag; i++) toc = toc.parent(); - } - var title = $(this).attr('toc-title'); - if (typeof(title) == "undefined") title = $(this).text(); - toc.append('
        1. ' + title + '
        2. '); - lastTag = thisTag; - }); - if (!show) return; - html = ''; - $('#content').prepend(html); - $('#toc').append(_toc); - $('#toc .hide_toc').toggle(function() { - $('#toc .top').slideUp('fast'); - $('#toc').toggleClass('hidden'); - $('#toc .title small').toggle(); - }, function() { - $('#toc .top').slideDown('fast'); - $('#toc').toggleClass('hidden'); - $('#toc .title small').toggle(); - }); -} - -function navResizeFn(e) { - if (e.which !== 1) { - navResizeFnStop(); - return; - } - - sessionStorage.navWidth = e.pageX.toString(); - $('.nav_wrap').css('width', e.pageX); - $('.nav_wrap').css('-ms-flex', 'inherit'); -} - -function navResizeFnStop() { - $(window).unbind('mousemove', navResizeFn); - window.removeEventListener('message', navMessageFn, false); -} - -function navMessageFn(e) { - if (e.data.action === 'mousemove') navResizeFn(e.data.event); - if (e.data.action === 'mouseup') navResizeFnStop(); -} - -function navResizer() { - $('#resizer').mousedown(function(e) { - e.preventDefault(); - $(window).mousemove(navResizeFn); - window.addEventListener('message', navMessageFn, false); - }); - $(window).mouseup(navResizeFnStop); - - if (sessionStorage.navWidth) { - navResizeFn({which: 1, pageX: parseInt(sessionStorage.navWidth, 10)}); - } -} - -function navExpander() { - var done = false, timer = setTimeout(postMessage, 500); - function postMessage() { - if (done) return; - clearTimeout(timer); - var opts = { action: 'expand', path: pathId }; - document.getElementById('nav').contentWindow.postMessage(opts, '*'); - done = true; - } - - window.addEventListener('message', function(event) { - if (event.data === 'navReady') postMessage(); - return false; - }, false); -} - -function mainFocus() { - var hash = window.location.hash; - if (hash !== '' && $(hash)[0]) { - $(hash)[0].scrollIntoView(); - } - - 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(); - createSourceLinks(); - createDefineLinks(); - createFullTreeLinks(); - searchFrameButtons(); - linkSummaries(); - summaryToggle(); - constantSummaryToggle(); - generateTOC(); - mainFocus(); - navigationChange(); -}); - -})(); diff --git a/docs/api/js/full_list.js b/docs/api/js/full_list.js deleted file mode 100644 index 59069c5..0000000 --- a/docs/api/js/full_list.js +++ /dev/null @@ -1,216 +0,0 @@ -(function() { - -var $clicked = $(null); -var searchTimeout = null; -var searchCache = []; -var caseSensitiveMatch = false; -var ignoreKeyCodeMin = 8; -var ignoreKeyCodeMax = 46; -var commandKey = 91; - -RegExp.escape = function(text) { - return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); -} - -function escapeShortcut() { - $(document).keydown(function(evt) { - if (evt.which == 27) { - window.parent.postMessage('navEscape', '*'); - } - }); -} - -function navResizer() { - $(window).mousemove(function(e) { - window.parent.postMessage({ - action: 'mousemove', event: {pageX: e.pageX, which: e.which} - }, '*'); - }).mouseup(function(e) { - window.parent.postMessage({action: 'mouseup'}, '*'); - }); - window.parent.postMessage("navReady", "*"); -} - -function clearSearchTimeout() { - clearTimeout(searchTimeout); - searchTimeout = null; -} - -function enableLinks() { - // load the target page in the parent window - $('#full_list li').on('click', function(evt) { - $('#full_list li').removeClass('clicked'); - $clicked = $(this); - $clicked.addClass('clicked'); - evt.stopPropagation(); - - if (evt.target.tagName === 'A') return true; - - var elem = $clicked.find('> .item .object_link a')[0]; - var e = evt.originalEvent; - var newEvent = new MouseEvent(evt.originalEvent.type); - newEvent.initMouseEvent(e.type, e.canBubble, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget); - elem.dispatchEvent(newEvent); - evt.preventDefault(); - return false; - }); -} - -function enableToggles() { - // show/hide nested classes on toggle click - $('#full_list a.toggle').on('click', function(evt) { - evt.stopPropagation(); - evt.preventDefault(); - $(this).parent().parent().toggleClass('collapsed'); - highlight(); - }); -} - -function populateSearchCache() { - $('#full_list li .item').each(function() { - var $node = $(this); - var $link = $node.find('.object_link a'); - if ($link.length > 0) { - searchCache.push({ - node: $node, - link: $link, - name: $link.text(), - fullName: $link.attr('title').split(' ')[0] - }); - } - }); -} - -function enableSearch() { - $('#search input').keyup(function(event) { - if (ignoredKeyPress(event)) return; - if (this.value === "") { - clearSearch(); - } else { - performSearch(this.value); - } - }); - - $('#full_list').after(""); -} - -function ignoredKeyPress(event) { - if ( - (event.keyCode > ignoreKeyCodeMin && event.keyCode < ignoreKeyCodeMax) || - (event.keyCode == commandKey) - ) { - return true; - } else { - return false; - } -} - -function clearSearch() { - clearSearchTimeout(); - $('#full_list .found').removeClass('found').each(function() { - var $link = $(this).find('.object_link a'); - $link.text($link.text()); - }); - $('#full_list, #content').removeClass('insearch'); - $clicked.parents().removeClass('collapsed'); - highlight(); -} - -function performSearch(searchString) { - clearSearchTimeout(); - $('#full_list, #content').addClass('insearch'); - $('#noresults').text('').hide(); - partialSearch(searchString, 0); -} - -function partialSearch(searchString, offset) { - var lastRowClass = ''; - var i = null; - for (i = offset; i < Math.min(offset + 50, searchCache.length); i++) { - var item = searchCache[i]; - var searchName = (searchString.indexOf('::') != -1 ? item.fullName : item.name); - var matchString = buildMatchString(searchString); - var matchRegexp = new RegExp(matchString, caseSensitiveMatch ? "" : "i"); - if (searchName.match(matchRegexp) == null) { - item.node.removeClass('found'); - item.link.text(item.link.text()); - } - else { - item.node.addClass('found'); - item.node.removeClass(lastRowClass).addClass(lastRowClass == 'r1' ? 'r2' : 'r1'); - lastRowClass = item.node.hasClass('r1') ? 'r1' : 'r2'; - item.link.html(item.name.replace(matchRegexp, "$&")); - } - } - if(i == searchCache.length) { - searchDone(); - } else { - searchTimeout = setTimeout(function() { - partialSearch(searchString, i); - }, 0); - } -} - -function searchDone() { - searchTimeout = null; - highlight(); - if ($('#full_list li:visible').size() === 0) { - $('#noresults').text('No results were found.').hide().fadeIn(); - } else { - $('#noresults').text('').hide(); - } - $('#content').removeClass('insearch'); -} - -function buildMatchString(searchString, event) { - caseSensitiveMatch = searchString.match(/[A-Z]/) != null; - var regexSearchString = RegExp.escape(searchString); - if (caseSensitiveMatch) { - regexSearchString += "|" + - $.map(searchString.split(''), function(e) { return RegExp.escape(e); }). - join('.+?'); - } - return regexSearchString; -} - -function highlight() { - $('#full_list li:visible').each(function(n) { - $(this).removeClass('even odd').addClass(n % 2 == 0 ? 'odd' : 'even'); - }); -} - -/** - * Expands the tree to the target element and its immediate - * children. - */ -function expandTo(path) { - var $target = $(document.getElementById('object_' + path)); - $target.addClass('clicked'); - $target.removeClass('collapsed'); - $target.parentsUntil('#full_list', 'li').removeClass('collapsed'); - if($target[0]) { - window.scrollTo(window.scrollX, $target.offset().top - 250); - highlight(); - } -} - -function windowEvents(event) { - var msg = event.data; - if (msg.action === "expand") { - expandTo(msg.path); - } - return false; -} - -window.addEventListener("message", windowEvents, false); - -$(document).ready(function() { - escapeShortcut(); - navResizer(); - enableLinks(); - enableToggles(); - populateSearchCache(); - enableSearch(); -}); - -})(); diff --git a/docs/api/js/jquery.js b/docs/api/js/jquery.js deleted file mode 100644 index 198b3ff..0000000 --- a/docs/api/js/jquery.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
          a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
          "+""+"
          ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
          t
          ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
          ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

          ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
          ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
          ","
          "],thead:[1,"","
          "],tr:[2,"","
          "],td:[3,"","
          "],col:[2,"","
          "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
          ","
          "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
          ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/docs/api/js/mruby.js b/docs/api/js/mruby.js deleted file mode 100644 index e69de29..0000000 diff --git a/docs/api/method_list.html b/docs/api/method_list.html deleted file mode 100644 index e6d1754..0000000 --- a/docs/api/method_list.html +++ /dev/null @@ -1,6835 +0,0 @@ - - - - - - - - - - - - - - - - - - Method List - - - -
          -
          -

          Method List

          - - - -
          - - -
          - - diff --git a/docs/api/top-level-namespace.html b/docs/api/top-level-namespace.html deleted file mode 100644 index 0ee5596..0000000 --- a/docs/api/top-level-namespace.html +++ /dev/null @@ -1,365 +0,0 @@ - - - - - - - Top Level Namespace - - — Documentation by YARD 0.9.20 - - - - - - - - - - - - - - - - - - - - - - - -
          - - -

          Top Level Namespace - - - -

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

          Defined Under Namespace

          -

          - - - Modules: Comparable, Enumerable, GC, Integral, Kernel, Math, ObjectSpace - - - - Classes: Addrinfo, ArgumentError, Array, BasicSocket, Complex, EOFError, Enumerator, Exception, FalseClass, Fiber, File, FileTest, Fixnum, Float, FloatDomainError, FrozenError, Hash, IO, IOError, IPSocket, IndexError, Integer, KeyError, LocalJumpError, Method, Module, NameError, NilClass, NoMemoryError, NoMethodError, NotImplementedError, Numeric, Proc, Random, Range, RangeError, Rational, RegexpError, ScriptError, Socket, SocketError, StandardError, StopIteration, String, Struct, Symbol, SystemStackError, TCPServer, TCPSocket, Time, TrueClass, TypeError, UDPSocket, UNIXServer, UNIXSocket, UnboundMethod - - -

          - - -

          - Constant Summary - collapse -

          - -
          - -
          STDIN = - -
          -
          IO.open(0, "r")
          - -
          STDOUT = - -
          -
          IO.open(1, "w")
          - -
          STDERR = - -
          -
          IO.open(2, "w")
          - -
          - - - - - - - - - -

          - Class Method Summary - collapse -

          - - - - - - -
          -

          Class Method Details

          - - -
          -

          - - .include(*modules) ⇒ Object - - - - - -

          - - - - -
          -
          -
          -
          -2
          -3
          -4
          -
          -
          # File 'mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb', line 2
          -
          -def self.include (*modules)
          -  self.class.include(*modules)
          -end
          -
          -
      - -
      -

      - - .private(*methods) ⇒ Object - - - - - -

      - - - - -
      -
      -
      -
      -6
      -7
      -
      -
      # File 'mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb', line 6
      -
      -def self.private(*methods)
      -end
      -
      -
      - -
      -

      - - .protected(*methods) ⇒ Object - - - - - -

      - - - - -
      -
      -
      -
      -8
      -9
      -
      -
      # File 'mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb', line 8
      -
      -def self.protected(*methods)
      -end
      -
      -
      - -
      -

      - - .public(*methods) ⇒ Object - - - - - -

      - - - - -
      -
      -
      -
      -10
      -11
      -
      -
      # File 'mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb', line 10
      -
      -def self.public(*methods)
      -end
      -
      -
      - - - - - - - - - - \ No newline at end of file From e785693b7a38853071e2a6cbf365545a54f33c38 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 19:40:56 +0100 Subject: [PATCH 24/39] Create deploy.yml --- .github/workflows/deploy.yml | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..85863ab --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,56 @@ +name: Deploy + +on: + push: + branches: [master] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: false + + - name: Install dependencies + run: bundle install --with scripts + + - name: Configure GitHub Pages + uses: actions/configure-pages@v5 + + - name: Generate and build + run: bundle exec rake build + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + JEKYLL_ENV: production + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: _site/ + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From a0d0e90e38fd92b2eff846efe631e69c50fbf435 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 21:45:11 +0100 Subject: [PATCH 25/39] Rename and tweak --- .github/workflows/{deploy.yml => pages.yml} | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) rename .github/workflows/{deploy.yml => pages.yml} (85%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/pages.yml similarity index 85% rename from .github/workflows/deploy.yml rename to .github/workflows/pages.yml index 85863ab..d15ac9a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/pages.yml @@ -1,4 +1,4 @@ -name: Deploy +name: Pages on: push: @@ -25,10 +25,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: .ruby-version - bundler-cache: false - - - name: Install dependencies - run: bundle install --with scripts + bundler-cache: true - name: Configure GitHub Pages uses: actions/configure-pages@v5 @@ -41,8 +38,6 @@ jobs: - name: Upload artifact uses: actions/upload-pages-artifact@v3 - with: - path: _site/ deploy: environment: From 6e167e82e43ce5a40abecef2ba3d50f2f339e6df Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 21:45:18 +0100 Subject: [PATCH 26/39] Remove groups --- Gemfile | 20 ++++---------------- Gemfile.lock | 21 --------------------- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/Gemfile b/Gemfile index e346ee9..e48e20e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,19 +1,7 @@ source 'https://rubygems.org' gem 'rake' -gem 'github-pages', group: :jekyll_plugins - -group :jekyll_plugins do - gem 'jekyll-avatar', '~> 0.8.0' - gem 'jekyll-feed' - gem 'jekyll-sitemap' -end - -group :scripts do - gem 'mgem' - gem 'git' - - # API Docs - gem 'yard-mruby' - gem 'yard-coderay' -end +gem 'github-pages' +gem 'jekyll-avatar', '~> 0.8.0' +gem 'jekyll-feed' +gem 'jekyll-sitemap' diff --git a/Gemfile.lock b/Gemfile.lock index 12c1204..22e027f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,7 +18,6 @@ GEM public_suffix (>= 2.0.2, < 8.0) base64 (0.3.0) bigdecimal (4.0.1) - coderay (1.1.3) coffee-script (2.4.1) coffee-script-source execjs @@ -48,11 +47,6 @@ GEM ffi (1.17.0-x86_64-darwin) forwardable-extended (2.6.0) gemoji (4.1.0) - git (4.3.1) - activesupport (>= 5.0) - addressable (~> 2.8) - process_executer (~> 4.0) - rchardet (~> 1.9) github-pages (232) github-pages-health-check (= 1.18.2) jekyll (= 3.10.0) @@ -232,7 +226,6 @@ GEM rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) mercenary (0.3.6) - mgem (0.3.0) mini_portile2 (2.8.9) minima (2.5.1) jekyll (>= 3.5, < 5.0) @@ -253,15 +246,12 @@ GEM pathutil (0.16.2) forwardable-extended (~> 2.6) prism (1.9.0) - process_executer (4.0.2) - track_open_instances (~> 0.1) public_suffix (5.1.1) racc (1.8.1) rake (13.3.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rchardet (1.10.0) rexml (3.4.2) rouge (3.30.0) rubyzip (2.3.2) @@ -278,7 +268,6 @@ GEM simpleidn (0.2.3) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) - track_open_instances (0.1.15) typhoeus (1.4.1) ethon (>= 0.9.0) tzinfo (2.0.6) @@ -286,27 +275,17 @@ GEM unicode-display_width (1.8.0) uri (1.1.1) webrick (1.8.2) - yard (0.9.36) - yard-coderay (0.1.0) - coderay - yard - yard-mruby (0.3.0) - yard (~> 0.9.0) PLATFORMS ruby x86_64-darwin-19 DEPENDENCIES - git github-pages jekyll-avatar (~> 0.8.0) jekyll-feed jekyll-sitemap - mgem rake - yard-coderay - yard-mruby BUNDLED WITH 2.4.1 From d5edda12ae146208a350e141433ab3fee3181185 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 21:54:13 +0100 Subject: [PATCH 27/39] Bump Ruby and gems --- .ruby-version | 1 + Gemfile | 4 +- Gemfile.lock | 277 ++++++--------------------------------- assets/css/redesign.scss | 28 ++-- 4 files changed, 60 insertions(+), 250 deletions(-) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..1454f6e --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +4.0.1 diff --git a/Gemfile b/Gemfile index e48e20e..e7005a7 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' gem 'rake' -gem 'github-pages' -gem 'jekyll-avatar', '~> 0.8.0' +gem 'jekyll' +gem 'jekyll-avatar' gem 'jekyll-feed' gem 'jekyll-sitemap' diff --git a/Gemfile.lock b/Gemfile.lock index 22e027f..d9ecf82 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,288 +1,97 @@ GEM remote: https://rubygems.org/ specs: - activesupport (8.1.2) - base64 - bigdecimal - concurrent-ruby (~> 1.0, >= 1.3.1) - connection_pool (>= 2.2.5) - drb - i18n (>= 1.6, < 2) - json - logger (>= 1.4.2) - minitest (>= 5.1) - securerandom (>= 0.3) - tzinfo (~> 2.0, >= 2.0.5) - uri (>= 0.13.1) - addressable (2.8.8) + addressable (2.8.9) public_suffix (>= 2.0.2, < 8.0) base64 (0.3.0) bigdecimal (4.0.1) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.12.2) colorator (1.1.0) - commonmarker (0.23.10) concurrent-ruby (1.3.6) - connection_pool (3.0.2) - csv (3.3.0) - dnsruby (1.72.2) - simpleidn (~> 0.2.1) - drb (2.2.3) + csv (3.3.5) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) - ethon (0.16.0) - ffi (>= 1.15.0) eventmachine (1.2.7) - execjs (2.9.1) - faraday (2.14.1) - faraday-net_http (>= 2.0, < 3.5) - json - logger - faraday-net_http (3.4.2) - net-http (~> 0.5) - ffi (1.17.0) - ffi (1.17.0-x86_64-darwin) + ffi (1.17.3) + ffi (1.17.3-x86_64-darwin) forwardable-extended (2.6.0) - gemoji (4.1.0) - github-pages (232) - github-pages-health-check (= 1.18.2) - jekyll (= 3.10.0) - jekyll-avatar (= 0.8.0) - jekyll-coffeescript (= 1.2.2) - jekyll-commonmark-ghpages (= 0.5.1) - jekyll-default-layout (= 0.1.5) - jekyll-feed (= 0.17.0) - jekyll-gist (= 1.5.0) - jekyll-github-metadata (= 2.16.1) - jekyll-include-cache (= 0.2.1) - jekyll-mentions (= 1.6.0) - jekyll-optional-front-matter (= 0.3.2) - jekyll-paginate (= 1.1.0) - jekyll-readme-index (= 0.3.0) - jekyll-redirect-from (= 0.16.0) - jekyll-relative-links (= 0.6.1) - jekyll-remote-theme (= 0.4.3) - jekyll-sass-converter (= 1.5.2) - jekyll-seo-tag (= 2.8.0) - jekyll-sitemap (= 1.4.0) - jekyll-swiss (= 1.0.0) - jekyll-theme-architect (= 0.2.0) - jekyll-theme-cayman (= 0.2.0) - jekyll-theme-dinky (= 0.2.0) - jekyll-theme-hacker (= 0.2.0) - jekyll-theme-leap-day (= 0.2.0) - jekyll-theme-merlot (= 0.2.0) - jekyll-theme-midnight (= 0.2.0) - jekyll-theme-minimal (= 0.2.0) - jekyll-theme-modernist (= 0.2.0) - jekyll-theme-primer (= 0.6.0) - jekyll-theme-slate (= 0.2.0) - jekyll-theme-tactile (= 0.2.0) - jekyll-theme-time-machine (= 0.2.0) - jekyll-titles-from-headings (= 0.5.3) - jemoji (= 0.13.0) - kramdown (= 2.4.0) - kramdown-parser-gfm (= 1.1.0) - liquid (= 4.0.4) - mercenary (~> 0.3) - minima (= 2.5.1) - nokogiri (>= 1.16.2, < 2.0) - rouge (= 3.30.0) - terminal-table (~> 1.4) - webrick (~> 1.8) - github-pages-health-check (1.18.2) - addressable (~> 2.3) - dnsruby (~> 1.60) - octokit (>= 4, < 8) - public_suffix (>= 3.0, < 6.0) - typhoeus (~> 1.3) - html-pipeline (2.14.3) - activesupport (>= 2) - nokogiri (>= 1.4) - http_parser.rb (0.8.0) + google-protobuf (4.34.0) + bigdecimal + rake (~> 13.3) + google-protobuf (4.34.0-x86_64-darwin) + bigdecimal + rake (~> 13.3) + http_parser.rb (0.8.1) i18n (1.14.8) concurrent-ruby (~> 1.0) - jekyll (3.10.0) + jekyll (4.4.1) addressable (~> 2.4) + base64 (~> 0.2) colorator (~> 1.0) csv (~> 3.0) em-websocket (~> 0.5) - i18n (>= 0.7, < 2) - jekyll-sass-converter (~> 1.0) + i18n (~> 1.0) + jekyll-sass-converter (>= 2.0, < 4.0) jekyll-watch (~> 2.0) - kramdown (>= 1.17, < 3) + json (~> 2.6) + kramdown (~> 2.3, >= 2.3.1) + kramdown-parser-gfm (~> 1.0) liquid (~> 4.0) - mercenary (~> 0.3.3) + mercenary (~> 0.3, >= 0.3.6) pathutil (~> 0.9) - rouge (>= 1.7, < 4) + rouge (>= 3.0, < 5.0) safe_yaml (~> 1.0) - webrick (>= 1.0) + terminal-table (>= 1.8, < 4.0) + webrick (~> 1.7) jekyll-avatar (0.8.0) jekyll (>= 3.0, < 5.0) - jekyll-coffeescript (1.2.2) - coffee-script (~> 2.2) - coffee-script-source (~> 1.12) - jekyll-commonmark (1.4.0) - commonmarker (~> 0.22) - jekyll-commonmark-ghpages (0.5.1) - commonmarker (>= 0.23.7, < 1.1.0) - jekyll (>= 3.9, < 4.0) - jekyll-commonmark (~> 1.4.0) - rouge (>= 2.0, < 5.0) - jekyll-default-layout (0.1.5) - jekyll (>= 3.0, < 5.0) jekyll-feed (0.17.0) jekyll (>= 3.7, < 5.0) - jekyll-gist (1.5.0) - octokit (~> 4.2) - jekyll-github-metadata (2.16.1) - jekyll (>= 3.4, < 5.0) - octokit (>= 4, < 7, != 4.4.0) - jekyll-include-cache (0.2.1) - jekyll (>= 3.7, < 5.0) - jekyll-mentions (1.6.0) - html-pipeline (~> 2.3) - jekyll (>= 3.7, < 5.0) - jekyll-optional-front-matter (0.3.2) - jekyll (>= 3.0, < 5.0) - jekyll-paginate (1.1.0) - jekyll-readme-index (0.3.0) - jekyll (>= 3.0, < 5.0) - jekyll-redirect-from (0.16.0) - jekyll (>= 3.3, < 5.0) - jekyll-relative-links (0.6.1) - jekyll (>= 3.3, < 5.0) - jekyll-remote-theme (0.4.3) - addressable (~> 2.0) - jekyll (>= 3.5, < 5.0) - jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0) - rubyzip (>= 1.3.0, < 3.0) - jekyll-sass-converter (1.5.2) - sass (~> 3.4) - jekyll-seo-tag (2.8.0) - jekyll (>= 3.8, < 5.0) + jekyll-sass-converter (3.1.0) + sass-embedded (~> 1.75) jekyll-sitemap (1.4.0) jekyll (>= 3.7, < 5.0) - jekyll-swiss (1.0.0) - jekyll-theme-architect (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-cayman (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-dinky (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-hacker (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-leap-day (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-merlot (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-midnight (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-minimal (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-modernist (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-primer (0.6.0) - jekyll (> 3.5, < 5.0) - jekyll-github-metadata (~> 2.9) - jekyll-seo-tag (~> 2.0) - jekyll-theme-slate (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-tactile (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-time-machine (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-titles-from-headings (0.5.3) - jekyll (>= 3.3, < 5.0) jekyll-watch (2.2.1) listen (~> 3.0) - jemoji (0.13.0) - gemoji (>= 3, < 5) - html-pipeline (~> 2.2) - jekyll (>= 3.0, < 5.0) json (2.18.1) - kramdown (2.4.0) - rexml + kramdown (2.5.2) + rexml (>= 3.4.4) kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) liquid (4.0.4) - listen (3.9.0) + listen (3.10.0) + logger rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) - mercenary (0.3.6) - mini_portile2 (2.8.9) - minima (2.5.1) - jekyll (>= 3.5, < 5.0) - jekyll-feed (~> 0.9) - jekyll-seo-tag (~> 2.1) - minitest (6.0.1) - prism (~> 1.5) - net-http (0.9.1) - uri (>= 0.11.1) - nokogiri (1.19.1) - mini_portile2 (~> 2.8.2) - racc (~> 1.4) - nokogiri (1.19.1-x86_64-darwin) - racc (~> 1.4) - octokit (4.25.1) - faraday (>= 1, < 3) - sawyer (~> 0.9) + mercenary (0.4.0) pathutil (0.16.2) forwardable-extended (~> 2.6) - prism (1.9.0) - public_suffix (5.1.1) - racc (1.8.1) + public_suffix (7.0.5) rake (13.3.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rexml (3.4.2) - rouge (3.30.0) - rubyzip (2.3.2) + rexml (3.4.4) + rouge (4.7.0) 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.9.2) - addressable (>= 2.3.5) - faraday (>= 0.17.3, < 3) - securerandom (0.4.1) - simpleidn (0.2.3) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - typhoeus (1.4.1) - ethon (>= 0.9.0) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - unicode-display_width (1.8.0) - uri (1.1.1) - webrick (1.8.2) + sass-embedded (1.97.3) + google-protobuf (~> 4.31) + rake (>= 13) + sass-embedded (1.97.3-x86_64-darwin) + google-protobuf (~> 4.31) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + unicode-display_width (2.6.0) + webrick (1.9.2) PLATFORMS ruby x86_64-darwin-19 DEPENDENCIES - github-pages - jekyll-avatar (~> 0.8.0) + jekyll + jekyll-avatar jekyll-feed jekyll-sitemap rake diff --git a/assets/css/redesign.scss b/assets/css/redesign.scss index 2c1ea0c..756023a 100644 --- a/assets/css/redesign.scss +++ b/assets/css/redesign.scss @@ -1,17 +1,17 @@ --- --- -@import "variables"; -@import "reset"; -@import "page-header"; -@import "navigation"; -@import "buttons"; -@import "latest-news"; -@import "footer"; -@import "downloads"; -@import "documentation"; -@import "inline-code"; -@import "about"; -@import "libraries"; -@import "team"; -@import "article"; +@use "variables"; +@use "reset"; +@use "page-header"; +@use "navigation"; +@use "buttons"; +@use "latest-news"; +@use "footer"; +@use "downloads"; +@use "documentation"; +@use "inline-code"; +@use "about"; +@use "libraries"; +@use "team"; +@use "article"; From ce9b4baa011d9753d71235a50b2a993862ea4ce2 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 22:00:14 +0100 Subject: [PATCH 28/39] Add missing gems --- Gemfile | 6 +++++- Gemfile.lock | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index e7005a7..15bd8f2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,11 @@ source 'https://rubygems.org' -gem 'rake' gem 'jekyll' gem 'jekyll-avatar' gem 'jekyll-feed' gem 'jekyll-sitemap' +gem 'mgem' +gem 'rake' +gem 'yard-coderay' +gem 'yard-mruby' +gem 'irb' diff --git a/Gemfile.lock b/Gemfile.lock index d9ecf82..5fae1d4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,12 +5,15 @@ GEM public_suffix (>= 2.0.2, < 8.0) base64 (0.3.0) bigdecimal (4.0.1) + coderay (1.1.3) colorator (1.1.0) concurrent-ruby (1.3.6) csv (3.3.5) + date (3.5.1) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) + erb (6.0.2) eventmachine (1.2.7) ffi (1.17.3) ffi (1.17.3-x86_64-darwin) @@ -24,6 +27,12 @@ GEM http_parser.rb (0.8.1) i18n (1.14.8) concurrent-ruby (~> 1.0) + io-console (0.8.2) + irb (1.17.0) + pp (>= 0.6.0) + prism (>= 1.3.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) jekyll (4.4.1) addressable (~> 2.4) base64 (~> 0.2) @@ -65,13 +74,27 @@ GEM rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) mercenary (0.4.0) + mgem (0.3.0) pathutil (0.16.2) forwardable-extended (~> 2.6) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.9.0) + psych (5.3.1) + date + stringio public_suffix (7.0.5) rake (13.3.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) + rdoc (7.2.0) + erb + psych (>= 4.0.0) + tsort + reline (0.6.3) + io-console (~> 0.5) rexml (3.4.4) rouge (4.7.0) safe_yaml (1.0.5) @@ -80,21 +103,33 @@ GEM rake (>= 13) sass-embedded (1.97.3-x86_64-darwin) google-protobuf (~> 4.31) + stringio (3.2.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) + tsort (0.2.0) unicode-display_width (2.6.0) webrick (1.9.2) + yard (0.9.38) + yard-coderay (0.1.0) + coderay + yard + yard-mruby (0.3.0) + yard (~> 0.9.0) PLATFORMS ruby x86_64-darwin-19 DEPENDENCIES + irb jekyll jekyll-avatar jekyll-feed jekyll-sitemap + mgem rake + yard-coderay + yard-mruby BUNDLED WITH 2.4.1 From 8d25123eb682c655e1acb1ee1e7bea5ac581a7d7 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 22:00:53 +0100 Subject: [PATCH 29/39] Rename redesign to default --- _includes/_latest_news.html | 19 --- _includes/footer.html | 26 ++-- _includes/{redesign_head.html => head.html} | 2 +- _includes/header.html | 18 --- _includes/{redesign_nav.html => nav.html} | 0 _includes/navigation.html | 32 ----- _includes/redesign_footer.html | 13 -- _layouts/default.html | 33 ++--- _layouts/post.html | 6 +- _layouts/redesign.html | 25 ---- about/index.html | 2 +- assets/css/main.css | 134 -------------------- assets/css/{redesign.scss => main.scss} | 0 docs/index.html | 2 +- downloads/index.html | 2 +- index.html | 2 +- libraries/index.html | 2 +- team/index.html | 2 +- 18 files changed, 40 insertions(+), 280 deletions(-) delete mode 100644 _includes/_latest_news.html rename _includes/{redesign_head.html => head.html} (94%) delete mode 100644 _includes/header.html rename _includes/{redesign_nav.html => nav.html} (100%) delete mode 100644 _includes/navigation.html delete mode 100644 _includes/redesign_footer.html delete mode 100644 _layouts/redesign.html delete mode 100644 assets/css/main.css rename assets/css/{redesign.scss => main.scss} (100%) diff --git a/_includes/_latest_news.html b/_includes/_latest_news.html deleted file mode 100644 index 0890037..0000000 --- a/_includes/_latest_news.html +++ /dev/null @@ -1,19 +0,0 @@ -
      -
      -

      Latest News

      -
      -
      -
      -
      -
        - {% for post in site.posts %} -
      • -

        - {{ post.date | date_to_string }}: - {{ post.title }} -

        -
      • - {% endfor %} -
      -
      -
      diff --git a/_includes/footer.html b/_includes/footer.html index 040ba8a..819d51c 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -1,13 +1,13 @@ - + diff --git a/_includes/redesign_head.html b/_includes/head.html similarity index 94% rename from _includes/redesign_head.html rename to _includes/head.html index 1260641..b69d576 100644 --- a/_includes/redesign_head.html +++ b/_includes/head.html @@ -11,7 +11,7 @@ - + diff --git a/_includes/header.html b/_includes/header.html deleted file mode 100644 index a3ab86b..0000000 --- a/_includes/header.html +++ /dev/null @@ -1,18 +0,0 @@ - - - {{ page.title }} - - {% include icons.html %} - - - - - - - - - - - - - diff --git a/_includes/redesign_nav.html b/_includes/nav.html similarity index 100% rename from _includes/redesign_nav.html rename to _includes/nav.html diff --git a/_includes/navigation.html b/_includes/navigation.html deleted file mode 100644 index 6b67e0f..0000000 --- a/_includes/navigation.html +++ /dev/null @@ -1,32 +0,0 @@ - diff --git a/_includes/redesign_footer.html b/_includes/redesign_footer.html deleted file mode 100644 index 819d51c..0000000 --- a/_includes/redesign_footer.html +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/_layouts/default.html b/_layouts/default.html index a9b06f6..2879af4 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,24 +1,25 @@ - {% include header.html %} + {% include head.html %} - - {% include navigation.html %} - -
      - -
      -
      - - {{ content }} - -
      -
      + {% include nav.html %} +
      + {{ content }}
      - {% include footer.html %} - + - \ No newline at end of file + diff --git a/_layouts/post.html b/_layouts/post.html index 0bcffc1..c12e786 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -1,10 +1,10 @@ - {% include redesign_head.html %} + {% include head.html %} - {% include redesign_nav.html %} + {% include nav.html %}
      @@ -37,7 +37,7 @@

      {{ page.title }}

      - {% include redesign_footer.html %} + {% include footer.html %} - - diff --git a/about/index.html b/about/index.html index cc4138c..708f8d6 100644 --- a/about/index.html +++ b/about/index.html @@ -1,5 +1,5 @@ --- -layout: redesign +layout: default title: mruby — About --- diff --git a/assets/css/main.css b/assets/css/main.css deleted file mode 100644 index 339fd9c..0000000 --- a/assets/css/main.css +++ /dev/null @@ -1,134 +0,0 @@ -a { - color: #ce2812; -} - -.container { - padding-top: 120px; -} - -.navbar-header img { - margin-left: 160px; - top:0; - position: absolute; -} - -.footer { - padding-top: 20px; - margin-top: 20px; - text-align: center; -} - -.navbar-mruby { - background-color: transparent; - background-image: url('/assets/images/navigation_bg.png'); - border: 0px; - position: fixed; - top: 0px; - right: 0px; - left: 0px; - z-index: 100; - height: unset; -} - -.navbar-mruby .navbar-brand { - color: #ce2812; -} -.navbar-mruby .navbar-brand:hover, .navbar-mruby .navbar-brand:focus { - color: #f00; -} -.navbar-mruby .navbar-text { - color: #ce2812; -} - -.navbar-mruby .navbar-nav { - float: right; - padding-right: 120px; -} - -.navbar-nav > li { - float: left; -} - -.navbar-mruby .navbar-nav > li > a { - padding: 15px 22px!important; - color: #ce2812; -} -.navbar-mruby .navbar-nav > li > a:hover, .navbar-mruby .navbar-nav > li > a:focus { - color: #fff; - background-color: #ce2812; -} -.navbar-mruby .navbar-nav > .active > a, .navbar-mruby .navbar-nav > .active > a:hover, .navbar-mruby .navbar-nav > .active > a:focus { - color: #f00; - background-color: #eee; -} -.navbar-mruby .navbar-nav > .open > a, .navbar-mruby .navbar-nav > .open > a:hover, .navbar-mruby .navbar-nav > .open > a:focus { - color: #f00; - background-color: #eee; -} -.navbar-mruby .navbar-toggle { - border-color: #eee; -} -.navbar-mruby .navbar-toggle:hover, .navbar-mruby .navbar-toggle:focus { - background-color: #eee; -} -.navbar-mruby .navbar-toggle .icon-bar { - background-color: #ce2812; -} -.navbar-mruby .navbar-collapse, -.navbar-mruby .navbar-form { - border-color: #ce2812; -} -.navbar-mruby .navbar-link { - color: #ce2812; -} -.navbar-mruby .navbar-link:hover { - color: #f00; - background-color: #000; -} - -@media (max-width: 950px) { - .navbar-header img { - margin-left: 0px; - margin-right: 20px; - } -} - -@media (max-width: 767px) { - .navbar-mruby .navbar-nav .open .dropdown-menu > li > a { - color: #ce2812; - } - .navbar-mruby .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-mruby .navbar-nav .open .dropdown-menu > li > a:focus { - color: #f00; - } - .navbar-mruby .navbar-nav .open .dropdown-menu > .active > a, .navbar-mruby .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-mruby .navbar-nav .open .dropdown-menu > .active > a:focus { - color: #f00; - background-color: #eee; - } -} - -.mruby-is { - padding: 5px 20px 20px 20px; - border-bottom: 1px solid #e5e5e5; -} - -.mruby-is p { - font-size: 150%; - padding-top: 15px; -} - -.mruby-is-get { - text-align: center; - padding-top: 5px; -} - -.mruby-is img { - width: auto; - height: 90px; - float: left; - padding-right: 20px; -} - -table td,th { - border:2px solid #eee; - padding:4px; -} diff --git a/assets/css/redesign.scss b/assets/css/main.scss similarity index 100% rename from assets/css/redesign.scss rename to assets/css/main.scss diff --git a/docs/index.html b/docs/index.html index 364c197..30a1b0b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,5 +1,5 @@ --- -layout: redesign +layout: default title: mruby - Documentation --- diff --git a/downloads/index.html b/downloads/index.html index b87ced4..f359407 100644 --- a/downloads/index.html +++ b/downloads/index.html @@ -1,5 +1,5 @@ --- -layout: redesign +layout: default title: mruby - Downloads --- diff --git a/index.html b/index.html index bb5be2c..9cb2ce4 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ --- -layout: redesign +layout: default title: mruby - Lightweight Ruby --- diff --git a/libraries/index.html b/libraries/index.html index 649af8f..21dbd25 100644 --- a/libraries/index.html +++ b/libraries/index.html @@ -1,5 +1,5 @@ --- -layout: redesign +layout: default title: mruby - Libraries --- diff --git a/team/index.html b/team/index.html index 4313fbc..19ef01c 100644 --- a/team/index.html +++ b/team/index.html @@ -1,5 +1,5 @@ --- -layout: redesign +layout: default title: mruby — Team --- From 9c24bd98bfc0e98f89610728cfa8ea5386a9c8b1 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 22:01:24 +0100 Subject: [PATCH 30/39] Test on redesign branch --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index d15ac9a..989cfd9 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -2,7 +2,7 @@ name: Pages on: push: - branches: [master] + branches: [master, redesign] workflow_dispatch: permissions: From 8150d393d2800c68123d21ef9092f0b0f7310069 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 22:08:43 +0100 Subject: [PATCH 31/39] Sort --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 15bd8f2..a4686f6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,6 @@ source 'https://rubygems.org' +gem 'irb' gem 'jekyll' gem 'jekyll-avatar' gem 'jekyll-feed' @@ -8,4 +9,3 @@ gem 'mgem' gem 'rake' gem 'yard-coderay' gem 'yard-mruby' -gem 'irb' From eb1632129718bf83ddedd5bff9897e32e8562878 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 22:08:49 +0100 Subject: [PATCH 32/39] Bump bundler --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5fae1d4..7b7d261 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -132,4 +132,4 @@ DEPENDENCIES yard-mruby BUNDLED WITH - 2.4.1 + 4.0.7 From f041802b8e597b0f5e168d9e21c01da3d4275b0e Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 22:09:14 +0100 Subject: [PATCH 33/39] Remove unused scripts --- gen_mgemdata.rb | 26 ------------------ gen_mrbdoc.rb | 32 ---------------------- gen_releasedata.rb | 68 ---------------------------------------------- 3 files changed, 126 deletions(-) delete mode 100644 gen_mgemdata.rb delete mode 100644 gen_mrbdoc.rb delete mode 100644 gen_releasedata.rb diff --git a/gen_mgemdata.rb b/gen_mgemdata.rb deleted file mode 100644 index bd4d9bf..0000000 --- a/gen_mgemdata.rb +++ /dev/null @@ -1,26 +0,0 @@ -require 'mgem' -require 'yaml' - -include Mrbgem -mgems = load_gems - -mgems.update! - -mgem_info = [] -mgems.each do |mgem| - mgem_info << { - 'name' => mgem.name, - 'description' => mgem.description, - 'author' => mgem.author, - 'website' => mgem.website, - 'protocol' => mgem.protocol, - 'repository' => mgem.repository, - 'repooptions' => mgem.repooptions - } -end - -mgem_info.sort! { |a,b| a['name'].downcase <=> b['name'].downcase } - -File.open('_data/mgems.yml', 'w') do |f| - f.write(mgem_info.to_yaml) -end diff --git a/gen_mrbdoc.rb b/gen_mrbdoc.rb deleted file mode 100644 index a4d068f..0000000 --- a/gen_mrbdoc.rb +++ /dev/null @@ -1,32 +0,0 @@ -require 'git' - -Dir.mktmpdir do |tmp_mruby_src| - - Git.clone('https://github.com/mruby/mruby.git', 'mruby', :path => tmp_mruby_src) - - $: << "#{tmp_mruby_src}/mruby/doc/language/mrbdoc/lib" - - require 'mrbdoc_analyze' - require 'mrbdoc_docu' - - mrbdoc = MRBDoc.new - - mrbdoc.analyze_code "#{tmp_mruby_src}/mruby/" do |progress| - puts progress - end - - cfg = {:print_line_no => false} - mrbdoc.write_documentation 'docs/', cfg do |progress| - puts progress - end - - Dir.glob('docs/*.md') do |md_filename| - title = File.basename(md_filename, '.md') - File.open("#{md_filename}.tmp", 'w') do |md_file| - md_file << "---\nlayout: default\ntitle: #{title}\n---\n\n" - md_file << File.read(md_filename) - end - File.rename("#{md_filename}.tmp", md_filename) - end - -end diff --git a/gen_releasedata.rb b/gen_releasedata.rb deleted file mode 100644 index 0fa50f3..0000000 --- a/gen_releasedata.rb +++ /dev/null @@ -1,68 +0,0 @@ -# Regenerate _data/releases.yml from GitHub API. -# -# All pages derive the current stable release from the first non-prerelease -# entry in this file. Run this script after each new release or RC tag. -# -# Stable release dates are sourced from blog post filenames where available, -# falling back to the GitHub commit date for releases without a post. -# -# Usage: -# bundle exec ruby gen_releasedata.rb -# -# Requires a GitHub token via GH_TOKEN env var or `gh auth token`. - -require 'net/http' -require 'json' -require 'yaml' - -REPO = 'mruby/mruby' -DATA_FILE = File.join(__dir__, '_data', 'releases.yml') - -def gh_get(path) - uri = URI("https://api.github.com#{path}") - token = ENV['GH_TOKEN'] || `gh auth token 2>/dev/null`.strip - headers = { - 'Accept' => 'application/vnd.github.v3+json', - 'User-Agent' => 'mruby-site', - 'Authorization' => "Bearer #{token}" - } - Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http| - JSON.parse(http.get(uri.request_uri, headers).body) - end -end - -# Derive release dates from blog post filenames (format: YYYY-MM-DD-mruby-X.Y.Z-released.*) -post_dates = {} -Dir.glob(File.join(__dir__, '_posts', '*.{markdown,md}')).each do |f| - if (m = File.basename(f).match(/^(\d{4}-\d{2}-\d{2})-mruby-([\d.]+)-released/)) - post_dates[m[2]] = m[1] - end -end - -# Fetch all tags (paginated) -tags = [] -page = 1 -loop do - batch = gh_get("/repos/#{REPO}/tags?per_page=100&page=#{page}") - break if batch.empty? - tags.concat(batch) - break if batch.size < 100 - page += 1 -end - -# Keep all version-like tags (stable + rc/preview) -versioned = tags.select { |t| t['name'].match?(/^\d/) } - -releases = versioned.map do |tag| - version = tag['name'] - prerelease = !version.match?(/^\d+\.\d+\.\d+$/) - date = post_dates[version] || begin - commit = gh_get("/repos/#{REPO}/commits/#{tag['commit']['sha']}") - commit.dig('commit', 'committer', 'date')&.slice(0, 10) - end - $stdout.puts " #{version}: #{date}#{' (prerelease)' if prerelease}" - { 'version' => version, 'date' => date, 'prerelease' => prerelease } -end - -File.write(DATA_FILE, releases.to_yaml) -$stdout.puts "\nWritten #{releases.size} releases to #{DATA_FILE}" From 0e67dbb543cad46a1c368eaca7faed027afe2561 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 22:19:26 +0100 Subject: [PATCH 34/39] Cleanup --- Rakefile | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/Rakefile b/Rakefile index 99e5806..baf6db8 100644 --- a/Rakefile +++ b/Rakefile @@ -4,6 +4,7 @@ namespace :gen do require 'mgem' require 'yaml' + # mgem still uses old exists? method class File class << self alias_method :exists?, :exist? unless method_defined?(:exists?) @@ -28,45 +29,52 @@ namespace :gen do mgem_info.sort_by! { |g| g['name'].downcase } - File.open('_data/mgems.yml', 'w') { |f| f.write(mgem_info.to_yaml) } - puts 'Written _data/mgems.yml' + dest = File.join(__dir__, '_data', 'mgems.yml') + + File.write(dest, mgem_info.to_yaml) + puts "Written #{dest}" end desc 'Regenerate API documentation from mruby source (clones latest release into mruby/)' task :mrbdoc do require 'json' + require 'shellwords' # Resolve latest stable release tag via gh CLI (mruby uses tags, not GitHub Releases) - tags = JSON.parse(`gh api 'repos/mruby/mruby/tags?per_page=100'`) - tag = tags.map { |t| t['name'] }.find { |n| n.match?(/^\d+\.\d+\.\d+$/) } + tags = [] + page = 1 + loop do + batch = JSON.parse(`gh api "repos/mruby/mruby/tags?per_page=100&page=#{page}"`) + break if batch.empty? + tags.concat(batch) + break if batch.size < 100 + page += 1 + end + tag = tags.map { |t| t['name'] }.find { |n| n.match?(/^\d+\.\d+\.\d+$/) } raise "Could not determine latest stable mruby release tag" unless tag puts "Latest mruby release: #{tag}" # Clone mruby at the release tag (or skip if already at the right version) mruby_dir = File.join(__dir__, 'mruby') - if Dir.exist?(mruby_dir) - current_tag = `git -C #{mruby_dir} describe --exact-match HEAD 2>/dev/null`.strip - if current_tag == tag - puts "mruby #{tag} already cloned, skipping clone" - else - puts "mruby dir exists at #{current_tag.empty? ? 'unknown version' : current_tag}, re-cloning at #{tag}" - FileUtils.rm_rf(mruby_dir) - sh "git clone --depth 1 --branch #{tag} https://github.com/mruby/mruby.git #{mruby_dir}" - end + current_tag = Dir.exist?(mruby_dir) ? `git -C #{Shellwords.escape(mruby_dir)} describe --exact-match HEAD 2>/dev/null`.strip : nil + if current_tag == tag + puts "mruby #{tag} already cloned, skipping clone" else - sh "git clone --depth 1 --branch #{tag} https://github.com/mruby/mruby.git #{mruby_dir}" + puts current_tag ? "mruby dir exists at #{current_tag}, re-cloning at #{tag}" : "Cloning mruby #{tag}" + FileUtils.rm_rf(mruby_dir) + sh "git clone --depth 1 --branch #{Shellwords.escape(tag)} https://github.com/mruby/mruby.git #{Shellwords.escape(mruby_dir)}" end # Run mrbdoc (from yard-mruby) in the mruby directory — equivalent to doc:api Dir.chdir(mruby_dir) do - sh "BUNDLE_GEMFILE=#{__dir__}/Gemfile bundle exec mrbdoc" + sh "env BUNDLE_GEMFILE=#{Shellwords.escape(File.join(__dir__, 'Gemfile'))} bundle exec mrbdoc" end # Copy generated docs into our docs/api/ directory dest = File.join(__dir__, 'docs', 'api') FileUtils.mkdir_p(dest) FileUtils.cp_r(Dir.glob("#{mruby_dir}/doc/api/*"), dest) - puts "Copied mruby API docs to docs/api/" + puts "Copied mruby API docs to #{dest}" end desc 'Regenerate release data from GitHub API (_data/releases.yml)' From e63f771564b6893e50735ba2e8ddba99481bbce5 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 22:23:14 +0100 Subject: [PATCH 35/39] Don't deploy on redesign --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 989cfd9..d15ac9a 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -2,7 +2,7 @@ name: Pages on: push: - branches: [master, redesign] + branches: [master] workflow_dispatch: permissions: From 872779a7dc16aa58ec1fb62765fb9b9b84cc85fe Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 22:42:11 +0100 Subject: [PATCH 36/39] Only build on official repo --- .github/workflows/pages.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index d15ac9a..8785c73 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -16,6 +16,7 @@ concurrency: jobs: build: + if: github.repository == 'mruby/mruby.github.io' runs-on: ubuntu-latest steps: - name: Checkout @@ -40,6 +41,7 @@ jobs: uses: actions/upload-pages-artifact@v3 deploy: + if: github.repository == 'mruby/mruby.github.io' environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} From c8e2b8dd58f69038a4749807b1c8834b3e4cca1b Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 22:42:41 +0100 Subject: [PATCH 37/39] Generate contributors.yml --- Rakefile | 26 ++++- _data/contributors.yml | 217 +++++++++++++++++++++++++++++++++++++++++ team/index.html | 82 +--------------- 3 files changed, 246 insertions(+), 79 deletions(-) create mode 100644 _data/contributors.yml diff --git a/Rakefile b/Rakefile index baf6db8..44d36e3 100644 --- a/Rakefile +++ b/Rakefile @@ -77,6 +77,30 @@ namespace :gen do puts "Copied mruby API docs to #{dest}" end + desc 'Regenerate contributor list from mruby AUTHORS file (_data/contributors.yml)' + task :contributors do + require 'yaml' + + mruby_dir = File.join(__dir__, 'mruby') + raise "mruby/ not found — run gen:mrbdoc first" unless Dir.exist?(mruby_dir) + + threshold = (ENV['CONTRIBUTOR_THRESHOLD'] || '10').to_i + + # AUTHORS format: " COUNT Name (@login)[*+]" + contributors = File.readlines(File.join(mruby_dir, 'AUTHORS'), chomp: true) + .filter_map do |line| + m = line.match(/^\s*(\d+)\s+(.+?)\s+\(@([\w-]+)\)[*+]?\s*$/) + next unless m + count = m[1].to_i + next if count < threshold + { 'name' => m[2], 'login' => m[3], 'count' => count } + end + + dest = File.join(__dir__, '_data', 'contributors.yml') + File.write(dest, contributors.to_yaml) + puts "Written #{contributors.size} contributors (threshold: #{threshold} commits) to #{dest}" + end + desc 'Regenerate release data from GitHub API (_data/releases.yml)' task :releasedata do require 'json' @@ -124,7 +148,7 @@ namespace :gen do end desc 'Build the Jekyll site' -task build: %w[gen:mgemdata gen:mrbdoc gen:releasedata] do +task build: %w[gen:mgemdata gen:mrbdoc gen:contributors gen:releasedata] do sh 'bundle exec jekyll build' end diff --git a/_data/contributors.yml b/_data/contributors.yml new file mode 100644 index 0000000..f7d5c49 --- /dev/null +++ b/_data/contributors.yml @@ -0,0 +1,217 @@ +--- +- name: Yukihiro "Matz" Matsumoto + login: matz + count: 6083 +- name: dearblue + login: dearblue + count: 673 +- name: KOBAYASHI Shuji + login: shuujii + count: 587 +- name: Daniel Bovensiepen + login: bovi + count: 353 +- name: Takeshi Watanabe + login: take-cheeze + count: 345 +- name: Masaki Muranaka + login: monaka + count: 333 +- name: Jun Hiroe + login: suzukaze + count: 234 +- name: Tomoyuki Sahara + login: tsahara + count: 228 +- name: Cremno + login: cremno + count: 220 +- name: John Bampton + login: jbampton + count: 219 +- name: Yuki Kurihara + login: ksss + count: 209 +- name: Yasuhiro Matsumoto + login: mattn + count: 144 +- name: Carson McDonald + login: carsonmcdonald + count: 113 +- name: Tomasz Pędraszewski + login: dabroz + count: 104 +- name: Akira Yumiyama + login: akiray03 + count: 83 +- name: skandhas + login: skandhas + count: 83 +- name: Masamitsu MURASE + login: masamitsu-murase + count: 80 +- name: Tatsuhiko Kubo + login: cubicdaiya + count: 71 +- name: Yuichiro MASUI + login: masuidrive + count: 71 +- name: Hiroshi Mimaki + login: mimaki + count: 69 +- name: Yuichiro Kaneko + login: yui-knk + count: 62 +- name: Kurebayashi, Takahiro + login: crimsonwoods + count: 59 +- name: h2so5 + login: h2so5 + count: 56 +- name: Ralph Desir + login: Mav7 + count: 52 +- name: Paolo Bosetti + login: pbosetti + count: 48 +- name: Rory O'Connell + login: RoryO + count: 45 +- name: fleuria + login: flaneur2020 + count: 42 +- name: Christopher Aue + login: christopheraue + count: 40 +- name: Seba Gamboa + login: sagmor + count: 40 +- name: Kouhei Sutou + login: kou + count: 39 +- name: Masayoshi Takahashi + login: takahashim + count: 32 +- name: MATSUMOTO Ryosuke + login: matsumotory + count: 31 +- name: Nobuyoshi Nakada + login: nobu + count: 30 +- name: Hoshiumi Arata + login: hoshiumiarata + count: 26 +- name: Julian Aron Prenner + login: furunkel + count: 25 +- name: Clayton Smith + login: clayton-shopify + count: 22 +- name: Uchio Kondo + login: udzura + count: 22 +- name: Zachary Scott + login: zzak + count: 22 +- name: Ryan Lopopolo + login: lopopolo + count: 21 +- name: Ryan Scott + login: ryan-scott-dev + count: 20 +- name: Bouke van der Bijl + login: bouk + count: 19 +- name: Jared Breeden + login: jbreeden + count: 19 +- name: go kikuta + login: gkta + count: 19 +- name: Corey Powell + login: IceDragon200 + count: 18 +- name: Hidetaka Takano + login: TJ-Hidetaka-Takano + count: 18 +- name: Jon Maken + login: jonforums + count: 18 +- name: mirichi + login: mirichi + count: 18 +- name: Mitchell Blank Jr + login: mitchblank + count: 17 +- name: bggd + login: bggd + count: 16 +- name: kano4 + login: kano4 + count: 16 +- name: Felix Jones + login: felixjones + count: 15 +- name: Blaž Hrastnik + login: archseer + count: 14 +- name: Kazuki Tsujimoto + login: k-tsj + count: 14 +- name: Tadashi FUKUZAWA + login: FUKUZAWA-Tadashi + count: 14 +- name: fn ⌃ ⌥ + login: FnControlOption + count: 14 +- name: leviongit + login: leviongit + count: 14 +- name: Jose Narvaez + login: goyox86 + count: 13 +- name: Patrick Hogan + login: pbhogan + count: 13 +- name: Akira Kuroda + login: akuroda + count: 12 +- name: NAKAMURA Usaku + login: unak + count: 12 +- name: Ray Chason + login: chasonr + count: 12 +- name: Takashi Sawanaka + login: sdottaka + count: 12 +- name: Ukrainskiy Sergey + login: ukrainskiysergey + count: 12 +- name: Xuejie "Rafael" Xiao + login: xxuejie + count: 12 +- name: Julien Ammous + login: schmurfy + count: 11 +- name: Kazuho Oku + login: kazuho + count: 11 +- name: RIZAL Reckordp + login: Reckordp + count: 11 +- name: Seeker + login: SeekingMeaning + count: 11 +- name: takkaw + login: takkaw + count: 11 +- name: Miura Hideki + login: miura1729 + count: 10 +- name: Narihiro Nakamura + login: authorNari + count: 10 +- name: Yuichi Nishiwaki + login: nyuichi + count: 10 diff --git a/team/index.html b/team/index.html index 19ef01c..ea4c7b9 100644 --- a/team/index.html +++ b/team/index.html @@ -50,85 +50,11 @@

      mruby Developers

      — from the AUTHORS file
      - Yukihiro Matsumoto + {%- for contributor in site.data.contributors -%} + {{ contributor.name }} · - FUKUOKA CSK CORPORATION - · - Kyushu Institute of Technology - · - Network Applied Communication Laboratory, Inc. - · - Daniel Bovensiepen - · - Jon Maken - · - Bjorn De Meyer - · - Yuichiro MASUI - · - Masamitsu MURASE - · - Masaki Muranaka - · - Internet Initiative Japan Inc. - · - Tadashi FUKUZAWA - · - MATSUMOTO Ryosuke - · - Koji Yoshioka - · - Jun Hiroe - · - Narihiro Nakamura - · - Yuichi Nishiwaki - · - Tatsuhiko Kubo - · - Takeshi Watanabe - · - specified non-profit corporation mruby Forum - · - Kazuaki Tanaka - · - Hiromasa Ishii - · - Hiroshi Mimaki - · - Satoshi Odawara - · - Mitsubishi Electric Micro-Computer Application Software Co.,Ltd. - · - Ralph Desir - · - Hiroyuki Matsuzaki - · - Yuhei Okazaki - · - Manycolors, Inc. - · - Shota Nakano - · - Yuichi Osawa - · - Terence Lee - · - Zachary Scott - · - Tomasz Dąbrowski - · - Christopher Aue - · - Masahiro Wakame - · - YAMAMOTO Masaya - · - KOBAYASHI Shuji - · - John Bampton - · - + 100 more on GitHub → + {%- endfor -%} + 300+ contributors on GitHub →
      From 214c438b5392ffe7c526aca81faa906ae2630d67 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 22:53:37 +0100 Subject: [PATCH 38/39] Update README.md --- README.md | 72 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 8e57c7f..f5c9fa9 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,79 @@ mruby.org ========= -This is the [Jekyll](https://jekyllrb.com/) source of -the [mruby.org](https://mruby.org/) website. +This is the [Jekyll](https://jekyllrb.com/) source of the [mruby.org](https://mruby.org/) website. -## Preview +## Prerequisites -The following will give you a preview of the site. +- **Ruby** — version is specified in `.ruby-version` +- **Bundler** — `gem install bundler` +- **`gh` CLI** — required by `gen:mrbdoc` and `gen:releasedata` to query the GitHub API -Install bundler: +## Local development ```shell -gem install bundler +git clone https://github.com/mruby/mruby.github.io +cd mruby.github.io +bundle install ``` -Clone the repository: +Serve the site locally with live reload: ```shell -git clone https://github.com/mruby/mruby.github.io +bundle exec rake serve +# or use the convenience script: +./server ``` -Install Jekyll and its dependencies: +## Build + +Runs all data generation tasks then builds the Jekyll site: ```shell -cd mruby.github.io -bundle install +bundle exec rake build ``` -Preview the site: +## Data generation tasks + +Each task can also be run individually: + +### `rake gen:mgemdata` + +Regenerates `_data/mgems.yml` from the mrbgems registry. Do not edit this file manually. + +```shell +bundle exec rake gen:mgemdata +``` + +### `rake gen:mrbdoc` + +Clones the latest stable mruby release into `mruby/`, generates YARD API documentation, and copies it to `docs/api/`. Requires the `gh` CLI. ```shell -bundle exec jekyll serve -open "http://localhost:4000" +bundle exec rake gen:mrbdoc ``` + +### `rake gen:contributors` + +Generates `_data/contributors.yml` from the mruby `AUTHORS` file. Requires `mruby/` to exist (run `gen:mrbdoc` first). The `CONTRIBUTOR_THRESHOLD` environment variable sets the minimum commit count (default: 10). + +```shell +bundle exec rake gen:contributors +CONTRIBUTOR_THRESHOLD=20 bundle exec rake gen:contributors +``` + +### `rake gen:releasedata` + +Generates `_data/releases.yml` from the GitHub API. Requires the `gh` CLI. + +```shell +bundle exec rake gen:releasedata +``` + +## Deployment + +GitHub Actions (`.github/workflows/pages.yml`) triggers on push to `master`. It runs `bundle exec rake build` (with `GH_TOKEN` set for the `gh` CLI calls) and deploys the result to GitHub Pages via `actions/deploy-pages`. + +## CI + +The lint workflow (`.github/workflows/lint.yml`) runs on all pull requests and checks for spelling errors (`misspell`) and merge conflict markers. From 67a35bbedd000116916c98163b13e8f11f2a1efa Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Thu, 5 Mar 2026 22:58:10 +0100 Subject: [PATCH 39/39] Add logo in the background --- _sass/_page-header.scss | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/_sass/_page-header.scss b/_sass/_page-header.scss index cebbe03..2fac2b5 100644 --- a/_sass/_page-header.scss +++ b/_sass/_page-header.scss @@ -10,6 +10,7 @@ background: var(--color-bg-warm); border-bottom: 1px solid var(--color-border); padding: 80px var(--container-padding) 56px; + overflow: hidden; /* --plain: no background, no border (downloads) */ &--plain { @@ -17,6 +18,12 @@ border-bottom: none; } + &--plain &__inner::after, + &--article &__inner::after, + &--split &__inner::after { + display: none; + } + /* --article: tighter top padding, used in post layout */ &--article { padding-top: 64px; @@ -38,6 +45,20 @@ .page-header__inner { max-width: var(--container-max-width); margin: 0 auto; + position: relative; + + &::after { + content: ''; + position: absolute; + right: 0; + top: 50%; + transform: translateY(-50%); + width: 340px; + height: 340px; + background: url('/assets/images/mruby_logo_red_icon.png') no-repeat center / contain; + opacity: 0.07; + pointer-events: none; + } } /* Left column in split layouts (implicit — no special style needed) */ @@ -177,6 +198,10 @@ .page-header__aside { padding-bottom: 0; } + + .page-header__inner::after { + display: none; + } } /* ------------------------------------------------------------